diff --git a/public/app/core/components/Select/FolderPicker.tsx b/public/app/core/components/Select/FolderPicker.tsx index d86d873e2c7..71cfb8262ff 100644 --- a/public/app/core/components/Select/FolderPicker.tsx +++ b/public/app/core/components/Select/FolderPicker.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from 'react'; +import React, { useCallback } from 'react'; import { config } from '@grafana/runtime'; @@ -12,11 +12,17 @@ interface FolderPickerProps extends NestedFolderPickerProps { /** @deprecated */ initialTitle?: string; + /** @deprecated */ + inputId?: string; + /** @deprecated */ dashboardId?: number | string; /** @deprecated */ enableCreateNew?: boolean; + + /** @deprecated */ + skipInitialLoad?: boolean; } // Temporary wrapper component to switch between the NestedFolderPicker and the old flat @@ -37,9 +43,9 @@ function OldFolderPickerWrapper({ initialTitle, dashboardId, enableCreateNew, + inputId, + skipInitialLoad, }: FolderPickerProps) { - const [initialFolderUID] = useState(value); - const handleOnChange = useCallback( (newFolder: { title: string; uid: string }) => { if (onChange) { @@ -53,8 +59,10 @@ function OldFolderPickerWrapper({ diff --git a/public/app/features/dashboard/components/DashboardSettings/GeneralSettings.tsx b/public/app/features/dashboard/components/DashboardSettings/GeneralSettings.tsx index c6e19910918..778b2fd8ddf 100644 --- a/public/app/features/dashboard/components/DashboardSettings/GeneralSettings.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/GeneralSettings.tsx @@ -2,11 +2,9 @@ import React, { useState } from 'react'; import { connect, ConnectedProps } from 'react-redux'; import { TimeZone } from '@grafana/data'; -import { config } from '@grafana/runtime'; import { CollapsableSection, Field, Input, RadioButtonGroup, TagsInput } from '@grafana/ui'; -import { NestedFolderPicker } from 'app/core/components/NestedFolderPicker/NestedFolderPicker'; import { Page } from 'app/core/components/Page/Page'; -import { OldFolderPicker } from 'app/core/components/Select/OldFolderPicker'; +import { FolderPicker } from 'app/core/components/Select/FolderPicker'; import { updateTimeZoneDashboard, updateWeekStartDashboard } from 'app/features/dashboard/state/actions'; import { DeleteDashboardButton } from '../DeleteDashboard/DeleteDashboardButton'; @@ -30,14 +28,7 @@ export function GeneralSettingsUnconnected({ }: Props): JSX.Element { const [renderCounter, setRenderCounter] = useState(0); - const onFolderChange = (newFolder: { uid: string; title: string }) => { - dashboard.meta.folderUid = newFolder.uid; - dashboard.meta.folderTitle = newFolder.title; - dashboard.meta.hasUnsavedFolderChange = true; - setRenderCounter(renderCounter + 1); - }; - - const onNestedFolderChange = (newUID: string, newTitle: string) => { + const onFolderChange = (newUID: string, newTitle: string) => { dashboard.meta.folderUid = newUID; dashboard.meta.folderTitle = newTitle; dashboard.meta.hasUnsavedFolderChange = true; @@ -115,19 +106,16 @@ export function GeneralSettingsUnconnected({ - {config.featureToggles.nestedFolderPicker ? ( - - ) : ( - - )} +