diff --git a/packages/grafana-data/src/types/pluginExtensions.ts b/packages/grafana-data/src/types/pluginExtensions.ts index dcc312a9c9c..1bb6eedce20 100644 --- a/packages/grafana-data/src/types/pluginExtensions.ts +++ b/packages/grafana-data/src/types/pluginExtensions.ts @@ -1,5 +1,6 @@ import { DataQuery } from '@grafana/schema'; +import { ScopedVars } from './ScopedVars'; import { RawTimeRange, TimeZone } from './time'; // Plugin Extensions types @@ -76,6 +77,7 @@ export type PluginExtensionPanelContext = { timeZone: TimeZone; dashboard: Dashboard; targets: DataQuery[]; + scopedVars?: ScopedVars; }; type Dashboard = { diff --git a/public/app/features/dashboard/utils/getPanelMenu.test.ts b/public/app/features/dashboard/utils/getPanelMenu.test.ts index 391f4bf82c1..ab80ab55047 100644 --- a/public/app/features/dashboard/utils/getPanelMenu.test.ts +++ b/public/app/features/dashboard/utils/getPanelMenu.test.ts @@ -201,6 +201,12 @@ describe('getPanelMenu()', () => { }, }, ], + scopedVars: { + a: { + text: 'a', + value: 'a', + }, + }, }); const dashboard = createDashboardModelFixture({ @@ -238,6 +244,12 @@ describe('getPanelMenu()', () => { uid: '123', title: 'My dashboard', }, + scopedVars: { + a: { + text: 'a', + value: 'a', + }, + }, }; expect(getPluginExtensions).toBeCalledWith(expect.objectContaining({ context })); diff --git a/public/app/features/dashboard/utils/getPanelMenu.ts b/public/app/features/dashboard/utils/getPanelMenu.ts index 84ca6f1ae10..3a13722b51a 100644 --- a/public/app/features/dashboard/utils/getPanelMenu.ts +++ b/public/app/features/dashboard/utils/getPanelMenu.ts @@ -341,5 +341,6 @@ function createExtensionContext(panel: PanelModel, dashboard: DashboardModel): P tags: Array.from(dashboard.tags), }, targets: panel.targets, + scopedVars: panel.scopedVars, }; }