From 978101b7a54f690ff3a596f134bf3dc5aa3a596b Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Wed, 29 Jan 2025 09:24:41 +0000 Subject: [PATCH] ImportDashboards: Use NestedFolderPicker (#99696) --- .../manage-dashboards/components/ImportDashboardForm.tsx | 8 +++----- .../components/ImportDashboardOverview.tsx | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/public/app/features/manage-dashboards/components/ImportDashboardForm.tsx b/public/app/features/manage-dashboards/components/ImportDashboardForm.tsx index 35a241dad27..b4f8d041b82 100644 --- a/public/app/features/manage-dashboards/components/ImportDashboardForm.tsx +++ b/public/app/features/manage-dashboards/components/ImportDashboardForm.tsx @@ -4,7 +4,7 @@ import { Controller, FieldErrors, UseFormReturn } from 'react-hook-form'; import { selectors } from '@grafana/e2e-selectors'; import { ExpressionDatasourceRef } from '@grafana/runtime/src/utils/DataSourceWithBackend'; import { Button, Field, FormFieldErrors, FormsOnSubmit, Stack, Input, Legend } from '@grafana/ui'; -import { OldFolderPicker } from 'app/core/components/Select/OldFolderPicker'; +import { FolderPicker } from 'app/core/components/Select/FolderPicker'; import { DataSourcePicker } from 'app/features/datasources/components/picker/DataSourcePicker'; import { @@ -21,7 +21,6 @@ import { ImportDashboardLibraryPanelsList } from './ImportDashboardLibraryPanels interface Props extends Pick, 'register' | 'control' | 'getValues' | 'watch'> { uidReset: boolean; inputs: DashboardInputs; - initialFolderUid: string; errors: FieldErrors; onCancel: () => void; onUidReset: () => void; @@ -35,7 +34,6 @@ export const ImportDashboardForm = ({ getValues, uidReset, inputs, - initialFolderUid, onUidReset, onCancel, onSubmit, @@ -72,8 +70,8 @@ export const ImportDashboardForm = ({ ( - + render={({ field: { ref, value, onChange, ...field } }) => ( + onChange({ uid, title })} value={value.uid} /> )} name="folder" control={control} diff --git a/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx b/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx index 96caec35f96..f00e1c4ce55 100644 --- a/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx +++ b/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx @@ -112,7 +112,6 @@ class ImportDashboardOverviewUnConnected extends PureComponent { onUidReset={this.onUidReset} onSubmit={this.onSubmit} watch={watch} - initialFolderUid={folder.uid} /> )}