mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Expressions: Fixes the issue showing expressions editor (#62510)
* Use suggested value for uid * update the snapshot * use __expr__ * replace all -100 with __expr__ * update snapshot * more changes * revert redundant change * Use expr.DatasourceUID where it's possible * generate files
This commit is contained in:
@@ -719,13 +719,13 @@ func withQueryForState(t *testing.T, evalResult eval.State) models.AlertRuleMuta
|
||||
switch evalResult {
|
||||
case eval.Normal:
|
||||
expression = `{
|
||||
"datasourceUid": "-100",
|
||||
"datasourceUid": "__expr__",
|
||||
"type":"math",
|
||||
"expression":"2 + 1 < 1"
|
||||
}`
|
||||
case eval.Pending, eval.Alerting:
|
||||
expression = `{
|
||||
"datasourceUid": "-100",
|
||||
"datasourceUid": "__expr__",
|
||||
"type":"math",
|
||||
"expression":"2 + 2 > 1"
|
||||
}`
|
||||
@@ -734,7 +734,7 @@ func withQueryForState(t *testing.T, evalResult eval.State) models.AlertRuleMuta
|
||||
}
|
||||
case eval.Error:
|
||||
expression = `{
|
||||
"datasourceUid": "-100",
|
||||
"datasourceUid": "__expr__",
|
||||
"type":"math",
|
||||
"expression":"$A"
|
||||
}`
|
||||
@@ -746,7 +746,7 @@ func withQueryForState(t *testing.T, evalResult eval.State) models.AlertRuleMuta
|
||||
rule.Condition = "A"
|
||||
rule.Data = []models.AlertQuery{
|
||||
{
|
||||
DatasourceUID: "-100",
|
||||
DatasourceUID: expr.DatasourceUID,
|
||||
Model: json.RawMessage(expression),
|
||||
RelativeTimeRange: models.RelativeTimeRange{
|
||||
From: models.Duration(5 * time.Hour),
|
||||
|
||||
Reference in New Issue
Block a user