Alerting: Fix alert panel instance-based rules filtering (#52583)

This commit is contained in:
Konrad Lalik
2022-07-22 12:52:56 +02:00
committed by GitHub
parent b4c6efa07b
commit 0507b3564f
6 changed files with 45 additions and 15 deletions

View File

@@ -1,5 +1,6 @@
import { isArray, reduce } from 'lodash';
import { IconName } from '@grafana/ui';
import { QueryPartDef, QueryPart } from 'app/features/alerting/state/query_part';
const alertQueryDef = new QueryPartDef({
@@ -87,7 +88,13 @@ function normalizeAlertState(state: string) {
return state.toLowerCase().replace(/_/g, '').split(' ')[0];
}
function getStateDisplayModel(state: string) {
interface AlertStateDisplayModel {
text: string;
iconClass: IconName;
stateClass: string;
}
function getStateDisplayModel(state: string): AlertStateDisplayModel {
const normalizedState = normalizeAlertState(state);
switch (normalizedState) {