From 0fa5afdcbf42631c8bd1e289c7ef4d4ee8fb82d3 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 18 Jul 2023 09:56:49 -0400 Subject: [PATCH] [8.9] [Security Solution] Default Risk score slide bar values are overlaid on Rule Creation page (#161793) (#162138) # Backport This will backport the following commits from `main` to `8.9`: - [[Security Solution] Default Risk score slide bar values are overlaid on Rule Creation page (#161793)](https://github.com/elastic/kibana/pull/161793) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Ievgen Sorokopud --- .../rule_creation_ui/pages/rule_creation/index.tsx | 1 + .../rule_creation_ui/pages/rule_editing/index.tsx | 1 + .../components/rules/step_about_rule/index.test.tsx | 1 + .../components/rules/step_about_rule/index.tsx | 9 +++++++++ 4 files changed, 12 insertions(+) diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx index 85c2f92b2bff6..1b3678f9c28dd 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx @@ -579,6 +579,7 @@ const CreateRulePageComponent: React.FC = () => { dataViewId={defineStepData.dataViewId} timestampOverride={aboutStepData.timestampOverride} isLoading={isCreateRuleLoading || loading} + isActive={activeStep === RuleStep.aboutRule} form={aboutStepForm} /> diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx index b8e735ecfc0f2..c787bb3003b5d 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx @@ -269,6 +269,7 @@ const EditRulePageComponent: FC<{ rule: Rule }> = ({ rule }) => { { dataViewId={defineStepDefault.dataViewId} timestampOverride={stepAboutDefaultValue.timestampOverride} isLoading={false} + isActive={true} form={aboutStepForm} /> ); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.tsx index 369d05939cd62..cd2d8a3fa6e51 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.tsx @@ -43,6 +43,14 @@ interface StepAboutRuleProps extends RuleStepProps { dataViewId: string | undefined; timestampOverride: string; form: FormHook; + + // TODO: https://github.com/elastic/kibana/issues/161456 + // The About step page contains EuiRange component which does not work properly within memoized parents. + // EUI team suggested not to memoize EuiRange/EuiDualRange: https://github.com/elastic/eui/issues/6846 + // Workaround: We introduced this additional property to be able to do extra re-render on switching to/from the About step page. + // NOTE: We should remove this workaround once EUI team fixed EuiRange. + // Related ticket: https://github.com/elastic/kibana/issues/160561 + isActive: boolean; } interface StepAboutRuleReadOnlyProps { @@ -69,6 +77,7 @@ const StepAboutRuleComponent: FC = ({ index, dataViewId, timestampOverride, + isActive = false, isUpdateView = false, isLoading, form,