From 0a4ccdcef28866709a150cc0ee0e7bb409ea4d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 30 Dec 2014 20:49:04 +0100 Subject: [PATCH] moved all graphite code into features/graphite --- src/app/controllers/all.js | 1 - src/app/directives/addGraphiteFunc.js | 2 +- src/app/features/all.js | 1 + .../graphite/datasource.js} | 7 ++++--- src/app/{services => features}/graphite/gfunc.js | 0 src/app/{services => features}/graphite/lexer.js | 0 src/app/{services => features}/graphite/parser.js | 0 .../graphite/partials/annotations.editor.html} | 0 .../graphite/partials/query.editor.html} | 2 +- .../graphiteTarget.js => features/graphite/queryCtrl.js} | 6 +++--- src/app/services/datasourceSrv.js | 1 - src/test/specs/gfunc-specs.js | 2 +- src/test/specs/graphiteDatasource-specs.js | 2 +- src/test/specs/graphiteTargetCtrl-specs.js | 8 ++++---- src/test/specs/lexer-specs.js | 2 +- src/test/specs/parser-specs.js | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) rename src/app/{services/graphite/graphiteDatasource.js => features/graphite/datasource.js} (97%) rename src/app/{services => features}/graphite/gfunc.js (100%) rename src/app/{services => features}/graphite/lexer.js (100%) rename src/app/{services => features}/graphite/parser.js (100%) rename src/app/{partials/graphite/annotation_editor.html => features/graphite/partials/annotations.editor.html} (100%) rename src/app/{partials/graphite/editor.html => features/graphite/partials/query.editor.html} (99%) rename src/app/{controllers/graphiteTarget.js => features/graphite/queryCtrl.js} (98%) diff --git a/src/app/controllers/all.js b/src/app/controllers/all.js index 75b05efb3d1..0765b82d1aa 100644 --- a/src/app/controllers/all.js +++ b/src/app/controllers/all.js @@ -7,7 +7,6 @@ define([ './pulldown', './search', './metricKeys', - './graphiteTarget', './graphiteImport', './influxTargetCtrl', './playlistCtrl', diff --git a/src/app/directives/addGraphiteFunc.js b/src/app/directives/addGraphiteFunc.js index b585e7d003f..cf2d5069962 100644 --- a/src/app/directives/addGraphiteFunc.js +++ b/src/app/directives/addGraphiteFunc.js @@ -3,7 +3,7 @@ define([ 'app', 'lodash', 'jquery', - '../services/graphite/gfunc', + '../features/graphite/gfunc', ], function (angular, app, _, $, gfunc) { 'use strict'; diff --git a/src/app/features/all.js b/src/app/features/all.js index 5e11ae038f6..64ae3fdf794 100644 --- a/src/app/features/all.js +++ b/src/app/features/all.js @@ -1,3 +1,4 @@ define([ './panellinkeditor/module', + './graphite/datasource', ], function () {}); 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..1041703d0fc 100644 --- a/src/app/services/graphite/graphiteDatasource.js +++ b/src/app/features/graphite/datasource.js @@ -4,7 +4,8 @@ define([ 'jquery', 'config', 'kbn', - 'moment' + 'moment', + './queryCtrl', ], function (angular, _, $, config, kbn, moment) { 'use strict'; @@ -17,12 +18,12 @@ function (angular, _, $, config, kbn, moment) { this.type = 'graphite'; this.basicAuth = datasource.basicAuth; this.url = datasource.url; - this.editorSrc = 'app/partials/graphite/editor.html'; + this.editorSrc = 'app/features/graphite/partials/query.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.annotationEditorSrc = 'app/features/graphite/partials/annotation.editor.html'; this.cacheTimeout = datasource.cacheTimeout; this.withCredentials = datasource.withCredentials; } 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/datasourceSrv.js b/src/app/services/datasourceSrv.js index effb3d1a7dc..1a924afb485 100644 --- a/src/app/services/datasourceSrv.js +++ b/src/app/services/datasourceSrv.js @@ -2,7 +2,6 @@ define([ 'angular', 'lodash', 'config', - './graphite/graphiteDatasource', './influxdb/influxdbDatasource', './opentsdb/opentsdbDatasource', './elasticsearch/es-datasource', 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/graphiteDatasource-specs.js b/src/test/specs/graphiteDatasource-specs.js index 2d0ff4be118..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' + 'features/graphite/datasource' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/graphiteTargetCtrl-specs.js b/src/test/specs/graphiteTargetCtrl-specs.js index c62cea5e37e..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' + '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/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';