From 1f26be27af70f2a514eca8f140b89371561df86d Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:34:04 +1100 Subject: [PATCH] [8.16] [ResponseOps][Rules]Deprecate `ruleFormV2` flag. (#196507) (#196702) # Backport This will backport the following commits from `main` to `8.16`: - [[ResponseOps][Rules]Deprecate `ruleFormV2` flag. (#196507)](https://github.com/elastic/kibana/pull/196507) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Antonio --- .../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];