From 09be989131d3d5469768e93dbc81a8a71b8c3568 Mon Sep 17 00:00:00 2001 From: Devin Hurley Date: Tue, 26 Nov 2024 16:32:58 -0500 Subject: [PATCH] removes suppression fields when saving and suppression is disabled --- .../use_experimental_feature_fields_transform.ts | 14 ++++++++++---- .../rule_creation_ui/pages/rule_editing/index.tsx | 2 -- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_experimental_feature_fields_transform.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_experimental_feature_fields_transform.ts index a95106d5da817..d896fa676d31d 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_experimental_feature_fields_transform.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_experimental_feature_fields_transform.ts @@ -9,6 +9,12 @@ import { useCallback } from 'react'; import type { DefineStepRule } from '../../../../detections/pages/detection_engine/rules/types'; import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { isEqlRule, isEqlSequenceQuery } from '../../../../../common/detection_engine/utils'; +import { + ALERT_SUPPRESSION_FIELDS_FIELD_NAME, + ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME, + ALERT_SUPPRESSION_DURATION_FIELD_NAME, + ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME, +} from '../../../rule_creation/components/alert_suppression_edit'; /** * transforms DefineStepRule fields according to experimental feature flags @@ -30,10 +36,10 @@ export const useExperimentalFeatureFieldsTransform = = ({ rule }) => { startTransaction({ name: SINGLE_RULE_ACTIONS.SAVE }); const localDefineStepData: DefineStepRule = defineFieldsTransform({ ...defineStepData, - eqlOptions: eqlOptionsSelected, }); const updatedRule = await updateRule({ ...formatRule( @@ -401,7 +400,6 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { actionsStepData, defineStepData, defineFieldsTransform, - eqlOptionsSelected, addSuccess, navigateToApp, rule?.exceptions_list,