Browse Source

refactor: moved stuff into new features dir manage-dashboards

Torkel Ödegaard 7 years ago
parent
commit
6c90a53654

+ 1 - 1
public/app/features/all.ts

@@ -3,9 +3,9 @@ import './templating/all';
 import './plugins/all';
 import './dashboard/all';
 import './playlist/all';
-import './snapshot/all';
 import './panel/all';
 import './org/all';
 import './admin';
 import './alerting/NotificationsEditCtrl';
 import './alerting/NotificationsListCtrl';
+import './manage-dashboards';

+ 0 - 2
public/app/features/dashboard/all.ts

@@ -31,13 +31,11 @@ import './panellinks/module';
 import './dashlinks/module';
 
 import coreModule from 'app/core/core_module';
-import { DashboardListCtrl } from './dashboard_list_ctrl';
 import { FolderDashboardsCtrl } from './folder_dashboards_ctrl';
 import { FolderSettingsCtrl } from './folder_settings_ctrl';
 import { DashboardImportCtrl } from './dashboard_import_ctrl';
 import { CreateFolderCtrl } from './create_folder_ctrl';
 
-coreModule.controller('DashboardListCtrl', DashboardListCtrl);
 coreModule.controller('FolderDashboardsCtrl', FolderDashboardsCtrl);
 coreModule.controller('FolderSettingsCtrl', FolderSettingsCtrl);
 coreModule.controller('DashboardImportCtrl', DashboardImportCtrl);

+ 0 - 0
public/app/features/dashboard/dashboard_list_ctrl.ts → public/app/features/manage-dashboards/DashboardListCtrl.ts


+ 1 - 4
public/app/features/snapshot/snapshot_ctrl.ts → public/app/features/manage-dashboards/SnapshotListCtrl.ts

@@ -1,7 +1,6 @@
-import angular from 'angular';
 import _ from 'lodash';
 
-export class SnapshotsCtrl {
+export class SnapshotListCtrl {
   navModel: any;
   snapshots: any;
 
@@ -35,5 +34,3 @@ export class SnapshotsCtrl {
     });
   }
 }
-
-angular.module('grafana.controllers').controller('SnapshotsCtrl', SnapshotsCtrl);

+ 7 - 0
public/app/features/manage-dashboards/index.ts

@@ -0,0 +1,7 @@
+import coreModule from 'app/core/core_module';
+
+import { DashboardListCtrl } from './DashboardListCtrl';
+import { SnapshotListCtrl } from './SnapshotListCtrl';
+
+coreModule.controller('DashboardListCtrl', DashboardListCtrl);
+coreModule.controller('SnapshotListCtrl', SnapshotListCtrl);

+ 0 - 0
public/app/features/dashboard/partials/dashboard_list.html → public/app/features/manage-dashboards/partials/dashboard_list.html


+ 0 - 0
public/app/features/snapshot/partials/snapshots.html → public/app/features/manage-dashboards/partials/snapshot_list.html


+ 0 - 1
public/app/features/snapshot/all.ts

@@ -1 +0,0 @@
-import './snapshot_ctrl';

+ 3 - 3
public/app/routes/routes.ts

@@ -81,7 +81,7 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
       controllerAs: 'ctrl',
     })
     .when('/dashboards', {
-      templateUrl: 'public/app/features/dashboard/partials/dashboard_list.html',
+      templateUrl: 'public/app/features/manage-dashboards/partials/dashboard_list.html',
       controller: 'DashboardListCtrl',
       controllerAs: 'ctrl',
     })
@@ -240,8 +240,8 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
       pageClass: 'sidemenu-hidden',
     })
     .when('/dashboard/snapshots', {
-      templateUrl: 'public/app/features/snapshot/partials/snapshots.html',
-      controller: 'SnapshotsCtrl',
+      templateUrl: 'public/app/features/manage-dashboards/partials/snapshot_list.html',
+      controller: 'SnapshotListCtrl',
       controllerAs: 'ctrl',
     })
     .when('/plugins', {