diff --git a/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx b/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx index 75388f929cb..ba1831ab153 100644 --- a/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx +++ b/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx @@ -65,8 +65,12 @@ export function BrowseActions({ folderDTO }: Props) { }; const onDelete = async () => { - const selectedDashboards = Object.keys(selectedItemsForActions.dashboard).filter((uid) => selectedItemsForActions.dashboard[uid]); - const selectedFolders = Object.keys(selectedItemsForActions.folder).filter((uid) => selectedItemsForActions.folder[uid]); + const selectedDashboards = Object.keys(selectedItemsForActions.dashboard).filter( + (uid) => selectedItemsForActions.dashboard[uid] + ); + const selectedFolders = Object.keys(selectedItemsForActions.folder).filter( + (uid) => selectedItemsForActions.folder[uid] + ); await deleteDashboards({ dashboardUIDs: selectedDashboards }); await deleteFolders({ folderUIDs: selectedFolders }); trackAction('delete', selectedItemsForActions); @@ -74,8 +78,12 @@ export function BrowseActions({ folderDTO }: Props) { }; const onMove = async (destinationUID: string) => { - const selectedDashboards = Object.keys(selectedItemsForActions.dashboard).filter((uid) => selectedItemsForActions.dashboard[uid]); - const selectedFolders = Object.keys(selectedItemsForActions.folder).filter((uid) => selectedItemsForActions.folder[uid]); + const selectedDashboards = Object.keys(selectedItemsForActions.dashboard).filter( + (uid) => selectedItemsForActions.dashboard[uid] + ); + const selectedFolders = Object.keys(selectedItemsForActions.folder).filter( + (uid) => selectedItemsForActions.folder[uid] + ); await moveFolders({ folderUIDs: selectedFolders, destinationUID }); await moveDashboards({ dashboardUIDs: selectedDashboards, destinationUID }); diff --git a/public/app/features/browse-dashboards/components/FolderActionsButton.tsx b/public/app/features/browse-dashboards/components/FolderActionsButton.tsx index 3c0615d14e3..a45d8b227bf 100644 --- a/public/app/features/browse-dashboards/components/FolderActionsButton.tsx +++ b/public/app/features/browse-dashboards/components/FolderActionsButton.tsx @@ -133,13 +133,13 @@ export function FolderActionsButton({ folder, repoType, isReadOnlyRepo }: Props) try { // Collect all dashboards under this folder and its children const dashboardUIDs = await collectAllDashboardsUnderFolder(folder.uid); - + // Create selected items object with all dashboards const selectedDashboards: Record = {}; dashboardUIDs.forEach((uid) => { selectedDashboards[uid] = true; }); - + setExportSelectedDashboards(selectedDashboards); setShowExportFolderDrawer(true); } catch (error) { @@ -183,9 +183,7 @@ export function FolderActionsButton({ folder, repoType, isReadOnlyRepo }: Props) label={deleteLabel} /> )} - {provisioningEnabled && isUnmanagedFolder && ( - - )} + {provisioningEnabled && isUnmanagedFolder && } ); diff --git a/public/app/features/browse-dashboards/state/actions.ts b/public/app/features/browse-dashboards/state/actions.ts index fd86390a1eb..8eba28ea05e 100644 --- a/public/app/features/browse-dashboards/state/actions.ts +++ b/public/app/features/browse-dashboards/state/actions.ts @@ -91,10 +91,7 @@ export const refetchChildren = createAsyncThunk( export const selectFolderWithAllDashboards = createAsyncThunk( 'browseDashboards/selectFolderWithAllDashboards', - async ( - { folderUID, isSelected }: { folderUID: string; isSelected: boolean }, - { dispatch, getState } - ) => { + async ({ folderUID, isSelected }: { folderUID: string; isSelected: boolean }, { dispatch, getState }) => { const state = getState().browseDashboards; // Find the folder item to get its parentUID and managedBy @@ -102,15 +99,17 @@ export const selectFolderWithAllDashboards = createAsyncThunk( if (!isSelected) { // When deselecting, use the normal action - it will handle deselecting all children recursively - dispatch(setItemSelectionState({ - item: { - kind: 'folder', - uid: folderUID, - parentUID: folderItem?.parentUID, - managedBy: folderItem?.managedBy - }, - isSelected: false - })); + dispatch( + setItemSelectionState({ + item: { + kind: 'folder', + uid: folderUID, + parentUID: folderItem?.parentUID, + managedBy: folderItem?.managedBy, + }, + isSelected: false, + }) + ); return; } @@ -119,15 +118,17 @@ export const selectFolderWithAllDashboards = createAsyncThunk( const dashboardUIDs = await collectAllDashboardsUnderFolder(folderUID); // First, select the folder itself - dispatch(setItemSelectionState({ - item: { - kind: 'folder', - uid: folderUID, - parentUID: folderItem?.parentUID, - managedBy: folderItem?.managedBy - }, - isSelected: true - })); + dispatch( + setItemSelectionState({ + item: { + kind: 'folder', + uid: folderUID, + parentUID: folderItem?.parentUID, + managedBy: folderItem?.managedBy, + }, + isSelected: true, + }) + ); // Then select all dashboards found // We need to get the parentUID for each dashboard from the state @@ -136,15 +137,17 @@ export const selectFolderWithAllDashboards = createAsyncThunk( const dashboardItem = findItem(state.rootItems?.items ?? [], state.childrenByParentUID, dashboardUID); // Even if dashboard isn't in state, we can still select it by UID // The reducer will handle setting selectedItems.dashboard[dashboardUID] = true - dispatch(setItemSelectionState({ - item: { - kind: 'dashboard', - uid: dashboardUID, - parentUID: dashboardItem?.parentUID ?? folderUID, // Fallback to folderUID if not found - managedBy: dashboardItem?.managedBy - }, - isSelected: true - })); + dispatch( + setItemSelectionState({ + item: { + kind: 'dashboard', + uid: dashboardUID, + parentUID: dashboardItem?.parentUID ?? folderUID, // Fallback to folderUID if not found + managedBy: dashboardItem?.managedBy, + }, + isSelected: true, + }) + ); } } ); diff --git a/public/app/features/dashboard-scene/sharing/ExportButton/ExportToRepository.tsx b/public/app/features/dashboard-scene/sharing/ExportButton/ExportToRepository.tsx index 5ae95d93ff0..07dce2d30fc 100644 --- a/public/app/features/dashboard-scene/sharing/ExportButton/ExportToRepository.tsx +++ b/public/app/features/dashboard-scene/sharing/ExportButton/ExportToRepository.tsx @@ -29,4 +29,3 @@ function ExportToRepositoryRenderer({ model }: SceneComponentProps ); } - diff --git a/public/app/features/provisioning/Shared/RepositoryList.tsx b/public/app/features/provisioning/Shared/RepositoryList.tsx index 5734091414f..190e1f55f57 100644 --- a/public/app/features/provisioning/Shared/RepositoryList.tsx +++ b/public/app/features/provisioning/Shared/RepositoryList.tsx @@ -57,10 +57,7 @@ export function RepositoryList({ items }: Props) { } onRemove={unmanagedCount > 0 ? handlePushUnmanaged : undefined} > - + {{ managedCount }}/{{ resourceCount }} resources managed by Git sync. {unmanagedCount > 0 && ( diff --git a/public/app/features/provisioning/components/BulkActions/BulkExportProvisionedResource.tsx b/public/app/features/provisioning/components/BulkActions/BulkExportProvisionedResource.tsx index 73d0c23420f..72e6b8ebdcf 100644 --- a/public/app/features/provisioning/components/BulkActions/BulkExportProvisionedResource.tsx +++ b/public/app/features/provisioning/components/BulkActions/BulkExportProvisionedResource.tsx @@ -60,17 +60,15 @@ function FormContent({ initialValues, selectedItems, workflowOptions, onDismiss }, [repositories, selectedRepositoryName, isLoadingRepos]); // Get selected repository - const repositoryView: RepositoryView | undefined = repositories.find( - (repo) => repo.name === selectedRepositoryName - ); + const repositoryView: RepositoryView | undefined = repositories.find((repo) => repo.name === selectedRepositoryName); // Compute workflow options based on selected repository const selectedWorkflowOptions = repositoryView ? getWorkflowOptions(repositoryView) : workflowOptions; const selectedDefaultWorkflow = repositoryView ? getDefaultWorkflow(repositoryView) - : (workflowOptions[0]?.value === 'branch' || workflowOptions[0]?.value === 'write' - ? workflowOptions[0].value - : undefined); + : workflowOptions[0]?.value === 'branch' || workflowOptions[0]?.value === 'write' + ? workflowOptions[0].value + : undefined; // Update workflow, branch, and path when repository changes useEffect(() => { @@ -216,13 +214,14 @@ function FormContent({ initialValues, selectedItems, workflowOptions, onDismiss {/* Show form-level errors */} - {errors.root && ( - - )} + {errors.root && } {/* Info if folders are selected */} {Object.keys(selectedItems.folder || {}).filter((uid) => selectedItems.folder[uid]).length > 0 && ( - + {t( 'browse-dashboards.bulk-export-resources-form.folders-info-description', 'Folders will be left behind. New folders will be created in the repository based on the resource folder structure.' @@ -297,7 +296,10 @@ function FormContent({ initialValues, selectedItems, workflowOptions, onDismiss )} @@ -318,10 +320,7 @@ function FormContent({ initialValues, selectedItems, workflowOptions, onDismiss -