Skip to content

Commit

Permalink
Upgrade EUI to v35.0.0 (#105127) (#105783)
Browse files Browse the repository at this point in the history
* Bump EUI to v35.0.0, update euiContextMapping to match latest i18n tokens

* Updated i18n_service jest snapshot

* Added license override for EUI

* Attempting to clean up some forced dependency resolutions

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
chandlerprall and kibanamachine authored Jul 15, 2021
1 parent 9ce1b84 commit 2f7d282
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 84 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@
"**/minimist": "^1.2.5",
"**/node-jose/node-forge": "^0.10.0",
"**/pdfkit/crypto-js": "4.0.0",
"**/prismjs": "1.24.0",
"**/react-syntax-highlighter": "^15.3.1",
"**/react-syntax-highlighter/**/highlight.js": "^10.4.1",
"**/refractor": "^3.3.1",
"**/request": "^2.88.2",
"**/trim": "1.0.1",
"**/typescript": "4.1.3",
Expand All @@ -100,7 +98,7 @@
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@7.14.0-canary.6",
"@elastic/ems-client": "7.14.0",
"@elastic/eui": "34.5.2",
"@elastic/eui": "35.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/maki": "6.3.0",
Expand Down
23 changes: 14 additions & 9 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.

104 changes: 61 additions & 43 deletions src/core/public/i18n/i18n_eui_mapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
import React from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiTokensObject } from '@elastic/eui';

interface EuiValues {
[key: string]: any;
}

