diff --git a/CHANGELOG.md b/CHANGELOG.md index d832a6e076d..1e460999994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ -# 1.9.1 (unreleased) +# 1.9.1 (2014-12-29) **Enhancements** -- [Issue #1028](https://github.com/grafana/grafana/issues/1028). Graph: New legend option ``hideEmtpy`` to hide series with only null values +- [Issue #1028](https://github.com/grafana/grafana/issues/1028). Graph: New legend option ``hideEmtpy`` to hide series with only null values from legend +- [Issue #1242](https://github.com/grafana/grafana/issues/1242). OpenTSDB: Downsample query field now supports interval template variable +- [Issue #1126](https://github.com/grafana/grafana/issues/1126). InfluxDB: Support more than 10 series name segments when using alias ``$number`` patterns **Fixes** +- [Issue #1251](https://github.com/grafana/grafana/issues/1251). Graph: Fix for y axis and scaled units (GiB etc) caused rounding, for example 400 GiB instead of 378 GiB - [Issue #1199](https://github.com/grafana/grafana/issues/1199). Graph: fix for series tooltip when one series is hidden/disabled - [Issue #1207](https://github.com/grafana/grafana/issues/1207). Graphite: movingAverage / movingMedian parameter type impovement, now handles int and interval parameter diff --git a/latest.json b/latest.json index 1757a561809..90189fabeca 100644 --- a/latest.json +++ b/latest.json @@ -1,4 +1,4 @@ { - "version": "1.9.0", - "url": "http://grafanarel.s3.amazonaws.com/grafana-1.9.0.tar.gz" + "version": "1.9.1", + "url": "http://grafanarel.s3.amazonaws.com/grafana-1.9.1.tar.gz" } diff --git a/package.json b/package.json index 90983011688..ba7a4c9324a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "company": "Coding Instinct AB" }, "name": "grafana", - "version": "1.9.0", + "version": "1.9.1", "repository": { "type": "git", "url": "http://github.com/torkelo/grafana.git" diff --git a/src/app/app.js b/src/app/app.js index f9f295696be..a1bd1c660b4 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -85,7 +85,7 @@ function (angular, $, _, appLevelRequire, config) { 'directives/all', 'filters/all', 'components/partials', - 'routes/all', + 'routes/backend/all', ]; _.each(config.plugins.dependencies, function(dep) { diff --git a/src/app/components/kbn.js b/src/app/components/kbn.js index ecef4bd164e..aedfbb90f17 100644 --- a/src/app/components/kbn.js +++ b/src/app/components/kbn.js @@ -339,7 +339,7 @@ function($, _, moment) { return ""; } - var factor = decimals ? Math.pow(10, decimals) : 1; + var factor = decimals ? Math.pow(10, Math.max(0, decimals)) : 1; var formatted = String(Math.round(value * factor) / factor); // if exponent return directly diff --git a/src/app/controllers/all.js b/src/app/controllers/all.js index 869486075bb..8703cf0f2bf 100644 --- a/src/app/controllers/all.js +++ b/src/app/controllers/all.js @@ -1,20 +1,9 @@ define([ - './pro/grafanaCtrl', - './pro/sharePanelCtrl', - './dashboardCtrl', - './dashboardNavCtrl', - './row', - './submenuCtrl', + './grafanaCtrl', './pulldown', './search', './metricKeys', - './graphiteTarget', './graphiteImport', - './influxTargetCtrl', - './playlistCtrl', './inspectCtrl', - './opentsdbTargetCtrl', - './annotationsEditorCtrl', - './templateEditorCtrl', './jsonEditorCtrl', ], function () {}); diff --git a/src/app/controllers/pro/accountCtrl.js b/src/app/controllers/pro/accountCtrl.js index 519209291c7..9aff39f2715 100644 --- a/src/app/controllers/pro/accountCtrl.js +++ b/src/app/controllers/pro/accountCtrl.js @@ -1,6 +1,5 @@ define([ 'angular', - 'services/pro/backendSrv', ], function (angular) { 'use strict'; diff --git a/src/app/controllers/pro/datasourcesCtrl.js b/src/app/controllers/pro/datasourcesCtrl.js index 431dd487388..5d53151a9ca 100644 --- a/src/app/controllers/pro/datasourcesCtrl.js +++ b/src/app/controllers/pro/datasourcesCtrl.js @@ -1,6 +1,5 @@ define([ 'angular', - 'services/pro/backendSrv', ], function (angular) { 'use strict'; diff --git a/src/app/controllers/search.js b/src/app/controllers/search.js index 4977ced75af..3abcf4ec0a3 100644 --- a/src/app/controllers/search.js +++ b/src/app/controllers/search.js @@ -19,6 +19,9 @@ function (angular, _, config, $) { $scope.db = datasourceSrv.getGrafanaDB(); $scope.currentSearchId = 0; + // events + $scope.onAppEvent('dashboard-deleted', $scope.dashboardDeleted); + $timeout(function() { $scope.giveSearchFocus = $scope.giveSearchFocus + 1; $scope.query.query = 'title:'; @@ -123,6 +126,10 @@ function (angular, _, config, $) { $scope.deleteDashboard = function(dash, evt) { evt.stopPropagation(); $scope.appEvent('delete-dashboard', { id: dash.id, title: dash.title }); + }; + + $scope.dashboardDeleted = function(evt, id) { + var dash = _.findWhere($scope.results.dashboards, {id: id}); $scope.results.dashboards = _.without($scope.results.dashboards, dash); }; diff --git a/src/app/directives/all.js b/src/app/directives/all.js index d75410f3d33..879b61e2512 100644 --- a/src/app/directives/all.js +++ b/src/app/directives/all.js @@ -12,11 +12,8 @@ define([ './spectrumPicker', './bootstrap-tagsinput', './bodyClass', - './addGraphiteFunc', - './graphiteFuncEditor', './templateParamSelector', './graphiteSegment', './grafanaVersionCheck', './dropdown.typeahead', - './influxdbFuncEditor' ], function () {}); diff --git a/src/app/directives/grafanaPanel.js b/src/app/directives/grafanaPanel.js index 9e3c87fde3d..5709c1dddf2 100644 --- a/src/app/directives/grafanaPanel.js +++ b/src/app/directives/grafanaPanel.js @@ -18,7 +18,7 @@ function (angular, $, config) { '
'+ '' + - '' + + '' + '' + '' + '' + diff --git a/src/app/features/all.js b/src/app/features/all.js index 5e11ae038f6..55f7f607131 100644 --- a/src/app/features/all.js +++ b/src/app/features/all.js @@ -1,3 +1,10 @@ define([ './panellinkeditor/module', + './annotations/annotationsSrv', + './templating/templateSrv', + './graphite/datasource', + './influxdb/datasource', + './opentsdb/datasource', + './elasticsearch/datasource', + './dashboard/all', ], function () {}); diff --git a/src/app/services/annotationsSrv.js b/src/app/features/annotations/annotationsSrv.js similarity index 98% rename from src/app/services/annotationsSrv.js rename to src/app/features/annotations/annotationsSrv.js index 68b5c85b5dd..2dd6da740e2 100644 --- a/src/app/services/annotationsSrv.js +++ b/src/app/features/annotations/annotationsSrv.js @@ -1,7 +1,8 @@ define([ 'angular', 'lodash', - 'moment' + 'moment', + './editorCtrl' ], function (angular, _, moment) { 'use strict'; diff --git a/src/app/controllers/annotationsEditorCtrl.js b/src/app/features/annotations/editorCtrl.js similarity index 100% rename from src/app/controllers/annotationsEditorCtrl.js rename to src/app/features/annotations/editorCtrl.js diff --git a/src/app/partials/annotations_editor.html b/src/app/features/annotations/partials/editor.html similarity index 98% rename from src/app/partials/annotations_editor.html rename to src/app/features/annotations/partials/editor.html index a470dcb082e..cec67e28e66 100644 --- a/src/app/partials/annotations_editor.html +++ b/src/app/features/annotations/partials/editor.html @@ -16,7 +16,7 @@
-
+
No annotations defined
diff --git a/src/app/features/dashboard/all.js b/src/app/features/dashboard/all.js new file mode 100644 index 00000000000..74c2fa0bb80 --- /dev/null +++ b/src/app/features/dashboard/all.js @@ -0,0 +1,14 @@ +define([ + './dashboardCtrl', + './dashboardNavCtrl', + './playlistCtrl', + './rowCtrl', + './sharePanelCtrl', + './submenuCtrl', + './dashboardSrv', + './keybindings', + './viewStateSrv', + './playlistSrv', + './panelSrv', + './timeSrv', +], function () {}); diff --git a/src/app/controllers/dashboardCtrl.js b/src/app/features/dashboard/dashboardCtrl.js similarity index 100% rename from src/app/controllers/dashboardCtrl.js rename to src/app/features/dashboard/dashboardCtrl.js diff --git a/src/app/controllers/dashboardNavCtrl.js b/src/app/features/dashboard/dashboardNavCtrl.js similarity index 99% rename from src/app/controllers/dashboardNavCtrl.js rename to src/app/features/dashboard/dashboardNavCtrl.js index 3e3321b7d0d..14a914821b1 100644 --- a/src/app/controllers/dashboardNavCtrl.js +++ b/src/app/features/dashboard/dashboardNavCtrl.js @@ -107,6 +107,7 @@ function (angular, _, moment, config, store) { $scope.deleteDashboardConfirmed = function(options) { var id = options.id; $scope.db.deleteDashboard(id).then(function(id) { + $scope.appEvent('dashboard-deleted', id); $scope.appEvent('alert-success', ['Dashboard Deleted', id + ' has been deleted']); }, function(err) { $scope.appEvent('alert-error', ['Deleted failed', err]); diff --git a/src/app/services/dashboard/dashboardSrv.js b/src/app/features/dashboard/dashboardSrv.js similarity index 99% rename from src/app/services/dashboard/dashboardSrv.js rename to src/app/features/dashboard/dashboardSrv.js index 21789fc1740..94448265cca 100644 --- a/src/app/services/dashboard/dashboardSrv.js +++ b/src/app/features/dashboard/dashboardSrv.js @@ -4,7 +4,6 @@ define([ 'kbn', 'lodash', 'moment', - '../timer', ], function (angular, $, kbn, _, moment) { 'use strict'; diff --git a/src/app/services/dashboard/dashboardKeyBindings.js b/src/app/features/dashboard/keybindings.js similarity index 100% rename from src/app/services/dashboard/dashboardKeyBindings.js rename to src/app/features/dashboard/keybindings.js diff --git a/src/app/services/panelSrv.js b/src/app/features/dashboard/panelSrv.js similarity index 100% rename from src/app/services/panelSrv.js rename to src/app/features/dashboard/panelSrv.js diff --git a/src/app/controllers/playlistCtrl.js b/src/app/features/dashboard/playlistCtrl.js similarity index 100% rename from src/app/controllers/playlistCtrl.js rename to src/app/features/dashboard/playlistCtrl.js diff --git a/src/app/services/playlistSrv.js b/src/app/features/dashboard/playlistSrv.js similarity index 100% rename from src/app/services/playlistSrv.js rename to src/app/features/dashboard/playlistSrv.js diff --git a/src/app/controllers/row.js b/src/app/features/dashboard/rowCtrl.js similarity index 100% rename from src/app/controllers/row.js rename to src/app/features/dashboard/rowCtrl.js diff --git a/src/app/controllers/sharePanelCtrl.js b/src/app/features/dashboard/sharePanelCtrl.js similarity index 100% rename from src/app/controllers/sharePanelCtrl.js rename to src/app/features/dashboard/sharePanelCtrl.js diff --git a/src/app/controllers/submenuCtrl.js b/src/app/features/dashboard/submenuCtrl.js similarity index 100% rename from src/app/controllers/submenuCtrl.js rename to src/app/features/dashboard/submenuCtrl.js diff --git a/src/app/services/timeSrv.js b/src/app/features/dashboard/timeSrv.js similarity index 100% rename from src/app/services/timeSrv.js rename to src/app/features/dashboard/timeSrv.js diff --git a/src/app/services/unsavedChangesSrv.js b/src/app/features/dashboard/unsavedChangesSrv.js similarity index 100% rename from src/app/services/unsavedChangesSrv.js rename to src/app/features/dashboard/unsavedChangesSrv.js diff --git a/src/app/services/dashboard/dashboardViewStateSrv.js b/src/app/features/dashboard/viewStateSrv.js similarity index 100% rename from src/app/services/dashboard/dashboardViewStateSrv.js rename to src/app/features/dashboard/viewStateSrv.js diff --git a/src/app/services/elasticsearch/es-datasource.js b/src/app/features/elasticsearch/datasource.js similarity index 99% rename from src/app/services/elasticsearch/es-datasource.js rename to src/app/features/elasticsearch/datasource.js index 843bf8addf3..3c82d98f8d2 100644 --- a/src/app/services/elasticsearch/es-datasource.js +++ b/src/app/features/elasticsearch/datasource.js @@ -24,7 +24,7 @@ function (angular, _, config, kbn, moment) { this.saveTemp = _.isUndefined(datasource.save_temp) ? true : datasource.save_temp; this.saveTempTTL = _.isUndefined(datasource.save_temp_ttl) ? '30d' : datasource.save_temp_ttl; - this.annotationEditorSrc = 'app/partials/elasticsearch/annotation_editor.html'; + this.annotationEditorSrc = 'app/features/elasticsearch/partials/annotations.editor.html'; this.supportAnnotations = true; this.supportMetrics = false; } diff --git a/src/app/partials/elasticsearch/annotation_editor.html b/src/app/features/elasticsearch/partials/annotations.editor.html similarity index 100% rename from src/app/partials/elasticsearch/annotation_editor.html rename to src/app/features/elasticsearch/partials/annotations.editor.html diff --git a/src/app/directives/addGraphiteFunc.js b/src/app/features/graphite/addGraphiteFunc.js similarity index 98% rename from src/app/directives/addGraphiteFunc.js rename to src/app/features/graphite/addGraphiteFunc.js index b585e7d003f..5ea45618ce1 100644 --- a/src/app/directives/addGraphiteFunc.js +++ b/src/app/features/graphite/addGraphiteFunc.js @@ -3,7 +3,7 @@ define([ 'app', 'lodash', 'jquery', - '../services/graphite/gfunc', + './gfunc', ], function (angular, app, _, $, gfunc) { 'use strict'; diff --git a/src/app/services/graphite/graphiteDatasource.js b/src/app/features/graphite/datasource.js similarity index 97% rename from src/app/services/graphite/graphiteDatasource.js rename to src/app/features/graphite/datasource.js index cfaca71aa3d..68fd9a2890f 100644 --- a/src/app/services/graphite/graphiteDatasource.js +++ b/src/app/features/graphite/datasource.js @@ -4,7 +4,10 @@ define([ 'jquery', 'config', 'kbn', - 'moment' + 'moment', + './queryCtrl', + './funcEditor', + './addGraphiteFunc', ], function (angular, _, $, config, kbn, moment) { 'use strict'; @@ -17,14 +20,15 @@ function (angular, _, $, config, kbn, moment) { this.type = 'graphite'; this.basicAuth = datasource.basicAuth; this.url = datasource.url; - this.editorSrc = 'app/partials/graphite/editor.html'; this.name = datasource.name; - this.render_method = datasource.render_method || 'POST'; - this.supportAnnotations = true; - this.supportMetrics = true; - this.annotationEditorSrc = 'app/partials/graphite/annotation_editor.html'; this.cacheTimeout = datasource.cacheTimeout; this.withCredentials = datasource.withCredentials; + this.render_method = datasource.render_method || 'POST'; + + this.supportAnnotations = true; + this.supportMetrics = true; + this.editorSrc = 'app/features/graphite/partials/query.editor.html'; + this.annotationEditorSrc = 'app/features/graphite/partials/annotations.editor.html'; } GraphiteDatasource.prototype.query = function(options) { diff --git a/src/app/directives/graphiteFuncEditor.js b/src/app/features/graphite/funcEditor.js similarity index 100% rename from src/app/directives/graphiteFuncEditor.js rename to src/app/features/graphite/funcEditor.js diff --git a/src/app/services/graphite/gfunc.js b/src/app/features/graphite/gfunc.js similarity index 100% rename from src/app/services/graphite/gfunc.js rename to src/app/features/graphite/gfunc.js diff --git a/src/app/services/graphite/lexer.js b/src/app/features/graphite/lexer.js similarity index 100% rename from src/app/services/graphite/lexer.js rename to src/app/features/graphite/lexer.js diff --git a/src/app/services/graphite/parser.js b/src/app/features/graphite/parser.js similarity index 100% rename from src/app/services/graphite/parser.js rename to src/app/features/graphite/parser.js diff --git a/src/app/partials/graphite/annotation_editor.html b/src/app/features/graphite/partials/annotations.editor.html similarity index 100% rename from src/app/partials/graphite/annotation_editor.html rename to src/app/features/graphite/partials/annotations.editor.html diff --git a/src/app/partials/graphite/editor.html b/src/app/features/graphite/partials/query.editor.html similarity index 99% rename from src/app/partials/graphite/editor.html rename to src/app/features/graphite/partials/query.editor.html index 4e63cc1a0a8..d57184c16fd 100755 --- a/src/app/partials/graphite/editor.html +++ b/src/app/features/graphite/partials/query.editor.html @@ -3,7 +3,7 @@
diff --git a/src/app/controllers/graphiteTarget.js b/src/app/features/graphite/queryCtrl.js similarity index 98% rename from src/app/controllers/graphiteTarget.js rename to src/app/features/graphite/queryCtrl.js index 480d7023ed4..e270c555aa6 100644 --- a/src/app/controllers/graphiteTarget.js +++ b/src/app/features/graphite/queryCtrl.js @@ -2,8 +2,8 @@ define([ 'angular', 'lodash', 'config', - '../services/graphite/gfunc', - '../services/graphite/parser' + './gfunc', + './parser' ], function (angular, _, config, gfunc, Parser) { 'use strict'; @@ -11,7 +11,7 @@ function (angular, _, config, gfunc, Parser) { var module = angular.module('grafana.controllers'); var targetLetters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O']; - module.controller('GraphiteTargetCtrl', function($scope, $sce, templateSrv) { + module.controller('GraphiteQueryCtrl', function($scope, $sce, templateSrv) { $scope.init = function() { $scope.target.target = $scope.target.target || ''; diff --git a/src/app/services/influxdb/influxdbDatasource.js b/src/app/features/influxdb/datasource.js similarity index 98% rename from src/app/services/influxdb/influxdbDatasource.js rename to src/app/features/influxdb/datasource.js index c30f950e51b..dc542ec3cfd 100644 --- a/src/app/services/influxdb/influxdbDatasource.js +++ b/src/app/features/influxdb/datasource.js @@ -3,7 +3,9 @@ define([ 'lodash', 'kbn', './influxSeries', - './influxQueryBuilder' + './queryBuilder', + './queryCtrl', + './funcEditor', ], function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) { 'use strict'; @@ -14,20 +16,20 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) { function InfluxDatasource(datasource) { this.type = 'influxDB'; - this.editorSrc = 'app/partials/influxdb/editor.html'; this.urls = datasource.urls; this.username = datasource.username; this.password = datasource.password; this.name = datasource.name; this.basicAuth = datasource.basicAuth; + this.grafanaDB = datasource.grafanaDB; this.saveTemp = _.isUndefined(datasource.save_temp) ? true : datasource.save_temp; this.saveTempTTL = _.isUndefined(datasource.save_temp_ttl) ? '30d' : datasource.save_temp_ttl; - this.grafanaDB = datasource.grafanaDB; this.supportAnnotations = true; this.supportMetrics = true; - this.annotationEditorSrc = 'app/partials/influxdb/annotation_editor.html'; + this.editorSrc = 'app/features/influxdb/partials/query.editor.html'; + this.annotationEditorSrc = 'app/features/influxdb/partials/annotations.editor.html'; } InfluxDatasource.prototype.query = function(options) { diff --git a/src/app/directives/influxdbFuncEditor.js b/src/app/features/influxdb/funcEditor.js similarity index 100% rename from src/app/directives/influxdbFuncEditor.js rename to src/app/features/influxdb/funcEditor.js diff --git a/src/app/services/influxdb/influxSeries.js b/src/app/features/influxdb/influxSeries.js similarity index 88% rename from src/app/services/influxdb/influxSeries.js rename to src/app/features/influxdb/influxSeries.js index ff6906dd087..bca6ca7a865 100644 --- a/src/app/services/influxdb/influxSeries.js +++ b/src/app/features/influxdb/influxSeries.js @@ -106,21 +106,23 @@ function (_) { }; p.createNameForSeries = function(seriesName, groupByColValue) { - var name = this.alias - .replace('$s', seriesName); - + var regex = /\$(\w+)/g; var segments = seriesName.split('.'); - for (var i = 0; i < segments.length; i++) { - if (segments[i].length > 0) { - name = name.replace('$' + i, segments[i]); + + return this.alias.replace(regex, function(match, group) { + if (group === 's') { + return seriesName; } - } + else if (group === 'g') { + return groupByColValue; + } + var index = parseInt(group); + if (_.isNumber(index) && index < segments.length) { + return segments[index]; + } + return match; + }); - if (this.groupByField) { - name = name.replace('$g', groupByColValue); - } - - return name; }; return InfluxSeries; diff --git a/src/app/partials/influxdb/annotation_editor.html b/src/app/features/influxdb/partials/annotations.editor.html similarity index 100% rename from src/app/partials/influxdb/annotation_editor.html rename to src/app/features/influxdb/partials/annotations.editor.html diff --git a/src/app/partials/influxdb/editor.html b/src/app/features/influxdb/partials/query.editor.html similarity index 99% rename from src/app/partials/influxdb/editor.html rename to src/app/features/influxdb/partials/query.editor.html index 7fe41c1d268..44d19c80d89 100644 --- a/src/app/partials/influxdb/editor.html +++ b/src/app/features/influxdb/partials/query.editor.html @@ -3,7 +3,7 @@
diff --git a/src/app/services/influxdb/influxQueryBuilder.js b/src/app/features/influxdb/queryBuilder.js similarity index 100% rename from src/app/services/influxdb/influxQueryBuilder.js rename to src/app/features/influxdb/queryBuilder.js diff --git a/src/app/controllers/influxTargetCtrl.js b/src/app/features/influxdb/queryCtrl.js similarity index 97% rename from src/app/controllers/influxTargetCtrl.js rename to src/app/features/influxdb/queryCtrl.js index e2b1a5234d4..0d33445117b 100644 --- a/src/app/controllers/influxTargetCtrl.js +++ b/src/app/features/influxdb/queryCtrl.js @@ -9,7 +9,7 @@ function (angular, _) { var seriesList = null; - module.controller('InfluxTargetCtrl', function($scope, $timeout) { + module.controller('InfluxQueryCtrl', function($scope, $timeout) { $scope.init = function() { var target = $scope.target; diff --git a/src/app/services/opentsdb/opentsdbDatasource.js b/src/app/features/opentsdb/datasource.js similarity index 95% rename from src/app/services/opentsdb/opentsdbDatasource.js rename to src/app/features/opentsdb/datasource.js index 96784cbc992..d5bdd011dcf 100644 --- a/src/app/services/opentsdb/opentsdbDatasource.js +++ b/src/app/features/opentsdb/datasource.js @@ -2,7 +2,8 @@ define([ 'angular', 'lodash', 'kbn', - 'moment' + 'moment', + './queryCtrl', ], function (angular, _, kbn) { 'use strict'; @@ -13,7 +14,7 @@ function (angular, _, kbn) { function OpenTSDBDatasource(datasource) { this.type = 'opentsdb'; - this.editorSrc = 'app/partials/opentsdb/editor.html'; + this.editorSrc = 'app/features/opentsdb/partials/query.editor.html'; this.url = datasource.url; this.name = datasource.name; this.supportMetrics = true; @@ -148,7 +149,7 @@ function (angular, _, kbn) { } if (target.shouldDownsample) { - query.downsample = target.downsampleInterval + "-" + target.downsampleAggregator; + query.downsample = templateSrv.replace(target.downsampleInterval) + "-" + target.downsampleAggregator; } query.tags = angular.copy(target.tags); diff --git a/src/app/partials/opentsdb/editor.html b/src/app/features/opentsdb/partials/query.editor.html similarity index 99% rename from src/app/partials/opentsdb/editor.html rename to src/app/features/opentsdb/partials/query.editor.html index 51a575d933c..1b8cc3cee0a 100644 --- a/src/app/partials/opentsdb/editor.html +++ b/src/app/features/opentsdb/partials/query.editor.html @@ -2,7 +2,7 @@
diff --git a/src/app/controllers/opentsdbTargetCtrl.js b/src/app/features/opentsdb/queryCtrl.js similarity index 97% rename from src/app/controllers/opentsdbTargetCtrl.js rename to src/app/features/opentsdb/queryCtrl.js index 993ed8d3da6..a19b0211a9e 100644 --- a/src/app/controllers/opentsdbTargetCtrl.js +++ b/src/app/features/opentsdb/queryCtrl.js @@ -8,7 +8,7 @@ function (angular, _, kbn) { var module = angular.module('grafana.controllers'); - module.controller('OpenTSDBTargetCtrl', function($scope, $timeout) { + module.controller('OpenTSDBQueryCtrl', function($scope, $timeout) { $scope.init = function() { $scope.target.errors = validateTarget($scope.target); diff --git a/src/app/controllers/templateEditorCtrl.js b/src/app/features/templating/editorCtrl.js similarity index 100% rename from src/app/controllers/templateEditorCtrl.js rename to src/app/features/templating/editorCtrl.js diff --git a/src/app/services/templateSrv.js b/src/app/features/templating/templateSrv.js similarity index 98% rename from src/app/services/templateSrv.js rename to src/app/features/templating/templateSrv.js index c201147becf..c44ff0a5669 100644 --- a/src/app/services/templateSrv.js +++ b/src/app/features/templating/templateSrv.js @@ -1,6 +1,8 @@ define([ 'angular', 'lodash', + './editorCtrl', + './templateValuesSrv', ], function (angular, _) { 'use strict'; diff --git a/src/app/services/templateValuesSrv.js b/src/app/features/templating/templateValuesSrv.js similarity index 100% rename from src/app/services/templateValuesSrv.js rename to src/app/features/templating/templateValuesSrv.js diff --git a/src/app/panels/graph/graph.tooltip.js b/src/app/panels/graph/graph.tooltip.js index 9100fed47cf..9e750cb6a9c 100644 --- a/src/app/panels/graph/graph.tooltip.js +++ b/src/app/panels/graph/graph.tooltip.js @@ -70,7 +70,11 @@ function ($) { for (i = 0; i < seriesList.length; i++) { series = seriesList[i]; - if (!series.data.length) { continue; } + + if (!series.data.length) { + results.push({ hidden: true }); + continue; + } if (scope.panel.stack) { if (scope.panel.tooltip.value_type === 'individual') { @@ -99,9 +103,9 @@ function ($) { lasthoverIndex = hoverIndex; } - results.push({ value: value, hoverIndex: newhoverIndex, series: series }); + results.push({ value: value, hoverIndex: newhoverIndex}); } else { - results.push({ value: value, hoverIndex: hoverIndex, series: series }); + results.push({ value: value, hoverIndex: hoverIndex}); } } @@ -150,7 +154,12 @@ function ($) { for (i = 0; i < seriesHoverInfo.length; i++) { hoverInfo = seriesHoverInfo[i]; - series = hoverInfo.series; + + if (hoverInfo.hidden) { + continue; + } + + series = seriesList[i]; value = series.formatValue(hoverInfo.value); seriesHtml += '
'; diff --git a/src/app/panels/graph/module.js b/src/app/panels/graph/module.js index 90b6957b8b5..a1ae2bf2b4f 100644 --- a/src/app/panels/graph/module.js +++ b/src/app/panels/graph/module.js @@ -7,9 +7,6 @@ define([ 'moment', 'components/timeSeries', 'components/panelmeta', - 'services/panelSrv', - 'services/annotationsSrv', - 'services/datasourceSrv', './seriesOverridesCtrl', './graph', './legend', @@ -146,10 +143,9 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) { }; $scope.dataHandler = function(results) { - $scope.panelMeta.loading = false; - // png renderer returns just a url if (_.isString(results)) { + $scope.panelMeta.loading = false; $scope.render(results); return; } @@ -164,9 +160,11 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) { $scope.annotationsPromise .then(function(annotations) { + $scope.panelMeta.loading = false; $scope.seriesList.annotations = annotations; $scope.render($scope.seriesList); }, function() { + $scope.panelMeta.loading = false; $scope.render($scope.seriesList); }); }; diff --git a/src/app/panels/singlestat/editor.html b/src/app/panels/singlestat/editor.html index 67df1405682..88fc438c39f 100644 --- a/src/app/panels/singlestat/editor.html +++ b/src/app/panels/singlestat/editor.html @@ -23,15 +23,15 @@
Big value font size
- +
- +
- +
diff --git a/src/app/panels/singlestat/module.js b/src/app/panels/singlestat/module.js index 69d758f0ee3..3568cc53c64 100644 --- a/src/app/panels/singlestat/module.js +++ b/src/app/panels/singlestat/module.js @@ -5,7 +5,6 @@ define([ 'components/timeSeries', 'kbn', 'components/panelmeta', - 'services/panelSrv', './singleStatPanel', ], function (angular, app, _, TimeSeries, kbn, PanelMeta) { @@ -22,6 +21,8 @@ function (angular, app, _, TimeSeries, kbn, PanelMeta) { metricsEditor: true }); + $scope.fontSizes = ['20%', '30%','50%','70%','80%','100%', '110%', '120%', '150%', '170%', '200%']; + $scope.panelMeta.addEditorTab('Options', 'app/panels/singlestat/editor.html'); // Set and populate defaults diff --git a/src/app/partials/submenu.html b/src/app/partials/submenu.html index e82e2505afb..19a56e57a63 100644 --- a/src/app/partials/submenu.html +++ b/src/app/partials/submenu.html @@ -10,7 +10,7 @@
diff --git a/src/app/routes/all.js b/src/app/routes/all.js deleted file mode 100644 index 1b8588c1741..00000000000 --- a/src/app/routes/all.js +++ /dev/null @@ -1,7 +0,0 @@ -define([ - './pro/dashboard', - './pro/admin', - './pro/solo-panel', - './pro/login', -], -function () {}); diff --git a/src/app/routes/pro/admin.js b/src/app/routes/backend/admin.js similarity index 100% rename from src/app/routes/pro/admin.js rename to src/app/routes/backend/admin.js diff --git a/src/app/routes/backend/all.js b/src/app/routes/backend/all.js new file mode 100644 index 00000000000..41cf25aec49 --- /dev/null +++ b/src/app/routes/backend/all.js @@ -0,0 +1,6 @@ +define([ + './dashboard', + './admin', + './login', + './solo-panel', +], function() {}); diff --git a/src/app/routes/pro/dashboard.js b/src/app/routes/backend/dashboard.js similarity index 100% rename from src/app/routes/pro/dashboard.js rename to src/app/routes/backend/dashboard.js diff --git a/src/app/routes/pro/login.js b/src/app/routes/backend/login.js similarity index 100% rename from src/app/routes/pro/login.js rename to src/app/routes/backend/login.js diff --git a/src/app/routes/pro/solo-panel.js b/src/app/routes/backend/solo-panel.js similarity index 100% rename from src/app/routes/pro/solo-panel.js rename to src/app/routes/backend/solo-panel.js diff --git a/src/app/routes/dashboard-default.js b/src/app/routes/dashboard-default.js deleted file mode 100644 index 6721525b9e4..00000000000 --- a/src/app/routes/dashboard-default.js +++ /dev/null @@ -1,20 +0,0 @@ -define([ - 'angular', - 'config', - 'store' -], -function (angular, config, store) { - "use strict"; - - var module = angular.module('grafana.routes'); - - module.config(function($routeProvider) { - $routeProvider - .when('/', { - redirectTo: function() { - return store.get('grafanaDashboardDefault') || config.default_route; - } - }); - }); - -}); diff --git a/src/app/routes/standalone/all.js b/src/app/routes/standalone/all.js new file mode 100644 index 00000000000..6edd50369eb --- /dev/null +++ b/src/app/routes/standalone/all.js @@ -0,0 +1,23 @@ +define([ + 'angular', + 'config', + 'store', + './fromDB', + './fromFile', + './fromScript', +], +function (angular, config, store) { + 'use strict'; + + var module = angular.module('grafana.routes'); + + module.config(function($routeProvider) { + $routeProvider + .when('/', { + redirectTo: function() { + return store.get('grafanaDashboardDefault') || config.default_route; + } + }); + }); + +}); diff --git a/src/app/routes/dashboard-from-db.js b/src/app/routes/standalone/fromDB.js similarity index 100% rename from src/app/routes/dashboard-from-db.js rename to src/app/routes/standalone/fromDB.js diff --git a/src/app/routes/dashboard-from-file.js b/src/app/routes/standalone/fromFile.js similarity index 100% rename from src/app/routes/dashboard-from-file.js rename to src/app/routes/standalone/fromFile.js diff --git a/src/app/routes/dashboard-from-script.js b/src/app/routes/standalone/fromScript.js similarity index 100% rename from src/app/routes/dashboard-from-script.js rename to src/app/routes/standalone/fromScript.js diff --git a/src/app/services/all.js b/src/app/services/all.js index efb8c79fb15..91ae276691b 100644 --- a/src/app/services/all.js +++ b/src/app/services/all.js @@ -2,18 +2,10 @@ define([ './alertSrv', './utilSrv', './datasourceSrv', - './timeSrv', - './templateSrv', - './templateValuesSrv', - './panelSrv', './timer', './keyboardManager', - './annotationsSrv', './popoverSrv', - './playlistSrv', - './unsavedChangesSrv', - './dashboard/dashboardKeyBindings', - './dashboard/dashboardSrv', - './dashboard/dashboardViewStateSrv', + './backendSrv', + './grafanaDatasource', ], function () {}); diff --git a/src/app/services/pro/backendSrv.js b/src/app/services/backendSrv.js similarity index 100% rename from src/app/services/pro/backendSrv.js rename to src/app/services/backendSrv.js diff --git a/src/app/services/datasourceSrv.js b/src/app/services/datasourceSrv.js index dfe701780be..e77ca7077e8 100644 --- a/src/app/services/datasourceSrv.js +++ b/src/app/services/datasourceSrv.js @@ -2,11 +2,6 @@ define([ 'angular', 'lodash', 'config', - './graphite/graphiteDatasource', - './grafana/grafanaDatasource', - './influxdb/influxdbDatasource', - './opentsdb/opentsdbDatasource', - './elasticsearch/es-datasource', ], function (angular, _, config) { 'use strict'; @@ -68,6 +63,9 @@ function (angular, _, config) { case 'opentsdb': Datasource = $injector.get('OpenTSDBDatasource'); break; + case 'elasticsearch': + Datasource = $injector.get('ElasticDatasource'); + break; case 'grafana': Datasource = $injector.get('GrafanaDatasource'); break; diff --git a/src/app/services/grafana/grafanaDatasource.js b/src/app/services/grafanaDatasource.js similarity index 100% rename from src/app/services/grafana/grafanaDatasource.js rename to src/app/services/grafanaDatasource.js diff --git a/src/css/less/panel.less b/src/css/less/panel.less index 7d00e2d9cec..8ff4a50c01b 100644 --- a/src/css/less/panel.less +++ b/src/css/less/panel.less @@ -62,6 +62,7 @@ left: 0; padding: 0px 17px 6px 5px; top: 0; + z-index: 10; i { position: relative; top: -2px; diff --git a/src/plugins/datasource.example.js b/src/plugins/datasource.example.js index fcc160ec569..1861474e1a3 100644 --- a/src/plugins/datasource.example.js +++ b/src/plugins/datasource.example.js @@ -21,8 +21,8 @@ function (angular, _, kbn) { CustomDatasource.prototype.query = function(options) { // get from & to in seconds - var from = kbn.parseDate(options.range.from).getTime() / 1000; - var to = kbn.parseDate(options.range.to).getTime() / 1000; + var from = kbn.parseDate(options.range.from).getTime(); + var to = kbn.parseDate(options.range.to).getTime(); var series = []; var stepInSeconds = (to - from) / options.maxDataPoints; diff --git a/src/test/specs/dashboardSrv-specs.js b/src/test/specs/dashboardSrv-specs.js index 18eb13d3a18..739d66871bc 100644 --- a/src/test/specs/dashboardSrv-specs.js +++ b/src/test/specs/dashboardSrv-specs.js @@ -1,5 +1,5 @@ define([ - 'services/dashboard/dashboardSrv' + 'features/dashboard/dashboardSrv' ], function() { 'use strict'; @@ -95,7 +95,7 @@ define([ beforeEach(module('grafana.services')); beforeEach(inject(function(dashboardSrv) { model = dashboardSrv.create({ - services: { filter: { time: { from: 'now-1d', to: 'now'}, list: [1] }}, + services: { filter: { time: { from: 'now-1d', to: 'now'}, list: [{}] }}, pulldowns: [ { type: 'filtering', @@ -135,7 +135,7 @@ define([ it('should move time and filtering list', function() { expect(model.time.from).to.be('now-1d'); - expect(model.templating.list[0]).to.be(1); + expect(model.templating.list[0].allFormat).to.be('glob'); }); it('graphite panel should change name too graph', function() { diff --git a/src/test/specs/dashboardViewStateSrv-specs.js b/src/test/specs/dashboardViewStateSrv-specs.js index 1ade349610d..056ab8c9152 100644 --- a/src/test/specs/dashboardViewStateSrv-specs.js +++ b/src/test/specs/dashboardViewStateSrv-specs.js @@ -1,5 +1,5 @@ define([ - 'services/dashboard/dashboardViewStateSrv' + 'features/dashboard/viewStateSrv' ], function() { 'use strict'; diff --git a/src/test/specs/gfunc-specs.js b/src/test/specs/gfunc-specs.js index fdfb1051217..c5dc05552b5 100644 --- a/src/test/specs/gfunc-specs.js +++ b/src/test/specs/gfunc-specs.js @@ -1,5 +1,5 @@ define([ - 'services/graphite/gfunc' + 'features/graphite/gfunc' ], function(gfunc) { 'use strict'; diff --git a/src/test/specs/graph-ctrl-specs.js b/src/test/specs/graph-ctrl-specs.js index fded5b93ee2..a1a372006a3 100644 --- a/src/test/specs/graph-ctrl-specs.js +++ b/src/test/specs/graph-ctrl-specs.js @@ -1,5 +1,6 @@ define([ - './helpers', + 'helpers', + 'features/dashboard/panelSrv', 'panels/graph/module' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/graph-specs.js b/src/test/specs/graph-specs.js index 71c04084e91..98968adaa09 100644 --- a/src/test/specs/graph-specs.js +++ b/src/test/specs/graph-specs.js @@ -1,5 +1,5 @@ define([ - './helpers', + 'helpers', 'angular', 'jquery', 'components/timeSeries', diff --git a/src/test/specs/graphiteDatasource-specs.js b/src/test/specs/graphiteDatasource-specs.js index f112492aebc..e23f0e89d4c 100644 --- a/src/test/specs/graphiteDatasource-specs.js +++ b/src/test/specs/graphiteDatasource-specs.js @@ -1,6 +1,6 @@ define([ - './helpers', - 'services/graphite/graphiteDatasource' + 'helpers', + 'features/graphite/datasource' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/graphiteTargetCtrl-specs.js b/src/test/specs/graphiteTargetCtrl-specs.js index 3e321c9e4a4..d6c47783e91 100644 --- a/src/test/specs/graphiteTargetCtrl-specs.js +++ b/src/test/specs/graphiteTargetCtrl-specs.js @@ -1,16 +1,16 @@ define([ - './helpers', - 'services/graphite/gfunc', - 'controllers/graphiteTarget' + 'helpers', + 'features/graphite/gfunc', + 'features/graphite/queryCtrl' ], function(helpers, gfunc) { 'use strict'; - describe('GraphiteTargetCtrl', function() { + describe('GraphiteQueryCtrl', function() { var ctx = new helpers.ControllerTestContext(); beforeEach(module('grafana.controllers')); beforeEach(ctx.providePhase()); - beforeEach(ctx.createControllerPhase('GraphiteTargetCtrl')); + beforeEach(ctx.createControllerPhase('GraphiteQueryCtrl')); beforeEach(function() { ctx.scope.target = { diff --git a/src/test/specs/influxQueryBuilder-specs.js b/src/test/specs/influxQueryBuilder-specs.js index b4e052a23af..47e3a317c36 100644 --- a/src/test/specs/influxQueryBuilder-specs.js +++ b/src/test/specs/influxQueryBuilder-specs.js @@ -1,5 +1,5 @@ define([ - 'services/influxdb/influxQueryBuilder' + 'features/influxdb/queryBuilder' ], function(InfluxQueryBuilder) { 'use strict'; @@ -68,7 +68,7 @@ define([ var query = builder.build(); expect(query).to.be('select mean(value) from "merge.google.test" where $timeFilter ' + - 'group by time($interval) order asc'); + 'group by time($interval) order asc'); }); }); diff --git a/src/test/specs/influxSeries-specs.js b/src/test/specs/influxSeries-specs.js index ee632748966..1c3d079797b 100644 --- a/src/test/specs/influxSeries-specs.js +++ b/src/test/specs/influxSeries-specs.js @@ -1,5 +1,5 @@ define([ - 'services/influxdb/influxSeries' + 'features/influxdb/influxSeries' ], function(InfluxSeries) { 'use strict'; @@ -80,6 +80,27 @@ define([ }); + describe('given an alias format and many segments', function() { + var series = new InfluxSeries({ + seriesList: [ + { + columns: ['time', 'mean', 'sequence_number'], + name: 'a0.a1.a2.a3.a4.a5.a6.a7.a8.a9.a10.a11.a12', + points: [[1402596000, 10, 1], [1402596001, 12, 2]] + } + ], + alias: '$5.$11.mean' + }); + + var result = series.getTimeSeries(); + + it('should generate correct series name', function() { + expect(result[0].target).to.be('a5.a11.mean'); + }); + + }); + + describe('given an alias format with group by field', function() { var series = new InfluxSeries({ seriesList: [ diff --git a/src/test/specs/influxdb-datasource-specs.js b/src/test/specs/influxdb-datasource-specs.js index c0d25e1e81f..f8b545e7db2 100644 --- a/src/test/specs/influxdb-datasource-specs.js +++ b/src/test/specs/influxdb-datasource-specs.js @@ -1,6 +1,6 @@ define([ - './helpers', - 'services/influxdb/influxdbDatasource' + 'helpers', + 'features/influxdb/datasource' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/kbn-format-specs.js b/src/test/specs/kbn-format-specs.js index e92e6d0ceec..785d9376411 100644 --- a/src/test/specs/kbn-format-specs.js +++ b/src/test/specs/kbn-format-specs.js @@ -29,6 +29,13 @@ define([ describeValueFormat('ns', 25, 1, 0, '25 ns'); describeValueFormat('ns', 2558, 50, 0, '2.56 µs'); + describe('kbn.toFixed and negative decimals', function() { + it('should treat as zero decimals', function() { + var str = kbn.toFixed(186.123, -2); + expect(str).to.be('186'); + }); + }); + describe('calculateInterval', function() { it('1h 100 resultion', function() { var range = { from: kbn.parseDate('now-1h'), to: kbn.parseDate('now') }; diff --git a/src/test/specs/lexer-specs.js b/src/test/specs/lexer-specs.js index 65260d2e013..e1ab867476c 100644 --- a/src/test/specs/lexer-specs.js +++ b/src/test/specs/lexer-specs.js @@ -1,5 +1,5 @@ define([ - 'services/graphite/lexer' + 'features/graphite/lexer' ], function(Lexer) { 'use strict'; diff --git a/src/test/specs/parser-specs.js b/src/test/specs/parser-specs.js index f1b216f3f2f..8c24bcd3d19 100644 --- a/src/test/specs/parser-specs.js +++ b/src/test/specs/parser-specs.js @@ -1,5 +1,5 @@ define([ - 'services/graphite/parser' + 'features/graphite/parser' ], function(Parser) { 'use strict'; diff --git a/src/test/specs/row-ctrl-specs.js b/src/test/specs/row-ctrl-specs.js index 41543784f40..b64f5cd1065 100644 --- a/src/test/specs/row-ctrl-specs.js +++ b/src/test/specs/row-ctrl-specs.js @@ -1,6 +1,6 @@ define([ - './helpers', - 'controllers/row' + 'helpers', + 'features/dashboard/rowCtrl' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/seriesOverridesCtrl-specs.js b/src/test/specs/seriesOverridesCtrl-specs.js index 6a96c77416d..0542e613a34 100644 --- a/src/test/specs/seriesOverridesCtrl-specs.js +++ b/src/test/specs/seriesOverridesCtrl-specs.js @@ -1,5 +1,5 @@ define([ - './helpers', + 'helpers', 'panels/graph/seriesOverridesCtrl' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/sharePanelCtrl-specs.js b/src/test/specs/sharePanelCtrl-specs.js index 8c83f008ed5..6cb0a732d6e 100644 --- a/src/test/specs/sharePanelCtrl-specs.js +++ b/src/test/specs/sharePanelCtrl-specs.js @@ -1,6 +1,6 @@ define([ - './helpers', - 'controllers/sharePanelCtrl' + 'helpers', + 'features/dashboard/sharePanelCtrl' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/templateSrv-specs.js b/src/test/specs/templateSrv-specs.js index f740ef6d544..bb85b9a1c98 100644 --- a/src/test/specs/templateSrv-specs.js +++ b/src/test/specs/templateSrv-specs.js @@ -1,7 +1,7 @@ define([ 'mocks/dashboard-mock', 'lodash', - 'services/templateSrv' + 'features/templating/templateSrv' ], function(dashboardMock) { 'use strict'; diff --git a/src/test/specs/templateValuesSrv-specs.js b/src/test/specs/templateValuesSrv-specs.js index bc0de36e959..0fe00fd9e68 100644 --- a/src/test/specs/templateValuesSrv-specs.js +++ b/src/test/specs/templateValuesSrv-specs.js @@ -1,8 +1,8 @@ define([ 'mocks/dashboard-mock', - './helpers', + 'helpers', 'moment', - 'services/templateValuesSrv' + 'features/templating/templateValuesSrv' ], function(dashboardMock, helpers, moment) { 'use strict'; diff --git a/src/test/specs/timeSrv-specs.js b/src/test/specs/timeSrv-specs.js index 1d8a158e27e..231f50afeb8 100644 --- a/src/test/specs/timeSrv-specs.js +++ b/src/test/specs/timeSrv-specs.js @@ -1,8 +1,9 @@ define([ 'mocks/dashboard-mock', - './helpers', + 'helpers', 'lodash', - 'services/timeSrv' + 'services/timer', + 'features/dashboard/timeSrv' ], function(dashboardMock, helpers, _) { 'use strict'; diff --git a/src/test/test-main.js b/src/test/test-main.js index 21cbd5ff5fb..7ff8ea97e13 100644 --- a/src/test/test-main.js +++ b/src/test/test-main.js @@ -4,7 +4,8 @@ require.config({ paths: { specs: '../test/specs', mocks: '../test/mocks', - config: '../config.sample', + helpers: '../test/specs/helpers', + config: ['../config', '../config.sample'], kbn: 'components/kbn', store: 'components/store', @@ -96,9 +97,10 @@ require.config({ require([ 'angular', + 'config', 'angularMocks', 'app', -], function(angular) { +], function(angular, config) { 'use strict'; for (var file in window.__karma__.files) { @@ -111,11 +113,9 @@ require([ angular.module('grafana', ['ngRoute']); angular.module('grafana.services', ['ngRoute', '$strap.directives']); angular.module('grafana.panels', []); - angular.module('grafana.routes', ['ngRoute']); angular.module('grafana.filters', []); - require([ - 'specs/overview-ctrl-specs', + var specs = [ 'specs/lexer-specs', 'specs/parser-specs', 'specs/gfunc-specs', @@ -136,12 +136,16 @@ require([ 'specs/templateValuesSrv-specs', 'specs/kbn-format-specs', 'specs/dashboardSrv-specs', - 'specs/dashboardViewStateSrv-specs', - 'specs/overview-ctrl-specs', + 'specs/dashboardViewStateSrv-specs' 'specs/pro/soloPanelCtrl-specs', - ], function () { - window.__karma__.start(); + ]; + + var pluginSpecs = (config.plugins.specs || []).map(function (spec) { + return '../plugins/' + spec; }); + require(specs.concat(pluginSpecs), function () { + window.__karma__.start(); + }); }); diff --git a/tasks/build_task.js b/tasks/build_task.js index fa6144629df..0c85a52d716 100644 --- a/tasks/build_task.js +++ b/tasks/build_task.js @@ -4,6 +4,7 @@ module.exports = function(grunt) { grunt.registerTask('build', [ 'jshint:source', 'jshint:tests', + 'karma:test', 'clean:on_start', 'less:src', 'concat:cssDark', diff --git a/tasks/options/jscs.js b/tasks/options/jscs.js index 313893b440d..7a5dee05778 100644 --- a/tasks/options/jscs.js +++ b/tasks/options/jscs.js @@ -3,6 +3,7 @@ module.exports = function(config) { src: [ 'Gruntfile.js', '<%= srcDir %>/app/**/*.js', + '<%= srcDir %>/plugins/**/*.js', '!<%= srcDir %>/app/panels/*/{lib,leaflet}/*', '!<%= srcDir %>/app/dashboards/*' ], diff --git a/tasks/options/requirejs.js b/tasks/options/requirejs.js index cb6425abdc9..92dac5c5b41 100644 --- a/tasks/options/requirejs.js +++ b/tasks/options/requirejs.js @@ -63,7 +63,7 @@ module.exports = function(config,grunt) { 'directives/all', 'filters/all', 'controllers/all', - 'routes/all', + 'routes/standalone/default', 'components/partials', ] }