From 5fbfd67b945536f3d34577034254da9a7f805115 Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Tue, 13 Mar 2018 21:06:25 +0100 Subject: [PATCH 1/2] dashboards: should be possible to browse dashboard using only uid That is, the slug part of url should be optional. Closes #11231 --- pkg/api/api.go | 1 + public/app/routes/routes.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/pkg/api/api.go b/pkg/api/api.go index 84f0eae79c7..5b3cde09fd5 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -66,6 +66,7 @@ func (hs *HttpServer) registerRoutes() { r.Get("/plugins/:id/page/:page", reqSignedIn, Index) r.Get("/d/:uid/:slug", reqSignedIn, Index) + r.Get("/d/:uid", reqSignedIn, Index) r.Get("/dashboard/db/:slug", reqSignedIn, redirectFromLegacyDashboardUrl, Index) r.Get("/dashboard/script/*", reqSignedIn, Index) r.Get("/dashboard-solo/snapshot/*", Index) diff --git a/public/app/routes/routes.ts b/public/app/routes/routes.ts index cab45b5aff3..e968bee9be4 100644 --- a/public/app/routes/routes.ts +++ b/public/app/routes/routes.ts @@ -22,6 +22,12 @@ export function setupAngularRoutes($routeProvider, $locationProvider) { reloadOnSearch: false, pageClass: 'page-dashboard', }) + .when('/d/:uid', { + templateUrl: 'public/app/partials/dashboard.html', + controller: 'LoadDashboardCtrl', + reloadOnSearch: false, + pageClass: 'page-dashboard', + }) .when('/dashboard/:type/:slug', { templateUrl: 'public/app/partials/dashboard.html', controller: 'LoadDashboardCtrl', From 91fa076fb335b26c17d2352bb951384dc97f31c4 Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Tue, 13 Mar 2018 21:32:37 +0100 Subject: [PATCH 2/2] folders: should be possible to browse folder using only uid That is, the slug part of url should be optional. --- public/app/routes/routes.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/app/routes/routes.ts b/public/app/routes/routes.ts index e968bee9be4..487e9b27b22 100644 --- a/public/app/routes/routes.ts +++ b/public/app/routes/routes.ts @@ -104,6 +104,11 @@ export function setupAngularRoutes($routeProvider, $locationProvider) { controller: 'FolderDashboardsCtrl', controllerAs: 'ctrl', }) + .when('/dashboards/f/:uid', { + templateUrl: 'public/app/features/dashboard/partials/folder_dashboards.html', + controller: 'FolderDashboardsCtrl', + controllerAs: 'ctrl', + }) .when('/org', { templateUrl: 'public/app/features/org/partials/orgDetails.html', controller: 'OrgDetailsCtrl',