mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dashboards: update dashboard/folder url if browser url is not the same as from backend
This commit is contained in:
@@ -6,13 +6,17 @@ export class FolderDashboardsCtrl {
|
||||
uid: string;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, navModelSrv, private $routeParams) {
|
||||
constructor(private backendSrv, navModelSrv, private $routeParams, $location) {
|
||||
if (this.$routeParams.uid) {
|
||||
this.uid = $routeParams.uid;
|
||||
|
||||
const loader = new FolderPageLoader(this.backendSrv);
|
||||
|
||||
loader.load(this, this.uid, 'manage-folder-dashboards');
|
||||
loader.load(this, this.uid, 'manage-folder-dashboards').then(folder => {
|
||||
if ($location.path() !== folder.meta.url) {
|
||||
$location.path(folder.meta.url).replace();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user