Alerting: Support for alerting for react panels, and lots of fixes to alert annotations for both react and angular (#33608)

* Alerting: Support for alerting for react panels, and lots of fixes to alert annotations for both react and angular

* Fix showing annotations in panel edit
This commit is contained in:
Torkel Ödegaard
2021-05-03 08:52:05 +02:00
committed by GitHub
parent 567b852072
commit f2e4f41f69
16 changed files with 141 additions and 110 deletions

View File

@@ -173,7 +173,6 @@ export class PanelModel implements DataConfigSource {
cachedPluginOptions: Record<string, PanelOptionsCache> = {};
legend?: { show: boolean; sort?: string; sortDesc?: boolean };
plugin?: PanelPlugin;
dataSupport?: PanelPluginDataSupport;
/**
* The PanelModel event bus only used for internal and legacy angular support.
@@ -355,7 +354,6 @@ export class PanelModel implements DataConfigSource {
}
}
this.dataSupport = plugin.dataSupport;
this.applyPluginOptionDefaults(plugin, false);
this.resendLastResult();
}
@@ -484,6 +482,10 @@ export class PanelModel implements DataConfigSource {
};
}
getDataSupport(): PanelPluginDataSupport {
return this.plugin?.dataSupport ?? { annotations: false, alertStates: false };
}
getQueryRunner(): PanelQueryRunner {
if (!this.queryRunner) {
this.queryRunner = new PanelQueryRunner(this);