From 74557a4c400e1c6bd117d4792fc375affd423779 Mon Sep 17 00:00:00 2001
From: Amarnath Karthi <97amarnathk@gmail.com>
Date: Mon, 14 Oct 2019 21:51:44 +0530
Subject: [PATCH] Dashboard: Allows the d-solo route to be used without slug
(#19640)
Allows the d-solo route to be used with UID and without
a slug.
Fixes #11617
---
pkg/api/api.go | 1 +
public/app/routes/routes.ts | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git a/pkg/api/api.go b/pkg/api/api.go
index f82f973a721..9fe67937bd4 100644
--- a/pkg/api/api.go
+++ b/pkg/api/api.go
@@ -71,6 +71,7 @@ func (hs *HTTPServer) registerRoutes() {
r.Get("/dashboard/script/*", reqSignedIn, hs.Index)
r.Get("/dashboard-solo/snapshot/*", hs.Index)
r.Get("/d-solo/:uid/:slug", reqSignedIn, hs.Index)
+ r.Get("/d-solo/:uid", reqSignedIn, hs.Index)
r.Get("/dashboard-solo/db/:slug", reqSignedIn, redirectFromLegacyDashboardSoloURL, hs.Index)
r.Get("/dashboard-solo/script/*", reqSignedIn, hs.Index)
r.Get("/import/dashboard", reqSignedIn, hs.Index)
diff --git a/public/app/routes/routes.ts b/public/app/routes/routes.ts
index 9c651cc2b02..a5c82315741 100644
--- a/public/app/routes/routes.ts
+++ b/public/app/routes/routes.ts
@@ -82,6 +82,18 @@ export function setupAngularRoutes($routeProvider: route.IRouteProvider, $locati
),
},
})
+ .when('/d-solo/:uid', {
+ template: '',
+ pageClass: 'dashboard-solo',
+ routeInfo: DashboardRouteInfo.Normal,
+ reloadOnSearch: false,
+ resolve: {
+ component: () =>
+ SafeDynamicImport(
+ import(/* webpackChunkName: "SoloPanelPage" */ '../features/dashboard/containers/SoloPanelPage')
+ ),
+ },
+ })
.when('/dashboard-solo/:type/:slug', {
template: '',
pageClass: 'dashboard-solo',