Skip to content

Commit

Permalink
[v10.0.x] Dashboards: Remove Explore option from panel menu when pane…
Browse files Browse the repository at this point in the history
…l'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 3fd04ed)

Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
  • Loading branch information
grafanabot and harisrozajac committed Jun 13, 2023
1 parent 8a10a07 commit ba6fe9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/app/features/dashboard/utils/getPanelMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit ba6fe9d

Please sign in to comment.