From fc2a06918021deca50a1d70a1ef5d3e563ee7c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 25 May 2016 12:45:52 +0200 Subject: [PATCH] feat(export): fixed refactoring issue with dynamic dashbord srv --- .../app/features/dashboard/dashboard_ctrl.ts | 7 +++---- .../dashboard/dynamic_dashboard_srv.ts | 2 ++ .../dashboard/export/export_modal.html | 20 ------------------- .../app/features/dashboard/submenu/submenu.ts | 2 -- 4 files changed, 5 insertions(+), 26 deletions(-) diff --git a/public/app/features/dashboard/dashboard_ctrl.ts b/public/app/features/dashboard/dashboard_ctrl.ts index 7bb50f58bf1..5618366cfbb 100644 --- a/public/app/features/dashboard/dashboard_ctrl.ts +++ b/public/app/features/dashboard/dashboard_ctrl.ts @@ -6,7 +6,6 @@ import moment from 'moment'; import _ from 'lodash'; import coreModule from 'app/core/core_module'; -import {DynamicDashboardSrv} from './dynamic_dashboard_srv'; export class DashboardCtrl { @@ -19,13 +18,13 @@ export class DashboardCtrl { templateValuesSrv, dashboardSrv, unsavedChangesSrv, + dynamicDashboardSrv, dashboardViewStateSrv, contextSrv, $timeout) { $scope.editor = { index: 0 }; $scope.panels = config.panels; - $scope.dynamicDashboardSrv = new DynamicDashboardSrv(); var resizeEventTimeout; @@ -43,7 +42,7 @@ export class DashboardCtrl { // template values service needs to initialize completely before // the rest of the dashboard can load templateValuesSrv.init(dashboard).finally(function() { - $scope.dynamicDashboardSrv.init(dashboard); + dynamicDashboardSrv.init(dashboard); unsavedChangesSrv.init(dashboard, $scope); @@ -64,7 +63,7 @@ export class DashboardCtrl { }; $scope.templateVariableUpdated = function() { - $scope.dynamicDashboardSrv.update($scope.dashboard); + dynamicDashboardSrv.update($scope.dashboard); }; $scope.updateSubmenuVisibility = function() { diff --git a/public/app/features/dashboard/dynamic_dashboard_srv.ts b/public/app/features/dashboard/dynamic_dashboard_srv.ts index 747c15479b2..6b58f448085 100644 --- a/public/app/features/dashboard/dynamic_dashboard_srv.ts +++ b/public/app/features/dashboard/dynamic_dashboard_srv.ts @@ -184,3 +184,5 @@ export class DynamicDashboardSrv { } } +coreModule.service('dynamicDashboardSrv', DynamicDashboardSrv); + diff --git a/public/app/features/dashboard/export/export_modal.html b/public/app/features/dashboard/export/export_modal.html index 2d7c1c1c3d5..7241a210bf5 100644 --- a/public/app/features/dashboard/export/export_modal.html +++ b/public/app/features/dashboard/export/export_modal.html @@ -23,28 +23,8 @@ -
- - - -
- - - - - - - - - - - - -