Commit 1c0d022a by Marcus Andersson Committed by GitHub

Dashboard: fixes issue with UI not being re-rendered after moving dashboard

parent 4e3ff196
......@@ -2,6 +2,8 @@ import coreModule from 'app/core/core_module';
import appEvents from 'app/core/app_events';
import { backendSrv } from 'app/core/services/backend_srv';
import { AppEvents } from '@grafana/data';
import { IScope } from 'angular';
import { promiseToDigest } from 'app/core/utils/promiseToDigest';
export class MoveToFolderCtrl {
dashboards: any;
......@@ -10,12 +12,15 @@ export class MoveToFolderCtrl {
afterSave: any;
isValidFolderSelection = true;
constructor(private $scope: IScope) {}
onFolderChange(folder: any) {
this.folder = folder;
}
save() {
return backendSrv.moveDashboards(this.dashboards, this.folder).then((result: any) => {
return promiseToDigest(this.$scope)(
backendSrv.moveDashboards(this.dashboards, this.folder).then((result: any) => {
if (result.successCount > 0) {
const header = `Dashboard${result.successCount === 1 ? '' : 's'} Moved`;
const msg = `${result.successCount} dashboard${result.successCount === 1 ? '' : 's'} moved to ${
......@@ -30,7 +35,8 @@ export class MoveToFolderCtrl {
this.dismiss();
return this.afterSave();
});
})
);
}
onEnterFolderCreation() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment