Fix linting issues

This commit is contained in:
Roberto Jimenez Sanchez
2025-12-03 08:35:30 +01:00
parent 5dacd2edff
commit 7b3a2d8fb6
6 changed files with 10 additions and 16 deletions
+1 -4
View File
@@ -101,10 +101,7 @@ func validateExportJobOptions(opts *provisioning.ExportJobOptions) field.ErrorLi
}
// Validate resources if specified
// Only validate Resources when it has items (not nil and not empty).
// When Resources is nil or empty, the old API path (using Folder) is used, so we skip validation.
// Empty and nil slices are treated the same for validation purposes.
if opts.Resources != nil && len(opts.Resources) > 0 {
if len(opts.Resources) > 0 {
for i, r := range opts.Resources {
resourcePath := field.NewPath("spec", "push", "resources").Index(i)
@@ -228,7 +228,7 @@ export function BrowseActions({ folderDTO }: Props) {
title={
// Heading levels should only increase by one (a11y)
<Text variant="h3" element="h2">
{t('browse-dashboards.action.bulk-export-provisioned-resources', 'Bulk Export Resources')}
{t('browse-dashboards.action.export-provisioned-resources', 'Export Resources')}
</Text>
}
onClose={() => setShowBulkExportProvisionedResource(false)}
@@ -13,7 +13,7 @@ import { DashboardViewItem } from 'app/features/search/types';
import { useDispatch, useSelector } from 'app/types/store';
import { PAGE_SIZE } from '../api/services';
import { fetchNextChildrenPage } from '../state/actions';
import { fetchNextChildrenPage, selectFolderWithAllDashboards } from '../state/actions';
import {
useFlatTreeState,
useCheckboxSelectionState,
@@ -22,7 +22,6 @@ import {
useLoadNextChildrenPage,
rootItemsSelector,
} from '../state/hooks';
import { selectFolderWithAllDashboards } from '../state/actions';
import { setFolderOpenState, setItemSelectionState, setAllSelection } from '../state/slice';
import { BrowseDashboardsState, DashboardTreeSelection, SelectionState, BrowseDashboardsPermissions } from '../types';
@@ -160,10 +160,7 @@ export function FolderActionsButton({ folder, repoType, isReadOnlyRepo }: Props)
const deleteLabel = t('browse-dashboards.folder-actions-button.delete', 'Delete this folder');
const exportLabel = t('browse-dashboards.folder-actions-button.export', 'Export to Repository');
const provisioningEnabled = config.featureToggles.provisioning;
// isProvisionedFolder means the folder IS managed/provisioned
// So !isProvisionedFolder means the folder is unmanaged (not provisioned)
const isUnmanagedFolder = !isProvisionedFolder;
const canExportToRepository = config.featureToggles.provisioning && !isProvisionedFolder;
const menu = (
<Menu>
@@ -183,7 +180,7 @@ export function FolderActionsButton({ folder, repoType, isReadOnlyRepo }: Props)
label={deleteLabel}
/>
)}
{provisioningEnabled && isUnmanagedFolder && <MenuItem onClick={handleExportFolder} label={exportLabel} />}
{canExportToRepository && <MenuItem onClick={handleExportFolder} label={exportLabel} />}
</Menu>
);
@@ -192,7 +189,7 @@ export function FolderActionsButton({ folder, repoType, isReadOnlyRepo }: Props)
(canViewPermissions && !isProvisionedFolder) ||
(canMoveFolder && !isReadOnlyRepo) ||
(canDeleteFolders && !isReadOnlyRepo) ||
(provisioningEnabled && isUnmanagedFolder);
canExportToRepository;
if (!hasAnyActions) {
return null;
@@ -1,6 +1,7 @@
import { SceneComponentProps } from '@grafana/scenes';
import { t } from '@grafana/i18n';
import { SceneComponentProps } from '@grafana/scenes';
import { BulkExportProvisionedResource } from 'app/features/provisioning/components/BulkActions/BulkExportProvisionedResource';
import { DashboardScene } from '../../scene/DashboardScene';
import { ShareExportTab } from '../ShareExportTab';
+2 -2
View File
@@ -3551,7 +3551,6 @@
"browse-dashboards": {
"action": {
"bulk-delete-provisioned-resources": "Bulk Delete Provisioned Resources",
"bulk-export-provisioned-resources": "Bulk Export Resources",
"bulk-move-provisioned-resources": "Bulk Move Provisioned Resources",
"cancel-button": "Cancel",
"confirmation-text": "Delete",
@@ -3565,6 +3564,7 @@
"delete-provisioned-folder": "Delete provisioned folder",
"deleting": "Deleting...",
"export-folder": "Export Folder to Repository",
"export-provisioned-resources": "Export Resources",
"export-to-repository-button": "Export to Repository",
"manage-permissions-button": "Manage permissions",
"move-button": "Move",
@@ -14711,4 +14711,4 @@
"label-points": "Points"
}
}
}
}