diff --git a/public/app/features/dashboard/state/PanelModel.ts b/public/app/features/dashboard/state/PanelModel.ts index 0ed6b8a02a4..f97ef1d80a7 100644 --- a/public/app/features/dashboard/state/PanelModel.ts +++ b/public/app/features/dashboard/state/PanelModel.ts @@ -15,6 +15,7 @@ import { EventBusSrv, FieldConfigSource, PanelPlugin, + PanelPluginDataSupport, ScopedVars, urlUtil, } from '@grafana/data'; @@ -61,6 +62,7 @@ const notPersistedProperties: { [str: string]: boolean } = { editSourceId: true, configRev: true, getDisplayTitle: true, + dataSupport: true, }; // For angular panels we need to clean up properties when changing type @@ -171,6 +173,7 @@ export class PanelModel implements DataConfigSource { declare cachedPluginOptions: Record; legend?: { show: boolean; sort?: string; sortDesc?: boolean }; plugin?: PanelPlugin; + dataSupport?: PanelPluginDataSupport; private queryRunner?: PanelQueryRunner; @@ -354,6 +357,7 @@ export class PanelModel implements DataConfigSource { } } + this.dataSupport = plugin.dataSupport; this.applyPluginOptionDefaults(plugin, false); this.resendLastResult(); } diff --git a/public/app/features/query/state/PanelQueryRunner.ts b/public/app/features/query/state/PanelQueryRunner.ts index 7cda9e5bf68..f8be647269d 100644 --- a/public/app/features/query/state/PanelQueryRunner.ts +++ b/public/app/features/query/state/PanelQueryRunner.ts @@ -72,6 +72,7 @@ export class PanelQueryRunner { constructor(dataConfigSource: DataConfigSource) { this.subject = new ReplaySubject(1); this.dataConfigSource = dataConfigSource; + this.dataSupport = this.dataConfigSource.dataSupport; } /** diff --git a/public/app/plugins/panel/graph/module.ts b/public/app/plugins/panel/graph/module.ts index fd585a4da23..d7b3328c3b6 100644 --- a/public/app/plugins/panel/graph/module.ts +++ b/public/app/plugins/panel/graph/module.ts @@ -373,6 +373,7 @@ export const plugin = new PanelPlugin(null) FieldConfigProperty.Mappings, ], }) + .setDataSupport({ annotations: true, alertStates: true }) .setMigrationHandler(graphPanelMigrationHandler); // Use the angular ctrt rather than a react one diff --git a/public/app/plugins/panel/timeseries/module.tsx b/public/app/plugins/panel/timeseries/module.tsx index 7ab311cbd9e..3e81bfc78bf 100644 --- a/public/app/plugins/panel/timeseries/module.tsx +++ b/public/app/plugins/panel/timeseries/module.tsx @@ -25,4 +25,5 @@ export const plugin = new PanelPlugin(TimeSeriesPanel }); addLegendOptions(builder); - }); + }) + .setDataSupport({ annotations: true });