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:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
alertingModels "github.com/grafana/alerting/alerting/models"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/data"
|
||||
"github.com/grafana/grafana/pkg/expr"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
@@ -571,7 +572,7 @@ func withClassicConditionSingleQuery() func(r *ngmodels.AlertRule) {
|
||||
RefID: "B",
|
||||
QueryType: "",
|
||||
RelativeTimeRange: ngmodels.RelativeTimeRange{From: ngmodels.Duration(0), To: ngmodels.Duration(0)},
|
||||
DatasourceUID: "-100",
|
||||
DatasourceUID: expr.DatasourceUID,
|
||||
Model: json.RawMessage(fmt.Sprintf(classicConditionsModel, "A", "B")),
|
||||
},
|
||||
}
|
||||
@@ -600,21 +601,21 @@ func withExpressionsMultiQuery() func(r *ngmodels.AlertRule) {
|
||||
RefID: "C",
|
||||
QueryType: "",
|
||||
RelativeTimeRange: ngmodels.RelativeTimeRange{From: ngmodels.Duration(0), To: ngmodels.Duration(0)},
|
||||
DatasourceUID: "-100",
|
||||
DatasourceUID: expr.DatasourceUID,
|
||||
Model: json.RawMessage(fmt.Sprintf(reduceLastExpressionModel, "A", "C")),
|
||||
},
|
||||
{
|
||||
RefID: "D",
|
||||
QueryType: "",
|
||||
RelativeTimeRange: ngmodels.RelativeTimeRange{From: ngmodels.Duration(0), To: ngmodels.Duration(0)},
|
||||
DatasourceUID: "-100",
|
||||
DatasourceUID: expr.DatasourceUID,
|
||||
Model: json.RawMessage(fmt.Sprintf(reduceLastExpressionModel, "B", "D")),
|
||||
},
|
||||
{
|
||||
RefID: "E",
|
||||
QueryType: "",
|
||||
RelativeTimeRange: ngmodels.RelativeTimeRange{From: ngmodels.Duration(0), To: ngmodels.Duration(0)},
|
||||
DatasourceUID: "-100",
|
||||
DatasourceUID: expr.DatasourceUID,
|
||||
Model: json.RawMessage(fmt.Sprintf(mathExpressionModel, "A", "B", "E")),
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user