mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dashfolders: Do not allow loading a folder as a dashboard
This commit is contained in:
@@ -43,6 +43,13 @@ function (angular, moment, _, $, kbn, dateMath, impressionSrv) {
|
||||
});
|
||||
} else {
|
||||
promise = backendSrv.getDashboard($routeParams.type, $routeParams.slug)
|
||||
.then(result => {
|
||||
if (result.meta.isFolder) {
|
||||
$rootScope.appEvent("alert-error", ['Dashboard not found']);
|
||||
throw new Error("Dashboard not found");
|
||||
}
|
||||
return result;
|
||||
})
|
||||
.catch(function() {
|
||||
return self._dashboardLoadFailed("Not found");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user