From bb66f14c1d089b12d32e1afc7bccc7fc2e937e5e Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Tue, 25 Apr 2023 16:22:36 +0100 Subject: [PATCH] NestedFolders: Rename 'General' to 'Dashboards' in FolderPicker (#67113) --- public/app/core/components/Select/FolderPicker.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app/core/components/Select/FolderPicker.tsx b/public/app/core/components/Select/FolderPicker.tsx index e3d9bca1557..96b9f0be4de 100644 --- a/public/app/core/components/Select/FolderPicker.tsx +++ b/public/app/core/components/Select/FolderPicker.tsx @@ -5,6 +5,7 @@ import { useAsync } from 'react-use'; import { AppEvents, SelectableValue, GrafanaTheme2 } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; +import { config } from '@grafana/runtime'; import { useStyles2, ActionMeta, Input, InputActionMeta, AsyncVirtualizedSelect } from '@grafana/ui'; import appEvents from 'app/core/app_events'; import { t } from 'app/core/internationalization'; @@ -70,7 +71,7 @@ export function FolderPicker(props: Props) { initialFolderUid, initialTitle = '', permissionLevel = PermissionLevelString.Edit, - rootName = 'General', + rootName: rootNameProp, showRoot = true, skipInitialLoad, searchQueryType, @@ -78,6 +79,8 @@ export function FolderPicker(props: Props) { folderWarning, } = props; + const rootName = rootNameProp ?? config.featureToggles.nestedFolders ? 'Dashboards' : 'General'; + const [folder, setFolder] = useState(null); const [isCreatingNew, setIsCreatingNew] = useState(false); const [inputValue, setInputValue] = useState('');