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('');