Skip to content

Commit

Permalink
[8.x] Upgrade EUI to v97.0.0 (#195525) (#196116)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.x`:
- [Upgrade EUI to v97.0.0
(#195525)](#195525)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Cee
Chen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-14T11:35:35Z","message":"Upgrade
EUI to v97.0.0 (#195525)\n\n`v96.1.0`⏩`v97.0.0`\r\n\r\n_[Questions?
Please see our Kibana
upgrade\r\nFAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_\r\n\r\n---\r\n\r\n##
[`v97.0.0`](https://github.com/elastic/eui/releases/v97.0.0)\r\n\r\n**Breaking
changes**\r\n\r\n- EuiDataGrid's custom grid body (rendered via
`renderCustomGridBody`)\r\nno longer automatically renders the column
header row or footer rows. It\r\ninstead now passes the `headerRow` and
`footerRow` React elements, which\r\nrequire manual
rendering.\r\n([#8028](https://github.com/elastic/eui/pull/8028))\r\n-
This change was made to allow consumers to sync header/footer
rows\r\nwith their own custom virtualization libraries.\r\n- To
facilitate this, a `gridWidth` prop is now also passed to custom\r\ngrid
body renderers.\r\n\r\n**Bug fixes**\r\n\r\n- Fixed inputs not taking
the whole width when passing `fullWidth` as\r\n`true` to
EuiDatePickerRange
component\r\n([#8061](https://github.com/elastic/eui/pull/8061))\r\n\r\n**Accessibility**\r\n\r\n-
Improved accessibility of `EuiExternalLinkIcon` by clarifying text
for\r\nScreen Reader users.
([#8065](https://github.com/elastic/eui/pull/8065))\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"cd60c66d19ffdb4130a5c2d1b76e80cfaf8cde78","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Embedding","release_note:skip","EUI","v9.0.0","ci:project-deploy-observability","Team:obs-ux-infra_services","Team:obs-ux-management","v8.16.0","backport:version"],"title":"Upgrade
EUI to
v97.0.0","number":195525,"url":"https://github.com/elastic/kibana/pull/195525","mergeCommit":{"message":"Upgrade
EUI to v97.0.0 (#195525)\n\n`v96.1.0`⏩`v97.0.0`\r\n\r\n_[Questions?
Please see our Kibana
upgrade\r\nFAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_\r\n\r\n---\r\n\r\n##
[`v97.0.0`](https://github.com/elastic/eui/releases/v97.0.0)\r\n\r\n**Breaking
changes**\r\n\r\n- EuiDataGrid's custom grid body (rendered via
`renderCustomGridBody`)\r\nno longer automatically renders the column
header row or footer rows. It\r\ninstead now passes the `headerRow` and
`footerRow` React elements, which\r\nrequire manual
rendering.\r\n([#8028](https://github.com/elastic/eui/pull/8028))\r\n-
This change was made to allow consumers to sync header/footer
rows\r\nwith their own custom virtualization libraries.\r\n- To
facilitate this, a `gridWidth` prop is now also passed to custom\r\ngrid
body renderers.\r\n\r\n**Bug fixes**\r\n\r\n- Fixed inputs not taking
the whole width when passing `fullWidth` as\r\n`true` to
EuiDatePickerRange
component\r\n([#8061](https://github.com/elastic/eui/pull/8061))\r\n\r\n**Accessibility**\r\n\r\n-
Improved accessibility of `EuiExternalLinkIcon` by clarifying text
for\r\nScreen Reader users.
([#8065](https://github.com/elastic/eui/pull/8065))\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"cd60c66d19ffdb4130a5c2d1b76e80cfaf8cde78"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195525","number":195525,"mergeCommit":{"message":"Upgrade
EUI to v97.0.0 (#195525)\n\n`v96.1.0`⏩`v97.0.0`\r\n\r\n_[Questions?
Please see our Kibana
upgrade\r\nFAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_\r\n\r\n---\r\n\r\n##
[`v97.0.0`](https://github.com/elastic/eui/releases/v97.0.0)\r\n\r\n**Breaking
changes**\r\n\r\n- EuiDataGrid's custom grid body (rendered via
`renderCustomGridBody`)\r\nno longer automatically renders the column
header row or footer rows. It\r\ninstead now passes the `headerRow` and
`footerRow` React elements, which\r\nrequire manual
rendering.\r\n([#8028](https://github.com/elastic/eui/pull/8028))\r\n-
This change was made to allow consumers to sync header/footer
rows\r\nwith their own custom virtualization libraries.\r\n- To
facilitate this, a `gridWidth` prop is now also passed to custom\r\ngrid
body renderers.\r\n\r\n**Bug fixes**\r\n\r\n- Fixed inputs not taking
the whole width when passing `fullWidth` as\r\n`true` to
EuiDatePickerRange
component\r\n([#8061](https://github.com/elastic/eui/pull/8061))\r\n\r\n**Accessibility**\r\n\r\n-
Improved accessibility of `EuiExternalLinkIcon` by clarifying text
for\r\nScreen Reader users.
([#8065](https://github.com/elastic/eui/pull/8065))\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"cd60c66d19ffdb4130a5c2d1b76e80cfaf8cde78"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Cee Chen <[email protected]>
  • Loading branch information
kibanamachine and cee-chen authored Oct 14, 2024
1 parent 8a7579c commit 2d16d45
Show file tree
Hide file tree
Showing 54 changed files with 228 additions and 246 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"@elastic/ecs": "^8.11.1",
"@elastic/elasticsearch": "^8.15.0",
"@elastic/ems-client": "8.5.3",
"@elastic/eui": "96.1.0",
"@elastic/eui": "97.0.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 @@ -860,13 +860,16 @@ export const getEuiContextMapping = (): EuiTokensObject => {
'core.euiInlineEditForm.saveButtonAriaLabel',
{ defaultMessage: 'Save edit' }
),
'euiExternalLinkIcon.ariaLabel': i18n.translate('core.euiExternalLinkIcon.ariaLabel', {
defaultMessage: 'External link',
}),
'euiExternalLinkIcon.externalTarget.screenReaderOnlyText': i18n.translate(
'core.euiExternalLinkIcon.externalTarget.screenReaderOnlyText',
{
defaultMessage: '(external)',
}
),
'euiExternalLinkIcon.newTarget.screenReaderOnlyText': i18n.translate(
'core.euiExternalLinkIcon.newTarget.screenReaderOnlyText',
{
defaultMessage: '(opens in a new tab or window)',
defaultMessage: '(external, opens in a new tab or window)',
}
),
'euiLoadingStrings.ariaLabel': i18n.translate('core.euiLoadingStrings.ariaLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,4 @@ export const getPaths = <A>(validation: t.Validation<A>): string[] => {
/**
* Convenience utility to remove text appended to links by EUI
*/
export const removeExternalLinkText = (str: string) =>
str.replace(/\(opens in a new tab or window\)/g, '');
export const removeExternalLinkText = (str: string) => str.replace(/\(external[^)]*\)/g, '');
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('Unified data table cell rendering', function () {
/>
);
expect(component.html()).toMatchInlineSnapshot(
`"<div data-test-subj=\\"dataTableExpandCellActionPopover\\" class=\\"euiFlexGroup css-1h68cm-euiFlexGroup-none-flexStart-stretch-row\\"><div class=\\"euiFlexItem css-9sbomz-euiFlexItem-grow-1\\"><span class=\\"unifiedDataTable__cellPopoverValue eui-textBreakWord\\"><span>100</span></span></div><div class=\\"euiFlexItem css-kpsrin-euiFlexItem-growZero\\"><button class=\\"euiButtonIcon css-1gd56qr-euiButtonIcon-xs-empty-primary\\" type=\\"button\\" aria-label=\\"Close popover\\" data-test-subj=\\"docTableClosePopover\\"><span data-euiicon-type=\\"cross\\" class=\\"euiButtonIcon__icon\\" aria-hidden=\\"true\\" color=\\"inherit\\"></span></button></div></div>"`
`"<div data-test-subj=\\"dataTableExpandCellActionPopover\\" class=\\"euiFlexGroup css-1h68cm-euiFlexGroup-none-flexStart-stretch-row\\"><div class=\\"euiFlexItem css-9sbomz-euiFlexItem-grow-1\\"><span class=\\"unifiedDataTable__cellPopoverValue eui-textBreakWord\\"><span>100</span></span></div><div class=\\"euiFlexItem css-kpsrin-euiFlexItem-growZero\\"><button class=\\"euiButtonIcon css-w92548-euiButtonIcon-xs-empty-primary\\" type=\\"button\\" aria-label=\\"Close popover\\" data-test-subj=\\"docTableClosePopover\\"><span data-euiicon-type=\\"cross\\" class=\\"euiButtonIcon__icon\\" aria-hidden=\\"true\\" color=\\"inherit\\"></span></button></div></div>"`
);
});

Expand All @@ -184,7 +184,7 @@ describe('Unified data table cell rendering', function () {
/>
);
expect(component.html()).toMatchInlineSnapshot(
`"<div data-test-subj=\\"dataTableExpandCellActionPopover\\" class=\\"euiFlexGroup css-1h68cm-euiFlexGroup-none-flexStart-stretch-row\\"><div class=\\"euiFlexItem css-9sbomz-euiFlexItem-grow-1\\"><span class=\\"unifiedDataTable__cellPopoverValue eui-textBreakWord\\"><span>100</span></span></div><div class=\\"euiFlexItem css-kpsrin-euiFlexItem-growZero\\"><button class=\\"euiButtonIcon css-1gd56qr-euiButtonIcon-xs-empty-primary\\" type=\\"button\\" aria-label=\\"Close popover\\" data-test-subj=\\"docTableClosePopover\\"><span data-euiicon-type=\\"cross\\" class=\\"euiButtonIcon__icon\\" aria-hidden=\\"true\\" color=\\"inherit\\"></span></button></div></div>"`
`"<div data-test-subj=\\"dataTableExpandCellActionPopover\\" class=\\"euiFlexGroup css-1h68cm-euiFlexGroup-none-flexStart-stretch-row\\"><div class=\\"euiFlexItem css-9sbomz-euiFlexItem-grow-1\\"><span class=\\"unifiedDataTable__cellPopoverValue eui-textBreakWord\\"><span>100</span></span></div><div class=\\"euiFlexItem css-kpsrin-euiFlexItem-growZero\\"><button class=\\"euiButtonIcon css-w92548-euiButtonIcon-xs-empty-primary\\" type=\\"button\\" aria-label=\\"Close popover\\" data-test-subj=\\"docTableClosePopover\\"><span data-euiicon-type=\\"cross\\" class=\\"euiButtonIcon__icon\\" aria-hidden=\\"true\\" color=\\"inherit\\"></span></button></div></div>"`
);
findTestSubject(component, 'docTableClosePopover').simulate('click');
expect(closePopoverMockFn).toHaveBeenCalledTimes(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 @@ -87,7 +87,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@96.1.0': ['Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0'],
'@elastic/eui@97.0.0': ['Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.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

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 @@ -42,13 +42,12 @@ test('ErrorEmbeddable renders an embeddable with markdown message', async () =>
<span
class="emotion-EuiExternalLinkIcon"
data-euiicon-type="popout"
>
External link
</span>
role="presentation"
/>
<span
class="emotion-euiScreenReaderOnly"
>
(opens in a new tab or window)
(external, opens in a new tab or window)
</span>
</a>
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import React from 'react';

import { DEFAULT_DASHBOARD_DRILLDOWN_OPTIONS } from '@kbn/presentation-util-plugin/public';
import { createEvent, fireEvent, render, screen, within } from '@testing-library/react';
import { createEvent, fireEvent, render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

import { LINKS_VERTICAL_LAYOUT } from '../../../common/content_management';
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('Dashboard link component', () => {
expect(link).toHaveTextContent('Dashboard 1');

// does not render external link icon
const externalIcon = within(link).queryByText('External link');
const externalIcon = link.querySelector('[data-euiicon-type="popout"]');
expect(externalIcon).toBeNull();

// calls `navigate` on click
Expand Down Expand Up @@ -122,8 +122,8 @@ describe('Dashboard link component', () => {
const link = screen.getByTestId('dashboardLink--foo');
expect(link).toBeInTheDocument();
// external link icon is rendered
const externalIcon = within(link).getByText('External link');
expect(externalIcon?.getAttribute('data-euiicon-type')).toBe('popout');
const externalIcon = link.querySelector('[data-euiicon-type="popout"]');
expect(externalIcon).toBeInTheDocument();

// calls `window.open`
await userEvent.click(link);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import React from 'react';

import userEvent from '@testing-library/user-event';
import { createEvent, fireEvent, render, screen, within } from '@testing-library/react';
import { createEvent, fireEvent, render, screen } from '@testing-library/react';
import { LINKS_VERTICAL_LAYOUT } from '../../../common/content_management';
import { ExternalLinkComponent } from './external_link_component';
import { coreServices } from '../../services/kibana_services';
Expand Down Expand Up @@ -39,8 +39,8 @@ describe('external link component', () => {

const link = await screen.findByTestId('externalLink--foo');
expect(link).toBeInTheDocument();
const externalIcon = within(link).getByText('External link');
expect(externalIcon.getAttribute('data-euiicon-type')).toBe('popout');
const externalIcon = link.querySelector('[data-euiicon-type="popout"]');
expect(externalIcon).toBeInTheDocument();
await userEvent.click(link);
expect(window.open).toHaveBeenCalledWith('https://example.com', '_blank');
});
Expand All @@ -52,8 +52,8 @@ describe('external link component', () => {
};
render(<ExternalLinkComponent link={linkInfo} layout={LINKS_VERTICAL_LAYOUT} />);
const link = await screen.findByTestId('externalLink--foo');
const externalIcon = within(link).getByText('External link');
expect(externalIcon?.getAttribute('data-euiicon-type')).toBe('popout');
const externalIcon = link.querySelector('[data-euiicon-type="popout"]');
expect(externalIcon).toBeInTheDocument();
});

test('modified click does not trigger event.preventDefault', async () => {
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 @@ -26,7 +26,7 @@ describe('NotFoundErrors component', () => {
const callOut = mounted.find('EuiCallOut');
expect(callOut.render()).toMatchSnapshot();
expect(mounted.text()).toMatchInlineSnapshot(
`"There is a problem with this saved objectThe saved search associated with this object no longer exists.If you know what this error means, you can use the Saved objects APIsExternal link(opens in a new tab or window) to fix it — otherwise click the delete button above."`
`"There is a problem with this saved objectThe saved search associated with this object no longer exists.If you know what this error means, you can use the Saved objects APIs(external, opens in a new tab or window) to fix it — otherwise click the delete button above."`
);
});

Expand All @@ -35,7 +35,7 @@ describe('NotFoundErrors component', () => {
const callOut = mounted.find('EuiCallOut');
expect(callOut.render()).toMatchSnapshot();
expect(mounted.text()).toMatchInlineSnapshot(
`"There is a problem with this saved objectThe data view associated with this object no longer exists.If you know what this error means, you can use the Saved objects APIsExternal link(opens in a new tab or window) to fix it — otherwise click the delete button above."`
`"There is a problem with this saved objectThe data view associated with this object no longer exists.If you know what this error means, you can use the Saved objects APIs(external, opens in a new tab or window) to fix it — otherwise click the delete button above."`
);
});

Expand All @@ -44,7 +44,7 @@ describe('NotFoundErrors component', () => {
const callOut = mounted.find('EuiCallOut');
expect(callOut.render()).toMatchSnapshot();
expect(mounted.text()).toMatchInlineSnapshot(
`"There is a problem with this saved objectA field associated with this object no longer exists in the data view.If you know what this error means, you can use the Saved objects APIsExternal link(opens in a new tab or window) to fix it — otherwise click the delete button above."`
`"There is a problem with this saved objectA field associated with this object no longer exists in the data view.If you know what this error means, you can use the Saved objects APIs(external, opens in a new tab or window) to fix it — otherwise click the delete button above."`
);
});

Expand All @@ -53,7 +53,7 @@ describe('NotFoundErrors component', () => {
const callOut = mounted.find('EuiCallOut');
expect(callOut.render()).toMatchSnapshot();
expect(mounted.text()).toMatchInlineSnapshot(
`"There is a problem with this saved objectIf you know what this error means, you can use the Saved objects APIsExternal link(opens in a new tab or window) to fix it — otherwise click the delete button above."`
`"There is a problem with this saved objectIf you know what this error means, you can use the Saved objects APIs(external, opens in a new tab or window) to fix it — otherwise click the delete button above."`
);
});
});

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

Loading

0 comments on commit 2d16d45

Please sign in to comment.