NestedFolders: Rename 'General' to 'Dashboards' in FolderPicker (#67113)

This commit is contained in:
Josh Hunt 2023-04-25 16:22:36 +01:00 committed by GitHub
parent 93348c2a17
commit bb66f14c1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<SelectedFolder | null>(null);
const [isCreatingNew, setIsCreatingNew] = useState(false);
const [inputValue, setInputValue] = useState('');