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

Upgrade EUI to v92.0.0 #174487

Merged
merged 9 commits into from
Jan 10, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ interface RiskScoreFieldProps {
idAria: string;
indices: DataViewBase;
isDisabled: boolean;
isActive: boolean;
placeholder?: string;
}

Expand All @@ -61,7 +60,6 @@ export const RiskScoreField = ({
idAria,
indices,
isDisabled,
isActive,
placeholder,
}: RiskScoreFieldProps) => {
const { value, isMappingChecked, mapping } = field.value;
Expand Down Expand Up @@ -149,39 +147,29 @@ export const RiskScoreField = ({
return (
<EuiFlexGroup direction={'column'}>
<EuiFlexItem>
{
// 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 force EuiRange re-rendering by removing/adding it into the DOM.
// NOTE: We should remove this workaround once EUI team fixed EuiRange.
// Related ticket: https://github.com/elastic/kibana/issues/160561
}
{isActive && (
<EuiFormRow
Comment on lines -153 to -161
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@e40pud I tested this locally and it appears to be working for me, but would super appreciate a second confirmation/QA! ✨

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally. There is no issue anymore! Thanks for fixing this!!

label={riskScoreLabel}
labelAppend={field.labelAppend}
helpText={field.helpText}
error={'errorMessage'}
isInvalid={false}
fullWidth
data-test-subj={`${dataTestSubj}-defaultRisk`}
describedByIds={idAria ? [idAria] : undefined}
>
<EuiRange
value={value}
onChange={handleDefaultRiskScoreChange}
max={100}
min={0}
showRange
showInput
fullWidth={false}
showTicks
tickInterval={25}
data-test-subj={`${dataTestSubj}-defaultRiskRange`}
/>
</EuiFormRow>
)}
<EuiFormRow
label={riskScoreLabel}
labelAppend={field.labelAppend}
helpText={field.helpText}
error={'errorMessage'}
isInvalid={false}
fullWidth
data-test-subj={`${dataTestSubj}-defaultRisk`}
describedByIds={idAria ? [idAria] : undefined}
>
<EuiRange
value={value}
onChange={handleDefaultRiskScoreChange}
max={100}
min={0}
showRange
showInput
fullWidth={false}
showTicks
tickInterval={25}
data-test-subj={`${dataTestSubj}-defaultRiskRange`}
/>
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem>
<EuiFormRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ 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 @@ -50,13 +50,6 @@ interface StepAboutRuleProps extends RuleStepProps {
timestampOverride: string;
form: FormHook<AboutStepRule>;
esqlQuery?: string | undefined;
// 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 @@ -83,7 +76,6 @@ const StepAboutRuleComponent: FC<StepAboutRuleProps> = ({
index,
dataViewId,
timestampOverride,
isActive = false,
isUpdateView = false,
isLoading,
form,
Expand Down Expand Up @@ -188,7 +180,6 @@ const StepAboutRuleComponent: FC<StepAboutRuleProps> = ({
dataTestSubj: 'detectionEngineStepAboutRuleRiskScore',
idAria: 'detectionEngineStepAboutRuleRiskScore',
isDisabled: isLoading || indexPatternLoading,
isActive,
indices: indexPattern,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ const CreateRulePageComponent: React.FC = () => {
dataViewId={defineStepData.dataViewId}
timestampOverride={aboutStepData.timestampOverride}
isLoading={isCreateRuleLoading || loading}
isActive={activeStep === RuleStep.aboutRule}
form={aboutStepForm}
esqlQuery={esqlQueryForAboutStep}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => {
<StepAboutRule
isLoading={isLoading}
isUpdateView
isActive={activeStep === RuleStep.aboutRule}
ruleType={defineStepData.ruleType}
machineLearningJobId={defineStepData.machineLearningJobId}
index={memoizedIndex}
Expand Down