Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Default Risk score slide bar values are overlaid on Rule Creation page #161793

Merged
merged 6 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ const CreateRulePageComponent: React.FC = () => {
dataViewId={defineStepData.dataViewId}
timestampOverride={aboutStepData.timestampOverride}
isLoading={isCreateRuleLoading || loading}
isActive={activeStep === RuleStep.aboutRule}
form={aboutStepForm}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ const EditRulePageComponent: FC<{ rule: Rule }> = ({ rule }) => {
<StepAboutRule
isLoading={isLoading}
isUpdateView
isActive={activeStep === RuleStep.aboutRule}
ruleType={defineStepData.ruleType}
machineLearningJobId={defineStepData.machineLearningJobId}
index={defineStepData.index}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ describe('StepAboutRuleComponent', () => {
dataViewId={defineStepDefault.dataViewId}
timestampOverride={stepAboutDefaultValue.timestampOverride}
isLoading={false}
isActive={true}
form={aboutStepForm}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ interface StepAboutRuleProps extends RuleStepProps {
dataViewId: string | undefined;
timestampOverride: string;
form: FormHook<AboutStepRule>;

// 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 {
Expand All @@ -69,6 +77,7 @@ const StepAboutRuleComponent: FC<StepAboutRuleProps> = ({
index,
dataViewId,
timestampOverride,
isActive = false,
isUpdateView = false,
isLoading,
form,
Expand Down