From 0c10923304dc72eda3f415cfc785889dbf19a62e Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:46:34 +0000 Subject: [PATCH] [v11.0.x] BrowseDashboards: Add subpath to URLs on Browse Dashboards page (#85354) BrowseDashboards: Add subpath to URLs on Browse Dashboards page (#84992) * BrowseDashboards: Add subpath to URLs on Browse Dashboards page * comment * use existing config * comment --------- Co-authored-by: joshhunt (cherry picked from commit b039995a4ea7c07721f36a0ae271abdccd919b15) Co-authored-by: butkovv <52626407+butkovv@users.noreply.github.com> --- public/app/features/browse-dashboards/api/services.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app/features/browse-dashboards/api/services.ts b/public/app/features/browse-dashboards/api/services.ts index f4318793358..3892593ac79 100644 --- a/public/app/features/browse-dashboards/api/services.ts +++ b/public/app/features/browse-dashboards/api/services.ts @@ -30,6 +30,7 @@ export async function listFolders( limit: pageSize, }); } + const subUrlPrefix = config.appSubUrl ?? ''; return folders.map((item) => ({ kind: 'folder', @@ -37,7 +38,9 @@ export async function listFolders( title: item.title, parentTitle, parentUID, - url: isSharedWithMe(item.uid) ? undefined : `/dashboards/f/${item.uid}/`, + + // URLs from the backend come with subUrlPrefix already included, so match that behaviour here + url: isSharedWithMe(item.uid) ? undefined : `${subUrlPrefix}/dashboards/f/${item.uid}/`, })); }