mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: Check that timeEnd if defined before comparing to avoid false truthiness (#18903)
* Check that timeEnd if defined before comparing to avoid false truthiness * Moved loop Fixes #18902
This commit is contained in:
committed by
Torkel Ödegaard
parent
3f0862a7d1
commit
849d4881cd
@@ -60,10 +60,6 @@ export class AnnotationsSrv {
|
||||
});
|
||||
|
||||
annotations = dedupAnnotations(annotations);
|
||||
for (let i = 0; i < annotations.length; i++) {
|
||||
const a = annotations[i];
|
||||
a.isRegion = a.time !== a.timeEnd;
|
||||
}
|
||||
|
||||
// look for alert state for this panel
|
||||
const alertState: any = _.find(results[1], { panelId: options.panel.id });
|
||||
@@ -181,7 +177,9 @@ export class AnnotationsSrv {
|
||||
|
||||
for (const item of results) {
|
||||
item.source = annotation;
|
||||
item.isRegion = item.timeEnd && item.time !== item.timeEnd;
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user