diff --git a/package.json b/package.json index 71a66d837f71..4824bcbb9107 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^7.16.0-canary.2", "@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", diff --git a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap index 4ef5eb8f56d2..54e223cdc5d4 100644 --- a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap +++ b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap @@ -57,7 +57,7 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiColumnSelector.searchcolumns": "Search columns", "euiColumnSelector.selectAll": "Show all", "euiColumnSorting.button": "Sort fields", - "euiColumnSorting.buttonActive": "fields sorted", + "euiColumnSorting.buttonActive": [Function], "euiColumnSorting.clearAll": "Clear sorting", "euiColumnSorting.emptySorting": "Currently no fields are sorted", "euiColumnSorting.pickFields": "Pick fields to sort by", @@ -104,9 +104,11 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiFieldPassword.maskPassword": "Mask password", "euiFieldPassword.showPassword": "Show password as plain text. Note: this will visually expose your password on the screen.", "euiFilePicker.clearSelectedFiles": "Clear selected files", - "euiFilePicker.filesSelected": "files selected", + "euiFilePicker.filesSelected": [Function], + "euiFilePicker.promptText": "Select or drag and drop a file", "euiFilePicker.removeSelected": "Remove", - "euiFilterButton.filterBadge": [Function], + "euiFilterButton.filterBadgeActiveAriaLabel": [Function], + "euiFilterButton.filterBadgeAvailableAriaLabel": [Function], "euiFlyout.closeAriaLabel": "Close this dialog", "euiForm.addressFormErrors": "Please address the highlighted errors.", "euiFormControlLayoutClearButton.label": "Clear input", diff --git a/src/core/public/i18n/i18n_eui_mapping.test.ts b/src/core/public/i18n/i18n_eui_mapping.test.ts index 1b80257266d4..d8d48a8e5f1d 100644 --- a/src/core/public/i18n/i18n_eui_mapping.test.ts +++ b/src/core/public/i18n/i18n_eui_mapping.test.ts @@ -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 diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 133a2155f743..4175dac712e8 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -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', + values: { numberOfSortedFields }, + }), 'euiColumnSortingDraggable.activeSortLabel': ({ display }: EuiValues) => i18n.translate('core.euiColumnSortingDraggable.activeSortLabel', { defaultMessage: '{display} is sorting this data grid', @@ -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', diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index cb7e3781e251..ee355d6a9811 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -75,7 +75,7 @@ export const LICENSE_OVERRIDES = { '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint 'node-sql-parser@3.6.1': ['(GPL-2.0 OR MIT)'], // GPL-2.0* https://github.com/taozhi8833998/node-sql-parser '@elastic/ems-client@7.15.0': ['Elastic License 2.0'], - '@elastic/eui@37.3.0': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@37.3.1': ['SSPL-1.0 OR Elastic License 2.0'], // TODO can be removed if the https://github.com/jindw/xmldom/issues/239 is released 'xmldom@0.1.27': ['MIT'], diff --git a/src/plugins/advanced_settings/public/management_app/components/field/__snapshots__/field.test.tsx.snap b/src/plugins/advanced_settings/public/management_app/components/field/__snapshots__/field.test.tsx.snap index be5163e89367..9249f5f98e9c 100644 --- a/src/plugins/advanced_settings/public/management_app/components/field/__snapshots__/field.test.tsx.snap +++ b/src/plugins/advanced_settings/public/management_app/components/field/__snapshots__/field.test.tsx.snap @@ -1326,7 +1326,12 @@ exports[`Field for image setting should render as read only if saving is disable disabled={true} display="large" fullWidth={true} - initialPromptText="Select or drag and drop a file" + initialPromptText={ + + } onChange={[Function]} /> @@ -1472,7 +1477,12 @@ exports[`Field for image setting should render custom setting icon if it is cust disabled={false} display="large" fullWidth={true} - initialPromptText="Select or drag and drop a file" + initialPromptText={ + + } onChange={[Function]} /> @@ -1526,7 +1536,12 @@ exports[`Field for image setting should render default value if there is no user disabled={false} display="large" fullWidth={true} - initialPromptText="Select or drag and drop a file" + initialPromptText={ + + } onChange={[Function]} /> @@ -1597,7 +1612,12 @@ exports[`Field for image setting should render unsaved value if there are unsave disabled={false} display="large" fullWidth={true} - initialPromptText="Select or drag and drop a file" + initialPromptText={ + + } onChange={[Function]} /> diff --git a/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap b/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap index 612ffdcf5029..9cd0687a1074 100644 --- a/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap +++ b/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap @@ -1403,7 +1403,7 @@ exports[`Inspector Data View component should render single table without select >
" +
markdown mock
My Canvas Workpad
" `; exports[`Canvas Shareable Workpad API Placed successfully with height specified 1`] = `"
"`; @@ -21,7 +21,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with height specified
markdown mock
markdown mock
My Canvas Workpad
" +
markdown mock
My Canvas Workpad
" `; exports[`Canvas Shareable Workpad API Placed successfully with page specified 1`] = `"
"`; @@ -33,7 +33,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with page specified 2`
markdown mock
markdown mock
My Canvas Workpad
" +
markdown mock
My Canvas Workpad
" `; exports[`Canvas Shareable Workpad API Placed successfully with width and height specified 1`] = `"
"`; @@ -45,7 +45,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with width and height
markdown mock
markdown mock
My Canvas Workpad
" +
markdown mock
My Canvas Workpad
" `; exports[`Canvas Shareable Workpad API Placed successfully with width specified 1`] = `"
"`; @@ -57,5 +57,5 @@ exports[`Canvas Shareable Workpad API Placed successfully with width specified 2
markdown mock
markdown mock
My Canvas Workpad
" +
markdown mock
My Canvas Workpad
" `; diff --git a/x-pack/plugins/canvas/shareable_runtime/components/__stories__/__snapshots__/canvas.stories.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/__stories__/__snapshots__/canvas.stories.storyshot index c5b6d768c89d..a5eefde19237 100644 --- a/x-pack/plugins/canvas/shareable_runtime/components/__stories__/__snapshots__/canvas.stories.storyshot +++ b/x-pack/plugins/canvas/shareable_runtime/components/__stories__/__snapshots__/canvas.stories.storyshot @@ -1375,7 +1375,7 @@ exports[`Storyshots shareables/Canvas component 1`] = ` >