From d679035664a46cd19eeb8d57ca299bacabbd433e Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Wed, 14 Apr 2021 11:27:36 -0500 Subject: [PATCH] Upgrade EUI to v32.0.4 (#96459) * eui to 31.12.0 * type updates * snapshot updates * snapshot updates * euiavatarprops * eui to 32.0.3 * euicard updates * update test --- package.json | 2 +- .../header/__snapshots__/header.test.tsx.snap | 82 ++++++++++++++----- src/core/public/chrome/ui/header/header.tsx | 2 +- .../dashboard_empty_screen.test.tsx.snap | 4 + .../__snapshots__/data_view.test.tsx.snap | 8 +- .../apps/discover/_data_grid_doc_table.ts | 4 +- .../List/__snapshots__/List.test.tsx.snap | 2 +- .../custom_element_modal.stories.storyshot | 39 ++------- .../element_card.stories.storyshot | 10 +-- .../element_grid.stories.storyshot | 6 +- .../saved_elements_modal.stories.storyshot | 8 +- .../text_style_picker.stories.storyshot | 48 +++++++---- .../__snapshots__/edit_var.stories.storyshot | 10 ++- .../workpad_templates.stories.storyshot | 2 +- .../epm/screens/detail/policies/persona.tsx | 2 +- .../__snapshots__/policy_table.test.tsx.snap | 1 + .../__snapshots__/add_license.test.js.snap | 4 +- .../request_trial_extension.test.js.snap | 8 +- .../revert_to_basic.test.js.snap | 6 +- .../__snapshots__/start_trial.test.js.snap | 8 +- .../upload_license.test.tsx.snap | 10 +++ .../__snapshots__/no_data.test.js.snap | 2 + .../__snapshots__/page_loading.test.js.snap | 1 + .../__snapshots__/setup_mode.test.js.snap | 10 +-- .../roles_grid_page.test.tsx.snap | 2 + .../nav_control/nav_control_service.test.ts | 26 +++--- .../reset_session_page.test.tsx.snap | 2 +- .../rules/select_rule_type/index.tsx | 5 -- .../__snapshots__/index.test.tsx.snap | 32 ++++---- .../__snapshots__/index.test.tsx.snap | 44 +++++----- .../spaces_grid_pages.test.tsx.snap | 6 -- .../space_avatar_internal.test.tsx.snap | 10 +-- .../space_avatar/space_avatar_internal.tsx | 13 ++- .../location_status_tags.test.tsx.snap | 4 +- yarn.lock | 14 ++-- 35 files changed, 238 insertions(+), 199 deletions(-) diff --git a/package.json b/package.json index 1d31aa627129c..9b4958c30022c 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath/npm_module", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.4", "@elastic/ems-client": "7.12.0", - "@elastic/eui": "31.10.0", + "@elastic/eui": "32.0.4", "@elastic/filesaver": "1.1.2", "@elastic/good": "^9.0.1-kibana3", "@elastic/maki": "6.3.0", diff --git a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap index 00cc827a1e83f..29407c54e2834 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap @@ -4072,8 +4072,34 @@ exports[`Header renders 1`] = ` aria-expanded={false} aria-haspopup="true" aria-label="Help menu" - buttonRef={null} - className="euiHeaderSectionItem__button" + buttonRef={ + Object { + "current": , + } + } + className="euiHeaderSectionItemButton" color="text" onClick={[Function]} > @@ -4081,7 +4107,7 @@ exports[`Header renders 1`] = ` aria-expanded={false} aria-haspopup="true" aria-label="Help menu" - className="euiButtonEmpty euiButtonEmpty--text euiHeaderSectionItem__button" + className="euiButtonEmpty euiButtonEmpty--text euiHeaderSectionItemButton" disabled={false} onClick={[Function]} type="button" @@ -4101,15 +4127,19 @@ exports[`Header renders 1`] = ` - - - + type="help" + > + + + @@ -4226,7 +4256,7 @@ exports[`Header renders 1`] = ` aria-expanded="false" aria-label="Toggle primary navigation" aria-pressed="false" - class="euiButtonEmpty euiButtonEmpty--text euiHeaderSectionItem__button" + class="euiButtonEmpty euiButtonEmpty--text euiHeaderSectionItemButton" data-test-subj="toggleNavButton" type="button" > @@ -4237,14 +4267,18 @@ exports[`Header renders 1`] = ` class="euiButtonEmpty__text" > + class="euiHeaderSectionItemButton__content" + > + + , } } - className="euiHeaderSectionItem__button" + className="euiHeaderSectionItemButton" color="text" data-test-subj="toggleNavButton" onClick={[Function]} @@ -4254,7 +4288,7 @@ exports[`Header renders 1`] = ` aria-expanded={false} aria-label="Toggle primary navigation" aria-pressed={false} - className="euiButtonEmpty euiButtonEmpty--text euiHeaderSectionItem__button" + className="euiButtonEmpty euiButtonEmpty--text euiHeaderSectionItemButton" data-test-subj="toggleNavButton" disabled={false} onClick={[Function]} @@ -4275,15 +4309,19 @@ exports[`Header renders 1`] = ` - - - + type="menu" + > + + + diff --git a/src/core/public/chrome/ui/header/header.tsx b/src/core/public/chrome/ui/header/header.tsx index 16c89fdca380a..67cdd24aae848 100644 --- a/src/core/public/chrome/ui/header/header.tsx +++ b/src/core/public/chrome/ui/header/header.tsx @@ -98,7 +98,7 @@ export function Header({ ); } - const toggleCollapsibleNavRef = createRef(); + const toggleCollapsibleNavRef = createRef void }>(); const navId = htmlIdGenerator()(); const className = classnames('hide-for-sharing', 'headerGlobalNav'); diff --git a/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap index 9e3018fb512c3..4cd3eb13f3609 100644 --- a/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap +++ b/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap @@ -617,9 +617,11 @@ exports[`DashboardEmptyScreen renders correctly with readonly mode 1`] = `
"`; +exports[`RevertToBasic component should display when license is about to expire 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features(opens in a new tab or window).

"`; -exports[`RevertToBasic component should display when license is expired 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features(opens in a new tab or window).

"`; +exports[`RevertToBasic component should display when license is expired 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features(opens in a new tab or window).

"`; -exports[`RevertToBasic component should display when trial is active 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features(opens in a new tab or window).

"`; +exports[`RevertToBasic component should display when trial is active 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features(opens in a new tab or window).

"`; diff --git a/x-pack/plugins/license_management/__jest__/__snapshots__/start_trial.test.js.snap b/x-pack/plugins/license_management/__jest__/__snapshots__/start_trial.test.js.snap index 9f08c5f11c2a2..1cacadb824630 100644 --- a/x-pack/plugins/license_management/__jest__/__snapshots__/start_trial.test.js.snap +++ b/x-pack/plugins/license_management/__jest__/__snapshots__/start_trial.test.js.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`StartTrial component when trial is allowed display for basic license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; +exports[`StartTrial component when trial is allowed display for basic license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; -exports[`StartTrial component when trial is allowed should display for expired enterprise license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; +exports[`StartTrial component when trial is allowed should display for expired enterprise license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; -exports[`StartTrial component when trial is allowed should display for expired platinum license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; +exports[`StartTrial component when trial is allowed should display for expired platinum license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; -exports[`StartTrial component when trial is allowed should display for gold license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; +exports[`StartTrial component when trial is allowed should display for gold license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; diff --git a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap index c89d183282219..c785ed7c99bda 100644 --- a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap +++ b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap @@ -268,9 +268,11 @@ exports[`UploadLicense should display a modal when license requires acknowledgem
- + - + renders permission denied if required 1`] = `
{ aria-expanded="false" aria-haspopup="true" aria-label="Account menu" - class="euiButtonEmpty euiButtonEmpty--text euiHeaderSectionItem__button" + class="euiButtonEmpty euiButtonEmpty--text euiHeaderSectionItemButton" data-test-subj="userMenuButton" type="button" > @@ -80,18 +80,22 @@ describe('SecurityNavControlService', () => { -
- -
+ +
+ diff --git a/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap b/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap index bcb8a6c975359..785c57490e8ef 100644 --- a/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap +++ b/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ResetSessionPage renders as expected 1`] = `"MockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; +exports[`ResetSessionPage renders as expected 1`] = `"MockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx index 64f0f5f65b1ee..5650c2c55488e 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx @@ -111,7 +111,6 @@ export const SelectRuleType: React.FC = ({ icon={} selectable={querySelectableConfig} layout="horizontal" - textAlign="left" /> )} @@ -131,7 +130,6 @@ export const SelectRuleType: React.FC = ({ isDisabled={mlSelectableConfig.isDisabled && !mlSelectableConfig.isSelected} selectable={mlSelectableConfig} layout="horizontal" - textAlign="left" /> )} @@ -145,7 +143,6 @@ export const SelectRuleType: React.FC = ({ icon={} selectable={thresholdSelectableConfig} layout="horizontal" - textAlign="left" /> )} @@ -159,7 +156,6 @@ export const SelectRuleType: React.FC = ({ icon={} selectable={eqlSelectableConfig} layout="horizontal" - textAlign="left" /> )} @@ -173,7 +169,6 @@ export const SelectRuleType: React.FC = ({ icon={} selectable={threatMatchSelectableConfig} layout="horizontal" - textAlign="left" /> )} diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap index efae0a4b8b3aa..220494b3a5694 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap @@ -2919,7 +2919,7 @@ exports[`TrustedAppsGrid renders correctly when loaded data 1`] = `
`; @@ -44,7 +46,6 @@ exports[`renders with a space name entirely made of whitespace 1`] = ` = (props: Props) => { const spaceColor = getSpaceColor(space); + const spaceInitials = getSpaceInitials(space); + + const spaceImageUrl = getSpaceImageUrl(space); + + const avatarConfig: Partial = spaceImageUrl + ? { imageUrl: spaceImageUrl } + : { initials: spaceInitials, initialsLength: MAX_SPACE_INITIALS }; + return ( = (props: Props) => { 'aria-hidden': true, })} size={size || 'm'} - initialsLength={MAX_SPACE_INITIALS} - initials={getSpaceInitials(space)} color={isValidHex(spaceColor) ? spaceColor : ''} - imageUrl={getSpaceImageUrl(space)} + {...avatarConfig} {...rest} /> ); diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/__snapshots__/location_status_tags.test.tsx.snap b/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/__snapshots__/location_status_tags.test.tsx.snap index 8e2a4b1bd1777..44a2021cce611 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/__snapshots__/location_status_tags.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/__snapshots__/location_status_tags.test.tsx.snap @@ -996,7 +996,7 @@ exports[`LocationStatusTags component renders when there are many location 1`] = aria-controls="generated-id" aria-current="true" aria-label="Page 1 of 2" - class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--xSmall euiButtonEmpty-isDisabled euiPaginationButton euiPaginationButton-isActive euiPaginationButton--hideOnMobile" + class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--small euiButtonEmpty-isDisabled euiPaginationButton euiPaginationButton-isActive euiPaginationButton--hideOnMobile" data-test-subj="pagination-button-0" disabled="" type="button" @@ -1018,7 +1018,7 @@ exports[`LocationStatusTags component renders when there are many location 1`] =