export const getEuiContextMapping = () => {
const euiContextMapping = {
const euiContextMapping: EuiTokensObject = {
'euiAccordion.isLoading': i18n.translate('core.euiAccordion.isLoading', {
defaultMessage: 'Loading',
}),
Expand Down Expand Up @@ -143,12 +144,6 @@ export const getEuiContextMapping = () => {
'ARIA label and tooltip content describing a button that expands an actions menu',
}
),
'euiCollapsibleNav.closeButtonLabel': i18n.translate(
'core.euiCollapsibleNav.closeButtonLabel',
{
defaultMessage: 'close',
}
),
'euiColorPicker.screenReaderAnnouncement': i18n.translate(
'core.euiColorPicker.screenReaderAnnouncement',
{
Expand Down Expand Up @@ -235,6 +230,9 @@ export const getEuiContextMapping = () => {
'euiColumnActions.moveRight': i18n.translate('core.euiColumnActions.moveRight', {
defaultMessage: 'Move right',
}),
'euiColumnActions.hideColumn': i18n.translate('core.euiColumnActions.hideColumn', {
defaultMessage: 'Hide column',
}),
'euiColumnSelector.hideAll': i18n.translate('core.euiColumnSelector.hideAll', {
defaultMessage: 'Hide all',
}),
Expand Down Expand Up @@ -368,6 +366,22 @@ export const getEuiContextMapping = () => {
'euiCommonlyUsedTimeRanges.legend': i18n.translate('core.euiCommonlyUsedTimeRanges.legend', {
defaultMessage: 'Commonly used',
}),
'euiControlBar.screenReaderHeading': i18n.translate('core.euiControlBar.screenReaderHeading', {
defaultMessage: 'Page level controls',
}),
'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 },
}),
'euiControlBar.screenReaderAnnouncement': i18n.translate(
'core.euiControlBar.screenReaderAnnouncement',
{
defaultMessage:
'There is a new region landmark with page level controls at the end of the document.',
}
),
'euiDataGrid.screenReaderNotice': i18n.translate('core.euiDataGrid.screenReaderNotice', {
defaultMessage: 'Cell contains interactive content.',
}),
Expand Down Expand Up @@ -500,6 +514,9 @@ export const getEuiContextMapping = () => {
'euiFilePicker.filesSelected': i18n.translate('core.euiFilePicker.filesSelected', {
defaultMessage: 'files selected',
}),
'euiFilePicker.removeSelected': i18n.translate('core.euiFilePicker.removeSelected', {
defaultMessage: 'Remove',
}),
'euiFilterButton.filterBadge': ({ count, hasActiveFilters }: EuiValues) =>
i18n.translate('core.euiFilterButton.filterBadge', {
defaultMessage: '${count} ${filterCountLabel} filters',
Expand All @@ -518,10 +535,6 @@ export const getEuiContextMapping = () => {
description: 'ARIA label on a button that removes any entry in a form field',
}
),
'euiHeaderAlert.dismiss': i18n.translate('core.euiHeaderAlert.dismiss', {
defaultMessage: 'Dismiss',
description: 'ARIA label on a button that dismisses/removes a notification',
}),
'euiHeaderLinks.appNavigation': i18n.translate('core.euiHeaderLinks.appNavigation', {
defaultMessage: 'App menu',
description: 'ARIA label on a `nav` element',
Expand Down Expand Up @@ -669,6 +682,25 @@ export const getEuiContextMapping = () => {
defaultMessage: 'Mark as unread',
}
),
'euiNotificationEventReadIcon.readAria': ({ eventName }: EuiValues) =>
i18n.translate('core.euiNotificationEventReadIcon.readAria', {
defaultMessage: '{eventName} is read',
values: { eventName },
}),
'euiNotificationEventReadIcon.unreadAria': ({ eventName }: EuiValues) =>
i18n.translate('core.euiNotificationEventReadIcon.unreadAria', {
defaultMessage: '{eventName} is unread',
values: { eventName },
}),
'euiNotificationEventReadIcon.read': i18n.translate('core.euiNotificationEventReadIcon.read', {
defaultMessage: 'Read',
}),
'euiNotificationEventReadIcon.unread': i18n.translate(
'core.euiNotificationEventReadIcon.unread',
{
defaultMessage: 'Unread',
}
),
'euiNotificationEventMessages.accordionHideText': i18n.translate(
'core.euiNotificationEventMessages.accordionHideText',
{
Expand All @@ -680,6 +712,11 @@ export const getEuiContextMapping = () => {
defaultMessage: 'Next page, {page}',
values: { page },
}),
'euiPagination.pageOfTotalCompressed': ({ page, total }: EuiValues) =>
i18n.translate('core.euiPagination.pageOfTotalCompressed', {
defaultMessage: '{page} of {total}',
values: { page, total },
}),
'euiPagination.previousPage': ({ page }: EuiValues) =>
i18n.translate('core.euiPagination.previousPage', {
defaultMessage: 'Previous page, {page}',
Expand Down Expand Up @@ -1043,29 +1080,10 @@ export const getEuiContextMapping = () => {
description: 'Displayed in a button that updates based on date picked',
}
),
'euiTableHeaderCell.clickForAscending': i18n.translate(
'core.euiTableHeaderCell.clickForAscending',
{
defaultMessage: 'Click to sort in ascending order',
description: 'Displayed in a button that toggles a table sorting',
}
),
'euiTableHeaderCell.clickForDescending': i18n.translate(
'core.euiTableHeaderCell.clickForDescending',
{
defaultMessage: 'Click to sort in descending order',
description: 'Displayed in a button that toggles a table sorting',
}
),
'euiTableHeaderCell.clickForUnsort': i18n.translate('core.euiTableHeaderCell.clickForUnsort', {
defaultMessage: 'Click to unsort',
description: 'Displayed in a button that toggles a table sorting',
}),
'euiTableHeaderCell.titleTextWithSort': ({ innerText, ariaSortValue }: EuiValues) =>
i18n.translate('core.euiTableHeaderCell.titleTextWithSort', {
defaultMessage: '{innerText}; Sorted in {ariaSortValue} order',
values: { innerText, ariaSortValue },
description: 'Text describing the table sort order',
'euiTableHeaderCell.titleTextWithDesc': ({ innerText, description }: EuiValues) =>
i18n.translate('core.euiTableHeaderCell.titleTextWithDesc', {
defaultMessage: '{innerText}; {description}',
values: { innerText, description },
}),
'euiTablePagination.rowsPerPage': i18n.translate('core.euiTablePagination.rowsPerPage', {
defaultMessage: 'Rows per page',
Expand All @@ -1091,15 +1109,6 @@ export const getEuiContextMapping = () => {
defaultMessage: 'Notification',
description: 'ARIA label on an element containing a notification',
}),
'euiTour.endTour': i18n.translate('core.euiTour.endTour', {
defaultMessage: 'End tour',
}),
'euiTour.skipTour': i18n.translate('core.euiTour.skipTour', {
defaultMessage: 'Skip tour',
}),
'euiTour.closeTour': i18n.translate('core.euiTour.closeTour', {
defaultMessage: 'Close tour',
}),
'euiTourStepIndicator.isActive': i18n.translate('core.euiTourStepIndicator.isActive', {
defaultMessage: 'active',
description: 'Text for an active tour step',
Expand All @@ -1112,6 +1121,15 @@ export const getEuiContextMapping = () => {
defaultMessage: 'incomplete',
description: 'Text for an incomplete tour step',
}),
'euiTourStep.endTour': i18n.translate('core.euiTourStep.endTour', {
defaultMessage: 'End tour',
}),
'euiTourStep.skipTour': i18n.translate('core.euiTourStep.skipTour', {
defaultMessage: 'Skip tour',
}),
'euiTourStep.closeTour': i18n.translate('core.euiTourStep.closeTour', {
defaultMessage: 'Close tour',
}),
'euiTourStepIndicator.ariaLabel': ({ status, number }: EuiValues) =>
i18n.translate('core.euiTourStepIndicator.ariaLabel', {
defaultMessage: 'Step {number} {status}',
Expand Down
1 change: 1 addition & 0 deletions src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const LICENSE_OVERRIDES = {
'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts
'@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'@elastic/ems-client@7.14.0': ['Elastic License 2.0'],
'@elastic/eui@35.0.0': ['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'],
Expand Down
9 changes: 0 additions & 9 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@
"core.euiCodeEditor.stopEditing": "完了したら Esc キーで編集を終了します。",
"core.euiCodeEditor.stopInteracting": "完了したら Esc キーでコードの操作を終了します。",
"core.euiCollapsedItemActions.allActions": "すべてのアクション",
"core.euiCollapsibleNav.closeButtonLabel": "閉じる",
"core.euiColorPicker.alphaLabel": "アルファチャネル (不透明) 値",
"core.euiColorPicker.closeLabel": "下矢印キーを押すと、色オプションを含むポップオーバーが開きます",
"core.euiColorPicker.colorErrorMessage": "無効な色値",
Expand Down Expand Up @@ -337,7 +336,6 @@
"core.euiFlyout.closeAriaLabel": "このダイアログを閉じる",
"core.euiForm.addressFormErrors": "ハイライトされたエラーを修正してください。",
"core.euiFormControlLayoutClearButton.label": "インプットを消去",
"core.euiHeaderAlert.dismiss": "閉じる",
"core.euiHeaderLinks.appNavigation": "アプリメニュー",
"core.euiHeaderLinks.openNavigationMenu": "メニューを開く",
"core.euiHue.label": "HSV カラーモードの「色相」値を選択",
Expand Down Expand Up @@ -444,19 +442,12 @@
"core.euiSuperUpdateButton.refreshButtonLabel": "更新",
"core.euiSuperUpdateButton.updateButtonLabel": "更新",
"core.euiSuperUpdateButton.updatingButtonLabel": "更新中",
"core.euiTableHeaderCell.clickForAscending": "クリックすると、昇順で並べ替えます",
"core.euiTableHeaderCell.clickForDescending": "クリックすると、降順で並べ替えます",
"core.euiTableHeaderCell.clickForUnsort": "クリックすると、並べ替えを解除します",
"core.euiTableHeaderCell.titleTextWithSort": "{innerText}; {ariaSortValue}順に表示",
"core.euiTablePagination.rowsPerPage": "ページごとの行数",
"core.euiTablePagination.rowsPerPageOption": "{rowsPerPage} 行",
"core.euiTableSortMobile.sorting": "並べ替え",
"core.euiToast.dismissToast": "トーストを閉じる",
"core.euiToast.newNotification": "新しい通知が表示されます",
"core.euiToast.notification": "通知",
"core.euiTour.closeTour": "ツアーを閉じる",
"core.euiTour.endTour": "ツアーを終了",
"core.euiTour.skipTour": "ツアーをスキップ",
"core.euiTourStepIndicator.ariaLabel": "ステップ{number} {status}",
"core.euiTourStepIndicator.isActive": "アクティブ",
"core.euiTourStepIndicator.isComplete": "完了",
Expand Down
9 changes: 0 additions & 9 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@
"core.euiCodeEditor.stopEditing": "完成后,按 Esc 键停止编辑。",
"core.euiCodeEditor.stopInteracting": "完成后,按 Esc 键停止与代码互动。",
"core.euiCollapsedItemActions.allActions": "所有操作",
"core.euiCollapsibleNav.closeButtonLabel": "关闭",
"core.euiColorPicker.alphaLabel": "Alpha 通道 (不透明度) 值",
"core.euiColorPicker.closeLabel": "按向下箭头键可打开包含颜色选项的弹出框",
"core.euiColorPicker.colorErrorMessage": "颜色值无效",
Expand Down Expand Up @@ -340,7 +339,6 @@
"core.euiFlyout.closeAriaLabel": "关闭此对话框",
"core.euiForm.addressFormErrors": "请解决突出显示的错误。",
"core.euiFormControlLayoutClearButton.label": "清除输入",
"core.euiHeaderAlert.dismiss": "关闭",
"core.euiHeaderLinks.appNavigation": "应用菜单",
"core.euiHeaderLinks.openNavigationMenu": "打开菜单",
"core.euiHue.label": "选择 HSV 颜色模式“色调”值",
Expand Down Expand Up @@ -447,19 +445,12 @@
"core.euiSuperUpdateButton.refreshButtonLabel": "刷新",
"core.euiSuperUpdateButton.updateButtonLabel": "更新",
"core.euiSuperUpdateButton.updatingButtonLabel": "正在更新",
"core.euiTableHeaderCell.clickForAscending": "单击升序排序",
"core.euiTableHeaderCell.clickForDescending": "单击降序排序",
"core.euiTableHeaderCell.clickForUnsort": "单击取消排序",
"core.euiTableHeaderCell.titleTextWithSort": "{innerText};已按 {ariaSortValue} 顺序排序",
"core.euiTablePagination.rowsPerPage": "每页行数",
"core.euiTablePagination.rowsPerPageOption": "{rowsPerPage} 行",
"core.euiTableSortMobile.sorting": "排序",
"core.euiToast.dismissToast": "关闭 Toast",
"core.euiToast.newNotification": "新通知出现",
"core.euiToast.notification": "通知",
"core.euiTour.closeTour": "关闭教程",
"core.euiTour.endTour": "结束教程",
"core.euiTour.skipTour": "跳过教程",
"core.euiTourStepIndicator.ariaLabel": "第 {number} 步{status}",
"core.euiTourStepIndicator.isActive": "活动",
"core.euiTourStepIndicator.isComplete": "已完成",
Expand Down
Loading

0 comments on commit 2f7d282

Please sign in to comment.