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 <josh@trtr.co>
This commit is contained in:
butkovv 2024-03-28 16:15:05 +03:00 committed by GitHub
parent 29c76b98d4
commit b039995a4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}/`,
}));
}