From 34b3dbdbf3fa46bd9f49d25d3df1e8f935fcc016 Mon Sep 17 00:00:00 2001 From: Laura Benz <48948963+L-M-K-B@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:24:48 +0200 Subject: [PATCH] RestoreDashboards: Adjust path (#89233) * refactor: change path * fix: page headline * refactor: remove condition --- pkg/api/api.go | 4 ++++ pkg/services/navtree/navtreeimpl/navtree.go | 4 ++-- public/app/core/utils/navBarItem-translations.ts | 8 ++++---- .../features/browse-dashboards/RecentlyDeletedPage.tsx | 2 +- public/app/routes/routes.tsx | 2 +- public/locales/en-US/grafana.json | 2 +- public/locales/pseudo-LOCALE/grafana.json | 2 +- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pkg/api/api.go b/pkg/api/api.go index 76ff1a24c70..c6c1ee022cd 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -165,6 +165,10 @@ func (hs *HTTPServer) registerRoutes() { ) } + if hs.Features.IsEnabledGlobally(featuremgmt.FlagDashboardRestore) { + r.Get("/dashboard/recently-deleted", reqSignedIn, hs.Index) + } + r.Get("/explore", authorize(ac.EvalPermission(ac.ActionDatasourcesExplore)), hs.Index) r.Get("/playlists/", reqSignedIn, hs.Index) diff --git a/pkg/services/navtree/navtreeimpl/navtree.go b/pkg/services/navtree/navtreeimpl/navtree.go index 7ed6f2164c0..a9247c16877 100644 --- a/pkg/services/navtree/navtreeimpl/navtree.go +++ b/pkg/services/navtree/navtreeimpl/navtree.go @@ -358,8 +358,8 @@ func (s *ServiceImpl) buildDashboardNavLinks(c *contextmodel.ReqContext) []*navt dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{ Text: "Recently Deleted", SubTitle: "Any items listed here for more than 30 days will be automatically deleted.", - Id: "dashboards/recentlyDeleted", - Url: s.cfg.AppSubURL + "/dashboard/recentlyDeleted", + Id: "dashboards/recently-deleted", + Url: s.cfg.AppSubURL + "/dashboard/recently-deleted", }) } } diff --git a/public/app/core/utils/navBarItem-translations.ts b/public/app/core/utils/navBarItem-translations.ts index 9297cb4816c..6dcaa0ebf74 100644 --- a/public/app/core/utils/navBarItem-translations.ts +++ b/public/app/core/utils/navBarItem-translations.ts @@ -40,8 +40,8 @@ export function getNavTitle(navId: string | undefined) { return t('nav.reporting.title', 'Reporting'); case 'dashboards/public': return t('nav.public.title', 'Public dashboards'); - case 'dashboards/recentlyDeleted': - return t('nav.recentlyDeleted.title', 'Recently Deleted'); + case 'dashboards/recently-deleted': + return t('nav.recently-deleted.title', 'Recently Deleted'); case 'dashboards/new': return t('nav.new-dashboard.title', 'New dashboard'); case 'dashboards/folder/new': @@ -208,9 +208,9 @@ export function getNavSubTitle(navId: string | undefined) { ); case 'dashboards/library-panels': return t('nav.library-panels.subtitle', 'Reusable panels that can be added to multiple dashboards'); - case 'dashboards/recentlyDeleted': + case 'dashboards/recently-deleted': return t( - 'nav.recentlyDeleted.subtitle', + 'nav.recently-deleted.subtitle', 'Any items listed here for more than 30 days will be automatically deleted.' ); case 'alerting': diff --git a/public/app/features/browse-dashboards/RecentlyDeletedPage.tsx b/public/app/features/browse-dashboards/RecentlyDeletedPage.tsx index 149ca72a03b..ee0579fbead 100644 --- a/public/app/features/browse-dashboards/RecentlyDeletedPage.tsx +++ b/public/app/features/browse-dashboards/RecentlyDeletedPage.tsx @@ -34,7 +34,7 @@ const RecentlyDeletedPage = memo(() => { }, [dispatch, stateManager]); return ( - + contextSrv.evaluatePermission([AccessControlAction.DashboardsDelete]), component: SafeDynamicImport( () => import(/* webpackChunkName: "RecentlyDeletedPage" */ 'app/features/browse-dashboards/RecentlyDeletedPage') diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index 36fb784122a..0f00b256579 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -1184,7 +1184,7 @@ "public": { "title": "Public dashboards" }, - "recentlyDeleted": { + "recently-deleted": { "subtitle": "Any items listed here for more than 30 days will be automatically deleted.", "title": "Recently Deleted" }, diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index bfe2a139e08..065ea9ab9b5 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -1184,7 +1184,7 @@ "public": { "title": "Pūþľįč đäşĥþőäřđş" }, - "recentlyDeleted": { + "recently-deleted": { "subtitle": "Åʼny įŧęmş ľįşŧęđ ĥęřę ƒőř mőřę ŧĥäʼn 30 đäyş ŵįľľ þę äūŧőmäŧįčäľľy đęľęŧęđ.", "title": "Ŗęčęʼnŧľy Đęľęŧęđ" },