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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/[email protected]",
"@elastic/ems-client": "8.5.1",
"@elastic/eui": "91.3.1",
"@elastic/eui": "92.0.0-backport.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -371,22 +371,6 @@ export const getEuiContextMapping = (): EuiTokensObject => {
'euiCommonlyUsedTimeRanges.legend': i18n.translate('core.euiCommonlyUsedTimeRanges.legend', {
defaultMessage: 'Commonly used',
}),
'euiControlBar.screenReaderHeading': i18n.translate('core.euiControlBar.screenReaderHeading', {
defaultMessage: 'Page level controls',
}),
'euiControlBar.screenReaderAnnouncement': i18n.translate(
'core.euiControlBar.screenReaderAnnouncement',
{
defaultMessage:
'There is a new region landmark with page level controls at the end of the document.',
}
),
'euiControlBar.customScreenReaderAnnouncement': ({ landmarkHeading }: EuiValues) =>
i18n.translate('core.euiControlBar.customScreenReaderAnnouncement', {
defaultMessage:
'There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.',
values: { landmarkHeading },
}),
'euiGlobalToastList.clearAllToastsButtonAriaLabel': i18n.translate(
'core.euiGlobalToastList.clearAllToastsButtonAriaLabel',
{
Expand Down Expand Up @@ -938,56 +922,10 @@ export const getEuiContextMapping = (): EuiTokensObject => {
'euiModal.closeModal': i18n.translate('core.euiModal.closeModal', {
defaultMessage: 'Closes this modal window',
}),
'euiNotificationEventMessages.accordionButtonText': ({ messagesLength }: EuiValues) =>
i18n.translate('core.euiNotificationEventMessages.accordionButtonText', {
defaultMessage: '+ {messagesLength} more',
values: { messagesLength },
}),
'euiErrorBoundary.error': i18n.translate('core.euiErrorBoundary.error', {
defaultMessage: 'Error',
description: 'Error boundary for uncaught exceptions when rendering part of the application',
}),
'euiNotificationEventMessages.accordionAriaLabelButtonText': ({
messagesLength,
eventName,
}: EuiValues) =>
i18n.translate('core.euiNotificationEventMessages.accordionAriaLabelButtonText', {
defaultMessage: '+ {messagesLength} messages for {eventName}',
values: { messagesLength, eventName },
}),
'euiNotificationEventMeta.contextMenuButton': ({ eventName }: EuiValues) =>
i18n.translate('core.euiNotificationEventMeta.contextMenuButton', {
defaultMessage: 'Menu for {eventName}',
values: { eventName },
}),
'euiNotificationEventReadButton.markAsReadAria': ({ eventName }: EuiValues) =>
i18n.translate('core.euiNotificationEventReadButton.markAsReadAria', {
defaultMessage: 'Mark {eventName} as read',
values: { eventName },
}),
'euiNotificationEventReadButton.markAsUnreadAria': ({ eventName }: EuiValues) =>
i18n.translate('core.euiNotificationEventReadButton.markAsUnreadAria', {
defaultMessage: 'Mark {eventName} as unread',
values: { eventName },
}),
'euiNotificationEventReadButton.markAsRead': i18n.translate(
'core.euiNotificationEventReadButton.markAsRead',
{
defaultMessage: 'Mark as read',
}
),
'euiNotificationEventReadButton.markAsUnread': i18n.translate(
'core.euiNotificationEventReadButton.markAsUnread',
{
defaultMessage: 'Mark as unread',
}
),
'euiNotificationEventMessages.accordionHideText': i18n.translate(
'core.euiNotificationEventMessages.accordionHideText',
{
defaultMessage: 'hide',
}
),
'euiPagination.pageOfTotalCompressed': ({ page, total }: EuiValues) => (
<FormattedMessage
id="core.euiPagination.pageOfTotalCompressed"
Expand Down Expand Up @@ -1802,25 +1740,6 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'You can quickly navigate this list using arrow keys.',
}
),
'euiNotificationEventReadIcon.read': i18n.translate('core.euiNotificationEventReadIcon.read', {
defaultMessage: 'Read',
}),
'euiNotificationEventReadIcon.readAria': ({ eventName }: EuiValues) =>
i18n.translate('core.euiNotificationEventReadIcon.readAria', {
defaultMessage: '{eventName} is read',
values: { eventName },
}),
'euiNotificationEventReadIcon.unread': i18n.translate(
'core.euiNotificationEventReadIcon.unread',
{
defaultMessage: 'Unread',
}
),
'euiNotificationEventReadIcon.unreadAria': ({ eventName }: EuiValues) =>
i18n.translate('core.euiNotificationEventReadIcon.unreadAria', {
defaultMessage: '{eventName} is unread',
values: { eventName },
}),
'euiSkeletonLoading.loadingAriaText': ({ contentAriaLabel }: EuiValues) =>
i18n.translate('core.euiSkeletonLoading.loadingAriaText', {
defaultMessage: 'Loading {contentAriaLabel}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const popoverTitleStyle = css`
`;
const filterButtonStyle = css`
&,
& .euiFilterButton__textShift {
& .euiFilterButton__text {
min-width: 0;
line-height: 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const LICENSE_OVERRIDES = {
'[email protected]': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts
'@mapbox/[email protected]': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'@elastic/[email protected]': ['Elastic License 2.0'],
'@elastic/eui@91.3.1': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/eui@92.0.0-backport.0': ['SSPL-1.0 OR Elastic License 2.0'],
'[email protected]': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry
'[email protected]': ['MIT'], // license in importing module https://www.npmjs.com/package/binary
'@bufbuild/[email protected]': ['Apache-2.0'], // license (Apache-2.0 AND BSD-3-Clause)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const MyEuiFilterGroup = styled(EuiFilterGroup)`

const FilterAllButton = styled(EuiFilterButton)`
&,
& .euiFilterButton__textShift {
& .euiFilterButton__text {
min-width: 28px;
}
`;
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ journey(`MonitorManagementList`, async ({ page, params }) => {
});

step('Filter by Frequency', async () => {
const frequencyFilter = page.locator('.euiFilterButton__textShift', { hasText: 'Frequency' });
const frequencyFilter = page.locator('.euiFilterButton__text', { hasText: 'Frequency' });
const fiveMinuteScheduleOption = page.getByText('Every 5 minutes').first();

await frequencyFilter.click();
Expand Down
Loading