From d8a43225e3f2c9dcbc2f234f8fff39f457bd84f6 Mon Sep 17 00:00:00 2001 From: Stephanie Hingtgen Date: Wed, 6 Aug 2025 14:31:00 -0600 Subject: [PATCH] Folders: Fix frontend permission check (#109290) --- .../features/browse-dashboards/api/services.ts | 4 ---- .../components/BrowseActions/BrowseActions.tsx | 17 ++++------------- .../features/browse-dashboards/permissions.ts | 5 ----- public/locales/en-US/grafana.json | 1 - 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/public/app/features/browse-dashboards/api/services.ts b/public/app/features/browse-dashboards/api/services.ts index 6362b3fb10d..3d37d5dafd1 100644 --- a/public/app/features/browse-dashboards/api/services.ts +++ b/public/app/features/browse-dashboards/api/services.ts @@ -17,10 +17,6 @@ export async function listFolders( page = 1, pageSize = PAGE_SIZE ): Promise { - if (parentUID) { - return []; - } - const backendSrv = getBackendSrv(); // TODO: what to do here for unified search? diff --git a/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx b/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx index 3e6e6b7af19..ca3952427e6 100644 --- a/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx +++ b/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx @@ -1,8 +1,8 @@ -import { useMemo, useState } from 'react'; +import { useState } from 'react'; import { Trans, t } from '@grafana/i18n'; import { config, reportInteraction } from '@grafana/runtime'; -import { Button, Drawer, Stack, Tooltip } from '@grafana/ui'; +import { Button, Drawer, Stack } from '@grafana/ui'; import appEvents from 'app/core/app_events'; import { ManagerKind } from 'app/features/apiserver/types'; import { useSearchStateManager } from 'app/features/search/state/SearchStateManager'; @@ -42,9 +42,6 @@ export function BrowseActions({ folderDTO }: Props) { folderDTO?.managedBy === ManagerKind.Repo ); - // Folders can only be moved if nested folders is enabled - const moveIsInvalid = useMemo(() => Object.values(selectedItems.folder).some((v) => v), [selectedItems]); - const isSearching = stateManager.hasSearchFilters(); const onActionComplete = () => { @@ -125,7 +122,7 @@ export function BrowseActions({ folderDTO }: Props) { }; const moveButton = ( - ); @@ -133,13 +130,7 @@ export function BrowseActions({ folderDTO }: Props) { return ( <> - {moveIsInvalid ? ( - - {moveButton} - - ) : ( - moveButton - )} + {moveButton}