From 9500dad658c24273c0db94cbb917c17eedc6f81d Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 17 Oct 2024 15:48:36 +0200 Subject: [PATCH] [ResponseOps][Rules]Deprecate `ruleFormV2` flag. (#196507) Fixes #196493 ## Summary In a previous PR the `ruleFormV2` feature flag was renamed when it should have been deprecated. This PR fixes that. (cherry picked from commit 7988ced8ea04966a02901e68791eb6f24d6ea40e) --- .../triggers_actions_ui/common/experimental_features.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/triggers_actions_ui/common/experimental_features.ts b/x-pack/plugins/triggers_actions_ui/common/experimental_features.ts index 1f055b965115a..07f70b9b329a7 100644 --- a/x-pack/plugins/triggers_actions_ui/common/experimental_features.ts +++ b/x-pack/plugins/triggers_actions_ui/common/experimental_features.ts @@ -24,6 +24,8 @@ export const allowedExperimentalValues = Object.freeze({ isUsingRuleCreateFlyout: false, }); +const deprecatedExperimentalValues = new Set(['ruleFormV2']); + type ExperimentalConfigKeys = Array; type Mutable = { -readonly [P in keyof T]: T[P] }; @@ -56,7 +58,10 @@ export const parseExperimentalConfigValue = (configValue: string[]): Experimenta }; export const isValidExperimentalValue = (value: string): boolean => { - return allowedKeys.includes(value as keyof ExperimentalFeatures); + return ( + allowedKeys.includes(value as keyof ExperimentalFeatures) || + deprecatedExperimentalValues.has(value) + ); }; export const getExperimentalAllowedValues = (): string[] => [...allowedKeys];