mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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
This commit is contained in:
parent
498f8ea4ea
commit
848eb01a89
@ -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',
|
||||
|
@ -152,7 +152,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user