From 3fd04edd8180d4adc0e65f1b0684ee2e71ccacc6 Mon Sep 17 00:00:00 2001 From: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com> Date: Fri, 26 May 2023 08:01:54 -0600 Subject: [PATCH] Dashboards: Remove Explore option from panel menu when panel's datasource uid is "-- Dashboard --" (#69017) * Remove Explore option from panel menu when panel's datasource uid is "-- Dashboard --" * Use the constant SHARED_DASHBOARD_QUERY --- public/app/features/dashboard/utils/getPanelMenu.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/utils/getPanelMenu.ts b/public/app/features/dashboard/utils/getPanelMenu.ts index fb710df94d1..3ed2a9c23a9 100644 --- a/public/app/features/dashboard/utils/getPanelMenu.ts +++ b/public/app/features/dashboard/utils/getPanelMenu.ts @@ -25,6 +25,7 @@ import { } from 'app/features/dashboard/utils/panel'; import { InspectTab } from 'app/features/inspector/types'; import { isPanelModelLibraryPanel } from 'app/features/library-panels/guard'; +import { SHARED_DASHBOARD_QUERY } from 'app/plugins/datasource/dashboard'; import { store } from 'app/store/store'; import { navigateToExplore } from '../../explore/state/main'; @@ -141,7 +142,11 @@ export function getPanelMenu( shortcut: 'p s', }); - if (contextSrv.hasAccessToExplore() && !(panel.plugin && panel.plugin.meta.skipDataQuery)) { + if ( + contextSrv.hasAccessToExplore() && + !(panel.plugin && panel.plugin.meta.skipDataQuery) && + panel.datasource?.uid !== SHARED_DASHBOARD_QUERY + ) { menu.push({ text: t('panel.header-menu.explore', `Explore`), iconClassName: 'compass',