dashfolders: Do not allow loading a folder as a dashboard

This commit is contained in:
Marcus Efraimsson
2017-12-08 17:50:37 +01:00
parent 70b0165835
commit 47014ddb65

View File

@@ -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");
});