[v10.0.x] Dashboards: Remove Explore option from panel menu when panel's datasource uid is "-- Dashboard --" (#69173)

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

(cherry picked from commit 3fd04edd81)

Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2023-06-13 07:59:23 -06:00
committed by GitHub
co-authored by Haris Rozajac
parent 8a10a07a5b
commit ba6fe9d9a9
@@ -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',