From 1caf3298ea2382c1391177cf1101c8f4d00ee73d Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Fri, 14 Jul 2023 11:58:43 +0100 Subject: [PATCH] Nested folders: Empty state for nested folder picker (#71464) * add empty state to nestedfolderpicker, add translations * run i18n:extract * rename i18n key --------- Co-authored-by: joshhunt --- .../NestedFolderPicker/NestedFolderList.tsx | 32 +++++++++++++------ .../NestedFolderPicker.test.tsx | 2 +- .../NestedFolderPicker/NestedFolderPicker.tsx | 22 ++++++++----- public/locales/de-DE/grafana.json | 7 ++++ public/locales/en-US/grafana.json | 7 ++++ public/locales/es-ES/grafana.json | 7 ++++ public/locales/fr-FR/grafana.json | 7 ++++ public/locales/pseudo-LOCALE/grafana.json | 7 ++++ public/locales/zh-Hans/grafana.json | 7 ++++ 9 files changed, 79 insertions(+), 19 deletions(-) diff --git a/public/app/core/components/NestedFolderPicker/NestedFolderList.tsx b/public/app/core/components/NestedFolderPicker/NestedFolderList.tsx index 8e83126abfc..9617668e356 100644 --- a/public/app/core/components/NestedFolderPicker/NestedFolderList.tsx +++ b/public/app/core/components/NestedFolderPicker/NestedFolderList.tsx @@ -6,6 +6,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { IconButton, useStyles2 } from '@grafana/ui'; import { getSvgSize } from '@grafana/ui/src/components/Icon/utils'; import { Text } from '@grafana/ui/src/components/Text/Text'; +import { Trans } from 'app/core/internationalization'; import { Indent } from 'app/features/browse-dashboards/components/Indent'; import { DashboardsTreeItem } from 'app/features/browse-dashboards/types'; import { DashboardViewItem } from 'app/features/search/types'; @@ -39,15 +40,21 @@ export function NestedFolderList({ return (
- - {Row} - + {items.length > 0 ? ( + + {Row} + + ) : ( +
+ No folders found +
+ )}
); } @@ -132,7 +139,6 @@ function Row({ index, style: virtualStyles, data }: RowProps) { )}