QueryEditor: remove slateAutocomplete toggle (#81696)

remove toggle
This commit is contained in:
Ashley Harrison 2024-02-01 13:03:11 +00:00 committed by GitHub
parent d0ecf863df
commit 3e01ba0f57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 27 additions and 75 deletions

View File

@ -57,7 +57,6 @@ Some features are enabled by default. You can disable these feature by setting t
| `lokiQueryHints` | Enables query hints for Loki | Yes |
| `alertingQueryOptimization` | Optimizes eligible queries in order to reduce load on datasources | |
| `jitterAlertRules` | Distributes alert rule evaluations more evenly over time, by rule group | |
| `slateAutocomplete` | Adjusts the behaviour of the slate editor to properly handle autocomplete. Feature toggled for safety. | Yes |
## Preview feature toggles

View File

@ -176,6 +176,5 @@ export interface FeatureToggles {
onPremToCloudMigrations?: boolean;
alertingSaveStatePeriodic?: boolean;
promQLScope?: boolean;
slateAutocomplete?: boolean;
nodeGraphDotLayout?: boolean;
}

View File

@ -2,29 +2,6 @@ import { getNumCharsToDelete } from './suggestions';
describe('suggestions', () => {
describe('getNumCharsToDelete', () => {
describe('when slateAutocomplete is enabled', () => {
let originalBootData = window.grafanaBootData;
// hacky way to enable the feature toggle for this test
beforeEach(() => {
if (originalBootData) {
window.grafanaBootData = {
...originalBootData,
settings: {
...originalBootData.settings,
featureToggles: {
...originalBootData.settings.featureToggles,
slateAutocomplete: true,
},
},
};
}
});
afterEach(() => {
window.grafanaBootData = originalBootData;
});
const splunkCleanText = (s: string) => s.replace(/[{}[\]="(),!~+\-*/^%:\\]/g, '').trim();
it.each([
// | represents the caret position
@ -49,5 +26,4 @@ describe('suggestions', () => {
}
);
});
});
});

View File

@ -360,18 +360,10 @@ export function getNumCharsToDelete(
const text = cleanText ? cleanText(typeaheadText) : typeaheadText;
const offset = typeaheadText.indexOf(typeaheadPrefix);
let forward: number;
if (window.grafanaBootData?.settings.featureToggles['slateAutocomplete']) {
const suffixLength =
offset > -1 ? text.length - offset - typeaheadPrefix.length : text.length - typeaheadPrefix.length;
const midWord = Boolean((typeaheadPrefix && suffixLength > 0) || suggestionText === typeaheadText);
forward = midWord && !preserveSuffix ? suffixLength + offset : 0;
} else {
const suffixLength = text.length - typeaheadPrefix.length;
const midWord = typeaheadPrefix && ((suffixLength > 0 && offset > -1) || suggestionText === typeaheadText);
forward = midWord && !preserveSuffix ? suffixLength + offset : 0;
}
const forward = midWord && !preserveSuffix ? suffixLength + offset : 0;
return {
forward,

View File

@ -1337,15 +1337,6 @@ 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),
},
{
Name: "nodeGraphDotLayout",
Description: "Changed the layout algorithm for the node graph",

View File

@ -157,5 +157,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
nodeGraphDotLayout,experimental,@grafana/observability-traces-and-profiling,2024-01-02,false,false,true

1 Name Stage Owner Created requiresDevMode RequiresRestart FrontendOnly
157 onPremToCloudMigrations experimental @grafana/grafana-operator-experience-squad 2024-01-22 false false false
158 alertingSaveStatePeriodic privatePreview @grafana/alerting-squad 2024-01-22 false false false
159 promQLScope experimental @grafana/observability-metrics 2024-01-29 false false false
slateAutocomplete GA @grafana/grafana-frontend-platform 2024-01-29 false false true
160 nodeGraphDotLayout experimental @grafana/observability-traces-and-profiling 2024-01-02 false false true

View File

@ -639,10 +639,6 @@ const (
// 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"
// FlagNodeGraphDotLayout
// Changed the layout algorithm for the node graph
FlagNodeGraphDotLayout = "nodeGraphDotLayout"