mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: Turns on annotations in Graph and TimeSeries (#33402)
* Annotations: Turns on annotations in Graph and TimeSeries * Refactor: moves to notPersistedProperties
This commit is contained in:
@@ -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<string, PanelOptionsCache>;
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ export class PanelQueryRunner {
|
||||
constructor(dataConfigSource: DataConfigSource) {
|
||||
this.subject = new ReplaySubject(1);
|
||||
this.dataConfigSource = dataConfigSource;
|
||||
this.dataSupport = this.dataConfigSource.dataSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -373,6 +373,7 @@ export const plugin = new PanelPlugin<GraphPanelOptions, GraphFieldConfig>(null)
|
||||
FieldConfigProperty.Mappings,
|
||||
],
|
||||
})
|
||||
.setDataSupport({ annotations: true, alertStates: true })
|
||||
.setMigrationHandler(graphPanelMigrationHandler);
|
||||
|
||||
// Use the angular ctrt rather than a react one
|
||||
|
||||
@@ -25,4 +25,5 @@ export const plugin = new PanelPlugin<Options, GraphFieldConfig>(TimeSeriesPanel
|
||||
});
|
||||
|
||||
addLegendOptions(builder);
|
||||
});
|
||||
})
|
||||
.setDataSupport({ annotations: true });
|
||||
|
||||
Reference in New Issue
Block a user