[v9.2.x] Expressions: Fixes the issue showing expressions editor (#62626)

* 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

(cherry picked from commit 91221bc436)

* unit text fix
This commit is contained in:
ismail simsek
2023-01-31 20:59:01 +01:00
committed by GitHub
parent 71f7f534ff
commit e2e9479e53
49 changed files with 207 additions and 191 deletions
@@ -20,6 +20,7 @@ import (
"github.com/prometheus/common/model"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/expr"
"github.com/grafana/grafana/pkg/models"
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
@@ -968,7 +969,7 @@ func getRulesConfig(t *testing.T) string {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
DatasourceUID: expr.DatasourceUID,
Model: json.RawMessage(`{
"type": "math",
"expression": "2 + 3 > 1"
@@ -1627,7 +1628,7 @@ const alertmanagerConfig = `
}
}
]
},
},
{
"name": "slack_recv2",
"grafana_managed_receiver_configs": [