Annotations: Fix alerting annotation coloring (#37412)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Kyle Brandt
2021-08-12 12:37:54 -04:00
committed by GitHub
parent d18bd03a82
commit aef67994a1
3 changed files with 27 additions and 9 deletions

View File

@@ -59,9 +59,9 @@ export function translateQueryResult(annotation: AnnotationQuery, results: Annot
item.type = annotation.name;
item.isRegion = Boolean(item.timeEnd && item.time !== item.timeEnd);
switch (item.newState) {
switch (item.newState?.toLowerCase()) {
case 'pending':
item.color = 'gray';
item.color = 'yellow';
break;
case 'alerting':
item.color = 'red';
@@ -69,9 +69,15 @@ export function translateQueryResult(annotation: AnnotationQuery, results: Annot
case 'ok':
item.color = 'green';
break;
case 'normal': // ngalert ("normal" instead of "ok")
item.color = 'green';
break;
case 'no_data':
item.color = 'gray';
break;
case 'nodata': // ngalert
item.color = 'gray';
break;
}
}