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 v37.3.1 #109926

Merged
merged 11 commits into from
Sep 1, 2021
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.19",
"@elastic/ems-client": "7.15.0",
"@elastic/eui": "37.3.0",
"@elastic/eui": "37.3.1",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/maki": "6.3.0",
Expand Down
8 changes: 5 additions & 3 deletions src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap

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

5 changes: 5 additions & 0 deletions src/core/public/i18n/i18n_eui_mapping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ describe('@elastic/eui i18n tokens', () => {
});

test('defaultMessage is in sync with defString', () => {
// Certain complex tokens (e.g. ones that have a function as a defaultMessage)
// need custom i18n handling, and can't be checked for basic defString equality
const tokensToSkip = ['euiColumnSorting.buttonActive'];
if (tokensToSkip.includes(token)) return;

// Clean up typical errors from the `@elastic/eui` extraction token tool
const normalizedDefString = defString
// Quoted words should use double-quotes
Expand Down
30 changes: 21 additions & 9 deletions src/core/public/i18n/i18n_eui_mapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,11 @@ export const getEuiContextMapping = (): EuiTokensObject => {
'euiColumnSorting.button': i18n.translate('core.euiColumnSorting.button', {
defaultMessage: 'Sort fields',
}),
'euiColumnSorting.buttonActive': i18n.translate('core.euiColumnSorting.buttonActive', {
defaultMessage: 'fields sorted',
}),
'euiColumnSorting.buttonActive': ({ numberOfSortedFields }: EuiValues) =>
i18n.translate('core.euiColumnSorting.buttonActive', {
defaultMessage: '{numberOfSortedFields, plural, one {# field} other {# fields}} sorted',
cee-chen marked this conversation as resolved.
Show resolved Hide resolved
values: { numberOfSortedFields },
}),
'euiColumnSortingDraggable.activeSortLabel': ({ display }: EuiValues) =>
i18n.translate('core.euiColumnSortingDraggable.activeSortLabel', {
defaultMessage: '{display} is sorting this data grid',
Expand Down Expand Up @@ -514,16 +516,26 @@ export const getEuiContextMapping = (): EuiTokensObject => {
'euiFilePicker.clearSelectedFiles': i18n.translate('core.euiFilePicker.clearSelectedFiles', {
defaultMessage: 'Clear selected files',
}),
'euiFilePicker.filesSelected': i18n.translate('core.euiFilePicker.filesSelected', {
defaultMessage: 'files selected',
'euiFilePicker.filesSelected': ({ fileCount }: EuiValues) =>
i18n.translate('core.euiFilePicker.filesSelected', {
defaultMessage: '{fileCount} files selected',
values: { fileCount },
}),
'euiFilePicker.promptText': i18n.translate('core.euiFilePicker.promptText', {
defaultMessage: 'Select or drag and drop a file',
}),
'euiFilePicker.removeSelected': i18n.translate('core.euiFilePicker.removeSelected', {
defaultMessage: 'Remove',
}),
'euiFilterButton.filterBadge': ({ count, hasActiveFilters }: EuiValues) =>
i18n.translate('core.euiFilterButton.filterBadge', {
defaultMessage: '{count} {hasActiveFilters} filters',
values: { count, hasActiveFilters: hasActiveFilters ? 'active' : 'available' },
'euiFilterButton.filterBadgeActiveAriaLabel': ({ count }: EuiValues) =>
i18n.translate('core.euiFilterButton.filterBadgeActiveAriaLabel', {
defaultMessage: '{count} active filters',
values: { count },
}),
'euiFilterButton.filterBadgeAvailableAriaLabel': ({ count }: EuiValues) =>
i18n.translate('core.euiFilterButton.filterBadgeAvailableAriaLabel', {
defaultMessage: '{count} available filters',
values: { count },
}),
'euiFlyout.closeAriaLabel': i18n.translate('core.euiFlyout.closeAriaLabel', {
defaultMessage: 'Close this dialog',
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 @@ -75,7 +75,7 @@ export const LICENSE_OVERRIDES = {
'@mapbox/[email protected]': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'[email protected]': ['(GPL-2.0 OR MIT)'], // GPL-2.0* https://github.com/taozhi8833998/node-sql-parser
'@elastic/[email protected]': ['Elastic License 2.0'],
'@elastic/[email protected].0': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/[email protected].1': ['SSPL-1.0 OR Elastic License 2.0'],

// TODO can be removed if the https://github.com/jindw/xmldom/issues/239 is released
'[email protected]': ['MIT'],
Expand Down

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

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

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

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

Loading