From d4bba872a10f0b2e121bb6a1b17305299fbb097c Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Mon, 17 Jun 2024 10:19:57 +0100 Subject: [PATCH] LibraryPanels: Use new folder picker when creating a library panel (#89228) LibraryPanels: Use new folder picker when creating a Library Panel --- .../AddLibraryPanelModal/AddLibraryPanelModal.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx b/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx index d9dfdc14d9a..1b393b3b8f0 100644 --- a/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx +++ b/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx @@ -4,7 +4,7 @@ import { useAsync, useDebounce } from 'react-use'; import { FetchError, isFetchError } from '@grafana/runtime'; import { LibraryPanel } from '@grafana/schema/dist/esm/index.gen'; import { Button, Field, Input, Modal } from '@grafana/ui'; -import { OldFolderPicker } from 'app/core/components/Select/OldFolderPicker'; +import { FolderPicker } from 'app/core/components/Select/FolderPicker'; import { t, Trans } from 'app/core/internationalization'; import { PanelModel } from '../../../dashboard/state'; @@ -36,6 +36,7 @@ export const AddLibraryPanelContents = ({ const onCreate = useCallback(() => { panel.libraryPanel = { uid: '', name: panelName }; + saveLibraryPanel(panel, folderUid!).then((res: LibraryPanel | FetchError) => { if (!isFetchError(res)) { onDismiss?.(); @@ -84,9 +85,9 @@ export const AddLibraryPanelContents = ({ 'Library panel permissions are derived from the folder permissions' )} > - setFolderUid(uid)} - initialFolderUid={initialFolderUid} + setFolderUid(uid)} + value={folderUid} inputId="share-panel-library-panel-folder-picker" />