LibraryPanels: Replace 'General' folder with 'Dashboards' (#89220)

Show 'Dashboards' for library panels not in a folder
This commit is contained in:
Josh Hunt 2024-06-14 14:01:18 +01:00 committed by GitHub
parent 23d9af7175
commit 90c3d74955
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -4553,6 +4553,9 @@ exports[`better eslint`] = {
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "3"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "4"]
],
"public/app/features/library-panels/components/LibraryPanelCard/LibraryPanelCard.tsx:5381": [
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"]
],
"public/app/features/library-panels/components/LibraryPanelInfo/LibraryPanelInfo.tsx:5381": [
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],

View File

@ -80,11 +80,12 @@ function FolderLink({ libraryPanel }: FolderLinkProps): ReactElement | null {
return null;
}
// LibraryPanels API returns folder-less library panels with an empty string folder UID
if (!libraryPanel.meta.folderUid) {
return (
<span className={styles.metaContainer}>
<Icon name={'folder'} size="sm" />
<span>{libraryPanel.meta.folderName}</span>
<span>Dashboards</span>
</span>
);
}