QueryField: Handle autocomplete better (#81484)
* extract out function + add unit tests * add feature toggle and default it to on
This commit is contained in:
@@ -1320,5 +1320,14 @@ var (
|
||||
Owner: grafanaObservabilityMetricsSquad,
|
||||
Created: time.Date(2024, time.January, 29, 0, 0, 0, 0, time.UTC),
|
||||
},
|
||||
{
|
||||
Name: "slateAutocomplete",
|
||||
Description: "Adjusts the behaviour of the slate editor to properly handle autocomplete. Feature toggled for safety.",
|
||||
Stage: FeatureStageGeneralAvailability,
|
||||
Expression: "true", // enabled by default
|
||||
FrontendOnly: true,
|
||||
Owner: grafanaFrontendPlatformSquad,
|
||||
Created: time.Date(2024, time.January, 29, 12, 0, 0, 0, time.UTC),
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -155,3 +155,4 @@ jitterAlertRulesWithinGroups,preview,@grafana/alerting-squad,2024-01-17,false,tr
|
||||
onPremToCloudMigrations,experimental,@grafana/grafana-operator-experience-squad,2024-01-22,false,false,false
|
||||
alertingSaveStatePeriodic,privatePreview,@grafana/alerting-squad,2024-01-22,false,false,false
|
||||
promQLScope,experimental,@grafana/observability-metrics,2024-01-29,false,false,false
|
||||
slateAutocomplete,GA,@grafana/grafana-frontend-platform,2024-01-29,false,false,true
|
||||
|
||||
|
@@ -630,4 +630,8 @@ const (
|
||||
// FlagPromQLScope
|
||||
// In-development feature that will allow injection of labels into prometheus queries.
|
||||
FlagPromQLScope = "promQLScope"
|
||||
|
||||
// FlagSlateAutocomplete
|
||||
// Adjusts the behaviour of the slate editor to properly handle autocomplete. Feature toggled for safety.
|
||||
FlagSlateAutocomplete = "slateAutocomplete"
|
||||
)
|
||||
|
||||
@@ -239,7 +239,7 @@ func TestSchedulableAlertRulesRegistry(t *testing.T) {
|
||||
assert.Len(t, rules, 0)
|
||||
assert.Len(t, folders, 0)
|
||||
|
||||
expectedFolders := map[models.FolderKey]string{models.FolderKey{OrgID: 1, UID: "test-uid"}: "test-title"}
|
||||
expectedFolders := map[models.FolderKey]string{{OrgID: 1, UID: "test-uid"}: "test-title"}
|
||||
// replace all rules in the registry with foo
|
||||
r.set([]*models.AlertRule{{OrgID: 1, UID: "foo", Version: 1}}, expectedFolders)
|
||||
rules, folders = r.all()
|
||||
|
||||
Reference in New Issue
Block a user