From 34cffc6b92e929ea0d126252273f8d3ad53f35f2 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Thu, 14 Dec 2017 09:35:14 +0100 Subject: [PATCH] dashfolder: fix after backendSrv change also removes unused create folder modal --- .../features/dashboard/create_folder_ctrl.ts | 2 +- .../dashboard/folder_modal/folder.html | 24 ----------- .../features/dashboard/folder_modal/folder.ts | 42 ------------------- 3 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 public/app/features/dashboard/folder_modal/folder.html delete mode 100644 public/app/features/dashboard/folder_modal/folder.ts diff --git a/public/app/features/dashboard/create_folder_ctrl.ts b/public/app/features/dashboard/create_folder_ctrl.ts index 69d03e21b5e..8eebfecf1b5 100644 --- a/public/app/features/dashboard/create_folder_ctrl.ts +++ b/public/app/features/dashboard/create_folder_ctrl.ts @@ -20,7 +20,7 @@ export class CreateFolderCtrl { return this.backendSrv.createDashboardFolder(title).then(result => { appEvents.emit('alert-success', ['Folder Created', 'OK']); - var folderUrl = `/dashboards/folder/${result.id}/db/${result.slug}`; + var folderUrl = `/dashboards/folder/${result.dashboard.id}/${result.meta.slug}`; this.$location.url(folderUrl); }); } diff --git a/public/app/features/dashboard/folder_modal/folder.html b/public/app/features/dashboard/folder_modal/folder.html deleted file mode 100644 index e037923e77a..00000000000 --- a/public/app/features/dashboard/folder_modal/folder.html +++ /dev/null @@ -1,24 +0,0 @@ - diff --git a/public/app/features/dashboard/folder_modal/folder.ts b/public/app/features/dashboard/folder_modal/folder.ts deleted file mode 100644 index c788d54351f..00000000000 --- a/public/app/features/dashboard/folder_modal/folder.ts +++ /dev/null @@ -1,42 +0,0 @@ -import coreModule from 'app/core/core_module'; -import appEvents from 'app/core/app_events'; - -export class FolderCtrl { - title: string; - dismiss: any; - - /** @ngInject */ - constructor(private backendSrv, private $location) { - } - - create() { - if (!this.title || this.title.trim().length === 0) { - return; - } - - const title = this.title.trim(); - - return this.backendSrv.createDashboardFolder(title).then(result => { - appEvents.emit('alert-success', ['Folder Created', 'OK']); - this.dismiss(); - - var folderUrl = '/dashboard/db/' + result.slug; - this.$location.url(folderUrl); - }); - } -} - -export function folderModal() { - return { - restrict: 'E', - templateUrl: 'public/app/features/dashboard/folder_modal/folder.html', - controller: FolderCtrl, - bindToController: true, - controllerAs: 'ctrl', - scope: { - dismiss: "&" - } - }; -} - -coreModule.directive('folderModal', folderModal);