From 78d7b6c0c9faf66253bc8df20207160f0b98f038 Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Thu, 20 Apr 2023 14:34:35 +0100 Subject: [PATCH] NestedFolders: Backend nested-dashboards route (#66955) * NestedFolders: Add backend route for temp browse dashboards page * tweak 'preview new ui' badge * tweak 'preview new ui' badge --- pkg/api/api.go | 6 ++++++ .../app/features/search/components/DashboardListPage.tsx | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/api/api.go b/pkg/api/api.go index 8a2a093fe8a..8f3c59cf7e5 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -152,6 +152,12 @@ func (hs *HTTPServer) registerRoutes() { r.Get("/dashboards/*", reqSignedIn, hs.Index) r.Get("/goto/:uid", reqSignedIn, hs.redirectFromShortURL, hs.Index) + // Temporary routes for the work-in-progress new Browse Dashboards views + if hs.Features.IsEnabled(featuremgmt.FlagNestedFolders) { + r.Get("/nested-dashboards/", reqSignedIn, hs.Index) + r.Get("/nested-dashboards/*", reqSignedIn, hs.Index) + } + if hs.Features.IsEnabled(featuremgmt.FlagPublicDashboards) { // list public dashboards r.Get("/public-dashboards/list", reqSignedIn, hs.Index) diff --git a/public/app/features/search/components/DashboardListPage.tsx b/public/app/features/search/components/DashboardListPage.tsx index 12bdd25350f..5f018a14708 100644 --- a/public/app/features/search/components/DashboardListPage.tsx +++ b/public/app/features/search/components/DashboardListPage.tsx @@ -4,7 +4,7 @@ import { useAsync } from 'react-use'; import { locationUtil, NavModelItem } from '@grafana/data'; import { config, locationService } from '@grafana/runtime'; -import { Badge, Link } from '@grafana/ui'; +import { Badge, Link, Tooltip } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { FolderDTO } from 'app/types'; @@ -47,7 +47,11 @@ export const DashboardListPage = memo(({ match, location }: Props) => { actions={ config.featureToggles.nestedFolders && ( - + + + + + ) }