mirror of
https://github.com/grafana/grafana.git
synced 2024-11-24 09:50:29 -06:00
Alerting: Fix getSimpleConditionFromExpressions (#94516)
fix getSimpleConditionFromExpressions
This commit is contained in:
parent
9ece88d585
commit
419598c745
@ -218,11 +218,17 @@ export function getSimpleConditionFromExpressions(expressions: Array<AlertQuery<
|
||||
(query) => query.model.type === ExpressionQueryType.threshold && query.refId === SIMPLE_CONDITION_THRESHOLD_ID
|
||||
);
|
||||
const conditionsFromThreshold = thresholdExpression?.model.conditions ?? [];
|
||||
const whenField = reduceExpression?.model.reducer ?? ReducerID.last;
|
||||
const params = conditionsFromThreshold[0]?.evaluator?.params
|
||||
? [...conditionsFromThreshold[0]?.evaluator?.params]
|
||||
: [0];
|
||||
const type = conditionsFromThreshold[0]?.evaluator?.type ?? EvalFunction.IsAbove;
|
||||
|
||||
return {
|
||||
whenField: reduceExpression?.model.reducer ?? ReducerID.last,
|
||||
whenField: whenField,
|
||||
evaluator: {
|
||||
params: [...conditionsFromThreshold[0]?.evaluator?.params] ?? [0],
|
||||
type: conditionsFromThreshold[0]?.evaluator?.type ?? EvalFunction.IsAbove,
|
||||
params: params,
|
||||
type: type,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user