From 39f3cfc1ebc19f8c869ef43878c099a3c2edf578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 31 Dec 2014 11:05:19 +0100 Subject: [PATCH] moved dashboard stuff into a feature folder, not sure about this, but need better structure and better way to organize dependencies --- src/app/controllers/all.js | 6 ------ src/app/features/all.js | 1 + src/app/features/dashboard/all.js | 14 ++++++++++++++ .../dashboard}/dashboardCtrl.js | 0 .../dashboard}/dashboardNavCtrl.js | 0 .../dashboard/dashboardSrv.js | 1 - .../dashboard/keybindings.js} | 0 .../{services => features/dashboard}/panelSrv.js | 0 .../dashboard}/playlistCtrl.js | 0 .../dashboard}/playlistSrv.js | 0 .../row.js => features/dashboard/rowCtrl.js} | 0 .../dashboard}/sharePanelCtrl.js | 0 .../dashboard}/submenuCtrl.js | 0 .../{services => features/dashboard}/timeSrv.js | 0 .../dashboard}/unsavedChangesSrv.js | 0 .../dashboard/viewStateSrv.js} | 0 src/app/panels/graph/module.js | 1 - src/app/panels/singlestat/module.js | 1 - src/app/services/all.js | 7 ------- src/test/specs/dashboardSrv-specs.js | 2 +- src/test/specs/dashboardViewStateSrv-specs.js | 2 +- src/test/specs/graph-ctrl-specs.js | 1 + src/test/specs/row-ctrl-specs.js | 2 +- src/test/specs/sharePanelCtrl-specs.js | 2 +- src/test/specs/timeSrv-specs.js | 3 ++- src/test/test-main.js | 1 - 26 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 src/app/features/dashboard/all.js rename src/app/{controllers => features/dashboard}/dashboardCtrl.js (100%) rename src/app/{controllers => features/dashboard}/dashboardNavCtrl.js (100%) rename src/app/{services => features}/dashboard/dashboardSrv.js (99%) rename src/app/{services/dashboard/dashboardKeyBindings.js => features/dashboard/keybindings.js} (100%) rename src/app/{services => features/dashboard}/panelSrv.js (100%) rename src/app/{controllers => features/dashboard}/playlistCtrl.js (100%) rename src/app/{services => features/dashboard}/playlistSrv.js (100%) rename src/app/{controllers/row.js => features/dashboard/rowCtrl.js} (100%) rename src/app/{controllers => features/dashboard}/sharePanelCtrl.js (100%) rename src/app/{controllers => features/dashboard}/submenuCtrl.js (100%) rename src/app/{services => features/dashboard}/timeSrv.js (100%) rename src/app/{services => features/dashboard}/unsavedChangesSrv.js (100%) rename src/app/{services/dashboard/dashboardViewStateSrv.js => features/dashboard/viewStateSrv.js} (100%) diff --git a/src/app/controllers/all.js b/src/app/controllers/all.js index 6e052ee445e..8703cf0f2bf 100644 --- a/src/app/controllers/all.js +++ b/src/app/controllers/all.js @@ -1,15 +1,9 @@ define([ './grafanaCtrl', - './dashboardCtrl', - './dashboardNavCtrl', - './row', - './submenuCtrl', './pulldown', './search', './metricKeys', './graphiteImport', - './playlistCtrl', './inspectCtrl', - './sharePanelCtrl', './jsonEditorCtrl', ], function () {}); diff --git a/src/app/features/all.js b/src/app/features/all.js index 6860e3de932..55f7f607131 100644 --- a/src/app/features/all.js +++ b/src/app/features/all.js @@ -6,4 +6,5 @@ define([ './influxdb/datasource', './opentsdb/datasource', './elasticsearch/datasource', + './dashboard/all', ], function () {}); 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 100% rename from src/app/controllers/dashboardNavCtrl.js rename to src/app/features/dashboard/dashboardNavCtrl.js 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/panels/graph/module.js b/src/app/panels/graph/module.js index 2f82dafcd3d..a1ae2bf2b4f 100644 --- a/src/app/panels/graph/module.js +++ b/src/app/panels/graph/module.js @@ -7,7 +7,6 @@ define([ 'moment', 'components/timeSeries', 'components/panelmeta', - 'services/panelSrv', './seriesOverridesCtrl', './graph', './legend', diff --git a/src/app/panels/singlestat/module.js b/src/app/panels/singlestat/module.js index 788db3c6229..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) { diff --git a/src/app/services/all.js b/src/app/services/all.js index daf889d1cd3..bd9150a3b8f 100644 --- a/src/app/services/all.js +++ b/src/app/services/all.js @@ -2,15 +2,8 @@ define([ './alertSrv', './utilSrv', './datasourceSrv', - './timeSrv', - './panelSrv', './timer', './keyboardManager', './popoverSrv', - './playlistSrv', - './unsavedChangesSrv', - './dashboard/dashboardKeyBindings', - './dashboard/dashboardSrv', - './dashboard/dashboardViewStateSrv', ], function () {}); diff --git a/src/test/specs/dashboardSrv-specs.js b/src/test/specs/dashboardSrv-specs.js index 6dc19b1a2ce..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'; 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/graph-ctrl-specs.js b/src/test/specs/graph-ctrl-specs.js index 13cd56857f5..a1a372006a3 100644 --- a/src/test/specs/graph-ctrl-specs.js +++ b/src/test/specs/graph-ctrl-specs.js @@ -1,5 +1,6 @@ define([ 'helpers', + 'features/dashboard/panelSrv', 'panels/graph/module' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/row-ctrl-specs.js b/src/test/specs/row-ctrl-specs.js index bfb61c1ab9b..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' + 'features/dashboard/rowCtrl' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/sharePanelCtrl-specs.js b/src/test/specs/sharePanelCtrl-specs.js index 7bab63adc3a..6cb0a732d6e 100644 --- a/src/test/specs/sharePanelCtrl-specs.js +++ b/src/test/specs/sharePanelCtrl-specs.js @@ -1,6 +1,6 @@ define([ 'helpers', - 'controllers/sharePanelCtrl' + 'features/dashboard/sharePanelCtrl' ], function(helpers) { 'use strict'; diff --git a/src/test/specs/timeSrv-specs.js b/src/test/specs/timeSrv-specs.js index 86ee37ebac4..231f50afeb8 100644 --- a/src/test/specs/timeSrv-specs.js +++ b/src/test/specs/timeSrv-specs.js @@ -2,7 +2,8 @@ define([ 'mocks/dashboard-mock', '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 5783b885d59..0caba61ae03 100644 --- a/src/test/test-main.js +++ b/src/test/test-main.js @@ -109,7 +109,6 @@ require([ } } - angular.module('grafana', ['ngRoute']); angular.module('grafana.services', ['ngRoute', '$strap.directives']); angular.module('grafana.panels', []);