diff --git a/public/app/features/folders/components/NewDashboardsFolder.tsx b/public/app/features/folders/components/NewDashboardsFolder.tsx index 6bcc584ab3b..cff5929ecd5 100644 --- a/public/app/features/folders/components/NewDashboardsFolder.tsx +++ b/public/app/features/folders/components/NewDashboardsFolder.tsx @@ -35,8 +35,11 @@ const pageNav: NavModelItem = { function NewDashboardsFolder({ createNewFolder }: Props) { const [queryParams] = useQueryParams(); const onSubmit = (formData: FormModel) => { - createNewFolder(formData.folderName, String(queryParams['folderUid'])); + const folderUid = typeof queryParams['folderUid'] === 'string' ? queryParams['folderUid'] : undefined; + + createNewFolder(formData.folderName, folderUid); }; + const validateFolderName = (folderName: string) => { return validationSrv .validateNewFolderName(folderName) diff --git a/public/app/features/search/components/DashboardActions.tsx b/public/app/features/search/components/DashboardActions.tsx index ffea5252147..d0ed979e528 100644 --- a/public/app/features/search/components/DashboardActions.tsx +++ b/public/app/features/search/components/DashboardActions.tsx @@ -18,7 +18,7 @@ export const DashboardActions: FC = ({ folderUid, canCreateFolders = fals url = `dashboards/folder/new/`; } - if ((isTypeNewFolder && config.featureToggles.nestedFolders) || folderUid) { + if (folderUid) { url += `?folderUid=${folderUid}`; }