Alerting: Fixes alert panel header icon not showing (#30840)

* Alerting: Fixes alert panel header icon not showing

* Remove as any
This commit is contained in:
Torkel Ödegaard
2021-02-04 09:15:01 +01:00
committed by GitHub
parent aaf5710748
commit 01b10ab436
3 changed files with 21 additions and 3 deletions

View File

@@ -77,7 +77,12 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
);
subs.add(
panel.events.subscribe(RenderEvent, () => {
panel.events.subscribe(RenderEvent, (event) => {
// this event originated from angular so no need to bubble it back
if (event.payload?.fromAngular) {
return;
}
updateDimensionsFromParentScope();
$timeout(() => {
@@ -87,6 +92,16 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
})
);
subs.add(
ctrl.events.subscribe(RenderEvent, (event) => {
// this event originated from angular so bubble it to react so the PanelChromeAngular can update the panel header alert state
if (event.payload) {
event.payload.fromAngular = true;
panel.events.publish(event);
}
})
);
scope.$on('$destroy', () => {
elem.off();