From 6c90a5365407787ba40623faff524d5902f76e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 10 Sep 2018 13:59:31 +0200 Subject: [PATCH] refactor: moved stuff into new features dir manage-dashboards --- public/app/features/all.ts | 2 +- public/app/features/dashboard/all.ts | 2 -- .../DashboardListCtrl.ts} | 0 .../SnapshotListCtrl.ts} | 5 +---- public/app/features/manage-dashboards/index.ts | 7 +++++++ .../partials/dashboard_list.html | 0 .../partials/snapshot_list.html} | 0 public/app/features/snapshot/all.ts | 1 - public/app/routes/routes.ts | 6 +++--- 9 files changed, 12 insertions(+), 11 deletions(-) rename public/app/features/{dashboard/dashboard_list_ctrl.ts => manage-dashboards/DashboardListCtrl.ts} (100%) rename public/app/features/{snapshot/snapshot_ctrl.ts => manage-dashboards/SnapshotListCtrl.ts} (86%) create mode 100644 public/app/features/manage-dashboards/index.ts rename public/app/features/{dashboard => manage-dashboards}/partials/dashboard_list.html (100%) rename public/app/features/{snapshot/partials/snapshots.html => manage-dashboards/partials/snapshot_list.html} (100%) delete mode 100644 public/app/features/snapshot/all.ts diff --git a/public/app/features/all.ts b/public/app/features/all.ts index 963f79e97ef..7f6f84b7676 100644 --- a/public/app/features/all.ts +++ b/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'; diff --git a/public/app/features/dashboard/all.ts b/public/app/features/dashboard/all.ts index 794d4f18041..1e28a3c9a80 100644 --- a/public/app/features/dashboard/all.ts +++ b/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); diff --git a/public/app/features/dashboard/dashboard_list_ctrl.ts b/public/app/features/manage-dashboards/DashboardListCtrl.ts similarity index 100% rename from public/app/features/dashboard/dashboard_list_ctrl.ts rename to public/app/features/manage-dashboards/DashboardListCtrl.ts diff --git a/public/app/features/snapshot/snapshot_ctrl.ts b/public/app/features/manage-dashboards/SnapshotListCtrl.ts similarity index 86% rename from public/app/features/snapshot/snapshot_ctrl.ts rename to public/app/features/manage-dashboards/SnapshotListCtrl.ts index 1dde4876cd5..2ff53e7aed5 100644 --- a/public/app/features/snapshot/snapshot_ctrl.ts +++ b/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); diff --git a/public/app/features/manage-dashboards/index.ts b/public/app/features/manage-dashboards/index.ts new file mode 100644 index 00000000000..046740904e1 --- /dev/null +++ b/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); diff --git a/public/app/features/dashboard/partials/dashboard_list.html b/public/app/features/manage-dashboards/partials/dashboard_list.html similarity index 100% rename from public/app/features/dashboard/partials/dashboard_list.html rename to public/app/features/manage-dashboards/partials/dashboard_list.html diff --git a/public/app/features/snapshot/partials/snapshots.html b/public/app/features/manage-dashboards/partials/snapshot_list.html similarity index 100% rename from public/app/features/snapshot/partials/snapshots.html rename to public/app/features/manage-dashboards/partials/snapshot_list.html diff --git a/public/app/features/snapshot/all.ts b/public/app/features/snapshot/all.ts deleted file mode 100644 index 521c7a4c111..00000000000 --- a/public/app/features/snapshot/all.ts +++ /dev/null @@ -1 +0,0 @@ -import './snapshot_ctrl'; diff --git a/public/app/routes/routes.ts b/public/app/routes/routes.ts index bc590cfa553..a0b070cbcb4 100644 --- a/public/app/routes/routes.ts +++ b/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', {