[v10.0.x] Alerting: Fix broken UI because of query being optional for some ExpressionQuer… (#69683)
Alerting: Fix broken UI because of query being optional for some ExpressionQuer… (#69650)
* Fix broken UI because of query being optional for some ExpressionQuery coditions field
* Delete query field from conditions in utils.test.ts
(cherry picked from commit 848eb01a89)
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
This commit is contained in:
co-authored by
Sonia Aguilar
parent
45694ea55b
commit
e1466bf47e
@@ -396,16 +396,6 @@ function createThresholdExample(thresholdType: string): AlertQuery[] {
|
||||
params: [0, 10],
|
||||
type: thresholdType ?? 'gt',
|
||||
},
|
||||
operator: {
|
||||
type: 'and',
|
||||
},
|
||||
query: {
|
||||
params: ['B'],
|
||||
},
|
||||
reducer: {
|
||||
params: [],
|
||||
type: 'last',
|
||||
},
|
||||
},
|
||||
],
|
||||
expression: 'B',
|
||||
|
||||
@@ -150,7 +150,7 @@ export function getThresholdsForQueries(queries: AlertQuery[]) {
|
||||
const threshold = condition.evaluator.params;
|
||||
|
||||
// "classic_conditions" use `condition.query.params[]` and "threshold" uses `query.model.expression`
|
||||
const refId = condition.query.params[0] ?? query.model.expression;
|
||||
const refId = condition.query?.params[0] ?? query.model.expression;
|
||||
|
||||
// if an expression hasn't been linked to a data query yet, it won't have a refId
|
||||
if (!refId) {
|
||||
|
||||
Reference in New Issue
Block a user