From 3d27ddeef6fdcde637ad89886822133f98138825 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 9 Dec 2021 09:08:35 -0600 Subject: [PATCH 01/32] eui to v43.0.0 --- package.json | 2 +- .../elastic-eslint-config-kibana/.eslintrc.js | 2 - .../kbn-ui-shared-deps-npm/webpack.config.js | 8 +- packages/kbn-ui-shared-deps-src/src/theme.ts | 4 +- .../core_app/styles/_globals_v8dark.scss | 4 +- .../core_app/styles/_globals_v8light.scss | 4 +- src/core/public/i18n/i18n_eui_mapping.tsx | 142 +++++++++++------- src/dev/license_checker/config.ts | 2 +- .../components/discover_grid/constants.ts | 2 +- .../public/components/table_vis_basic.tsx | 2 +- .../components/data_grid/common.ts | 2 +- .../evaluate_panel.tsx | 2 +- .../osquery/public/results/results_table.tsx | 2 +- .../public/components/t_grid/body/index.tsx | 2 +- .../translations/translations/ja-JP.json | 13 -- .../translations/translations/zh-CN.json | 13 -- yarn.lock | 35 +++-- 17 files changed, 125 insertions(+), 116 deletions(-) diff --git a/package.json b/package.json index db3a7f5878541..d04ce832c7273 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.35", "@elastic/ems-client": "8.0.0", - "@elastic/eui": "41.2.3", + "@elastic/eui": "43.0.0", "@elastic/filesaver": "1.1.2", "@elastic/node-crypto": "1.2.1", "@elastic/numeral": "^2.5.1", diff --git a/packages/elastic-eslint-config-kibana/.eslintrc.js b/packages/elastic-eslint-config-kibana/.eslintrc.js index dc95601fadd1a..fe6ea54bbde05 100644 --- a/packages/elastic-eslint-config-kibana/.eslintrc.js +++ b/packages/elastic-eslint-config-kibana/.eslintrc.js @@ -91,8 +91,6 @@ module.exports = { ...[ '@elastic/eui/dist/eui_theme_light.json', '@elastic/eui/dist/eui_theme_dark.json', - '@elastic/eui/dist/eui_theme_amsterdam_light.json', - '@elastic/eui/dist/eui_theme_amsterdam_dark.json', ].map(from => ({ from, to: false, diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index 197ec5e63ad7c..5b030a91e396e 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -70,8 +70,8 @@ module.exports = (_, argv) => { '@elastic/eui/dist/eui_charts_theme', '@elastic/eui/lib/services', '@elastic/eui/lib/services/format', - '@elastic/eui/dist/eui_theme_amsterdam_light.json', - '@elastic/eui/dist/eui_theme_amsterdam_dark.json', + '@elastic/eui/dist/eui_theme_light.json', + '@elastic/eui/dist/eui_theme_dark.json', '@elastic/numeral', '@emotion/react', 'classnames', @@ -96,8 +96,8 @@ module.exports = (_, argv) => { 'styled-components', 'tslib', ], - 'kbn-ui-shared-deps-npm.v8.dark': ['@elastic/eui/dist/eui_theme_amsterdam_dark.css'], - 'kbn-ui-shared-deps-npm.v8.light': ['@elastic/eui/dist/eui_theme_amsterdam_light.css'], + 'kbn-ui-shared-deps-npm.v8.dark': ['@elastic/eui/dist/eui_theme_dark.css'], + 'kbn-ui-shared-deps-npm.v8.light': ['@elastic/eui/dist/eui_theme_light.css'], }, context: __dirname, devtool: 'cheap-source-map', diff --git a/packages/kbn-ui-shared-deps-src/src/theme.ts b/packages/kbn-ui-shared-deps-src/src/theme.ts index 33b8a594bfa5d..8fde5c63a292a 100644 --- a/packages/kbn-ui-shared-deps-src/src/theme.ts +++ b/packages/kbn-ui-shared-deps-src/src/theme.ts @@ -7,9 +7,9 @@ */ /* eslint-disable-next-line @kbn/eslint/module_migration */ -import { default as v8Light } from '@elastic/eui/dist/eui_theme_amsterdam_light.json'; +import { default as v8Light } from '@elastic/eui/dist/eui_theme_light.json'; /* eslint-disable-next-line @kbn/eslint/module_migration */ -import { default as v8Dark } from '@elastic/eui/dist/eui_theme_amsterdam_dark.json'; +import { default as v8Dark } from '@elastic/eui/dist/eui_theme_dark.json'; const globals: any = typeof window === 'undefined' ? {} : window; diff --git a/src/core/public/core_app/styles/_globals_v8dark.scss b/src/core/public/core_app/styles/_globals_v8dark.scss index ce0eeea02eb3b..df9f1a7493473 100644 --- a/src/core/public/core_app/styles/_globals_v8dark.scss +++ b/src/core/public/core_app/styles/_globals_v8dark.scss @@ -2,8 +2,8 @@ // // prepended to all .scss imports (from JS, when v8dark theme selected) -@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_dark'; -@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals'; +@import '@elastic/eui/src/themes/amsterdam/colors_dark'; +@import '@elastic/eui/src/themes/amsterdam/globals'; @import './mixins'; diff --git a/src/core/public/core_app/styles/_globals_v8light.scss b/src/core/public/core_app/styles/_globals_v8light.scss index 1ec76902f6589..07312b9cf08bf 100644 --- a/src/core/public/core_app/styles/_globals_v8light.scss +++ b/src/core/public/core_app/styles/_globals_v8light.scss @@ -2,8 +2,8 @@ // // prepended to all .scss imports (from JS, when v8light theme selected) -@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_light'; -@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals'; +@import '@elastic/eui/src/themes/amsterdam/colors_light'; +@import '@elastic/eui/src/themes/amsterdam/globals'; @import './mixins'; diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index e3357d138e794..b4b8e905f9568 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -20,6 +20,17 @@ export const getEuiContextMapping = (): EuiTokensObject => { 'euiAccordion.isLoading': i18n.translate('core.euiAccordion.isLoading', { defaultMessage: 'Loading', }), + 'euiAutoRefresh.autoRefreshLabel': i18n.translate('core.euiAutoRefresh.autoRefreshLabel', { + defaultMessage: 'Auto refresh', + }), + 'euiAutoRefresh.buttonLabelOff': i18n.translate('core.euiAutoRefresh.buttonLabelOff', { + defaultMessage: 'Auto refresh is off', + }), + 'euiAutoRefresh.buttonLabelOn': ({ prettyInterval }: EuiValues) => + i18n.translate('core.euiAutoRefresh.buttonLabelOn', { + defaultMessage: 'Auto refresh is on and set to {prettyInterval}', + values: { prettyInterval }, + }), 'euiBasicTable.selectAllRows': i18n.translate('core.euiBasicTable.selectAllRows', { defaultMessage: 'Select all rows', description: 'ARIA and displayed label on a checkbox to select all table rows', @@ -495,6 +506,42 @@ export const getEuiContextMapping = (): EuiTokensObject => { defaultMessage: 'Update needed: {title}', values: { title }, }), + 'euiDisplaySelector.buttonText': i18n.translate('core.euiDisplaySelector.buttonText', { + defaultMessage: 'Display options', + }), + 'euiDisplaySelector.resetButtonText': i18n.translate( + 'core.euiDisplaySelector.resetButtonText', + { + defaultMessage: 'Reset to default', + } + ), + 'euiDisplaySelector.densityLabel': i18n.translate('core.euiDisplaySelector.densityLabel', { + defaultMessage: 'Density', + }), + 'euiDisplaySelector.labelCompact': i18n.translate('core.euiDisplaySelector.labelCompact', { + defaultMessage: 'Compact', + }), + 'euiDisplaySelector.labelNormal': i18n.translate('core.euiDisplaySelector.labelNormal', { + defaultMessage: 'Normal', + }), + 'euiDisplaySelector.labelExpanded': i18n.translate('core.euiDisplaySelector.labelExpanded', { + defaultMessage: 'Expanded', + }), + 'euiDisplaySelector.labelSingle': i18n.translate('core.euiDisplaySelector.labelSingle', { + defaultMessage: 'Single', + }), + 'euiDisplaySelector.labelAuto': i18n.translate('core.euiDisplaySelector.labelAuto', { + defaultMessage: 'Auto', + }), + 'euiDisplaySelector.labelCustom': i18n.translate('core.euiDisplaySelector.labelCustom', { + defaultMessage: 'Custom', + }), + 'euiDisplaySelector.rowHeightLabel': i18n.translate('core.euiDisplaySelector.rowHeightLabel', { + defaultMessage: 'Row height', + }), + 'euiDisplaySelector.lineCountLabel': i18n.translate('core.euiDisplaySelector.lineCountLabel', { + defaultMessage: 'Lines per row', + }), 'euiFieldPassword.showPassword': i18n.translate('core.euiFieldPassword.showPassword', { defaultMessage: 'Show password as plain text. Note: this will visually expose your password on the screen.', @@ -708,11 +755,6 @@ export const getEuiContextMapping = (): EuiTokensObject => { defaultMessage: 'hide', } ), - 'euiPagination.nextPage': ({ page }: EuiValues) => - i18n.translate('core.euiPagination.nextPage', { - defaultMessage: 'Next page, {page}', - values: { page }, - }), 'euiPagination.pageOfTotalCompressed': ({ page, total }: EuiValues) => ( { values={{ page, total }} /> ), - 'euiPagination.previousPage': ({ page }: EuiValues) => - i18n.translate('core.euiPagination.previousPage', { - defaultMessage: 'Previous page, {page}', - values: { page }, - }), - 'euiPagination.disabledPreviousPage': i18n.translate( - 'core.euiPagination.disabledPreviousPage', - { - defaultMessage: 'Previous page', - } - ), - 'euiPagination.disabledNextPage': i18n.translate('core.euiPagination.disabledNextPage', { - defaultMessage: 'Next page', - }), 'euiPagination.firstRangeAriaLabel': ({ lastPage }: EuiValues) => i18n.translate('core.euiPagination.firstRangeAriaLabel', { defaultMessage: 'Skipping pages 2 to {lastPage}', @@ -744,6 +772,21 @@ export const getEuiContextMapping = (): EuiTokensObject => { defaultMessage: 'Skipping pages {firstPage} to {lastPage}', values: { firstPage, lastPage }, }), + 'euiPagination.last': i18n.translate('core.euiPagination.last', { + defaultMessage: 'Last', + }), + 'euiPagination.page': i18n.translate('core.euiPagination.page', { + defaultMessage: 'Page', + }), + 'euiPagination.of': i18n.translate('core.euiPagination.of', { + defaultMessage: 'of', + }), + 'euiPagination.collection': i18n.translate('core.euiPagination.collection', { + defaultMessage: 'collection', + }), + 'euiPagination.fromEndLabel': i18n.translate('core.euiPagination.fromEndLabel', { + defaultMessage: 'from end', + }), 'euiPaginationButton.longPageString': ({ page, totalPages }: EuiValues) => i18n.translate('core.euiPaginationButton.longPageString', { defaultMessage: 'Page {page} of {totalPages}', @@ -756,6 +799,24 @@ export const getEuiContextMapping = (): EuiTokensObject => { values: { page }, description: 'Text to describe the current page of a paginated section', }), + 'euiPaginationButtonArrow.nextPage': i18n.translate('core.euiPaginationButtonArrow.nextPage', { + defaultMessage: 'Next page', + }), + 'euiPaginationButtonArrow.previousPage': i18n.translate( + 'core.euiPaginationButtonArrow.previousPage', + { + defaultMessage: 'Previous page', + } + ), + 'euiPaginationButtonArrow.firstPage': i18n.translate( + 'core.euiPaginationButtonArrow.firstPage', + { + defaultMessage: 'First page', + } + ), + 'euiPaginationButtonArrow.lastPage': i18n.translate('core.euiPaginationButtonArrow.lastPage', { + defaultMessage: 'Last page', + }), 'euiPinnableListGroup.pinExtraActionLabel': i18n.translate( 'core.euiPinnableListGroup.pinExtraActionLabel', { @@ -811,20 +872,19 @@ export const getEuiContextMapping = (): EuiTokensObject => { 'euiRecentlyUsed.legend': i18n.translate('core.euiRecentlyUsed.legend', { defaultMessage: 'Recently used date ranges', }), - 'euiRefreshInterval.fullDescription': ({ optionValue, optionText }: EuiValues) => - i18n.translate('core.euiRefreshInterval.fullDescription', { - defaultMessage: 'Refresh interval currently set to {optionValue} {optionText}.', - values: { optionValue, optionText }, - }), 'euiRefreshInterval.legend': i18n.translate('core.euiRefreshInterval.legend', { defaultMessage: 'Refresh every', }), - 'euiRefreshInterval.start': i18n.translate('core.euiRefreshInterval.start', { - defaultMessage: 'Start', - }), - 'euiRefreshInterval.stop': i18n.translate('core.euiRefreshInterval.stop', { - defaultMessage: 'Stop', - }), + 'euiRefreshInterval.fullDescriptionOff': ({ optionValue, optionText }: EuiValues) => + i18n.translate('core.euiRefreshInterval.fullDescriptionOff', { + defaultMessage: 'Refresh is off, interval set to {optionValue} {optionText}.', + values: { optionValue, optionText }, + }), + 'euiRefreshInterval.fullDescriptionOn': ({ optionValue, optionText }: EuiValues) => + i18n.translate('core.euiRefreshInterval.fullDescriptionOn', { + defaultMessage: 'Refresh is on, interval set to {optionValue} {optionText}.', + values: { optionValue, optionText }, + }), 'euiRelativeTab.fullDescription': ({ unit }: EuiValues) => i18n.translate('core.euiRelativeTab.fullDescription', { defaultMessage: 'The unit is changeable. Currently set to {unit}.', @@ -1028,28 +1088,6 @@ export const getEuiContextMapping = (): EuiTokensObject => { defaultMessage: 'Step {number} is loading', values: { number }, }), - 'euiStyleSelector.buttonText': i18n.translate('core.euiStyleSelector.buttonText', { - defaultMessage: 'Density', - }), - 'euiStyleSelector.buttonLegend': i18n.translate('core.euiStyleSelector.buttonLegend', { - defaultMessage: 'Select the display density for the data grid', - }), - 'euiStyleSelector.labelExpanded': i18n.translate('core.euiStyleSelector.labelExpanded', { - defaultMessage: 'Expanded density', - }), - 'euiStyleSelector.labelNormal': i18n.translate('core.euiStyleSelector.labelNormal', { - defaultMessage: 'Normal density', - }), - 'euiStyleSelector.labelCompact': i18n.translate('core.euiStyleSelector.labelCompact', { - defaultMessage: 'Compact density', - }), - 'euiSuperDatePicker.showDatesButtonLabel': i18n.translate( - 'core.euiSuperDatePicker.showDatesButtonLabel', - { - defaultMessage: 'Show dates', - description: 'Displayed in a button that shows date picker', - } - ), 'euiSuperSelect.screenReaderAnnouncement': i18n.translate( 'core.euiSuperSelect.screenReaderAnnouncement', { diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 9674694c0d655..a0f3ac3e855dc 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -76,6 +76,6 @@ 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@8.0.0': ['Elastic License 2.0'], - '@elastic/eui@41.2.3': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@43.0.0': ['SSPL-1.0 OR Elastic License 2.0'], 'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry }; diff --git a/src/plugins/discover/public/components/discover_grid/constants.ts b/src/plugins/discover/public/components/discover_grid/constants.ts index 1126c6cbbf279..80900c06d4932 100644 --- a/src/plugins/discover/public/components/discover_grid/constants.ts +++ b/src/plugins/discover/public/components/discover_grid/constants.ts @@ -23,7 +23,7 @@ export const toolbarVisibility = { allowHide: false, allowReorder: true, }, - showStyleSelector: false, + showDisplaySelector: false, }; export const defaultMonacoEditorWidth = 370; diff --git a/src/plugins/vis_types/table/public/components/table_vis_basic.tsx b/src/plugins/vis_types/table/public/components/table_vis_basic.tsx index 2476c17c58a4d..adfeb9f5f614c 100644 --- a/src/plugins/vis_types/table/public/components/table_vis_basic.tsx +++ b/src/plugins/vis_types/table/public/components/table_vis_basic.tsx @@ -136,7 +136,7 @@ export const TableVisBasic = memo( showColumnSelector: false, showFullScreenSelector: false, showSortSelector: false, - showStyleSelector: false, + showDisplaySelector: false, additionalControls: ( = ({ jobConfig, jobStatus, se inMemory={{ level: 'sorting' }} toolbarVisibility={{ showColumnSelector: true, - showStyleSelector: false, + showDisplaySelector: false, showFullScreenSelector: false, showSortSelector: false, }} diff --git a/x-pack/plugins/osquery/public/results/results_table.tsx b/x-pack/plugins/osquery/public/results/results_table.tsx index fe4f22563ab27..e72cbf1acf159 100644 --- a/x-pack/plugins/osquery/public/results/results_table.tsx +++ b/x-pack/plugins/osquery/public/results/results_table.tsx @@ -302,7 +302,7 @@ const ResultsTableComponent: React.FC = ({ const toolbarVisibility = useMemo( () => ({ - showStyleSelector: false, + showDisplaySelector: false, additionalControls: ( <> ( showSortSelector: true, showFullScreenSelector: true, }), - showStyleSelector: false, + showDisplaySelector: false, }), [ alertCountText, diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 7328f0fa3326b..93b5acf25eb93 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -417,13 +417,9 @@ "core.euiNotificationEventReadIcon.readAria": "{eventName}は既読です", "core.euiNotificationEventReadIcon.unread": "未読", "core.euiNotificationEventReadIcon.unreadAria": "{eventName}は未読です", - "core.euiPagination.disabledNextPage": "次のページ", - "core.euiPagination.disabledPreviousPage": "前のページ", "core.euiPagination.firstRangeAriaLabel": "ページ2を{lastPage}にスキップしています", "core.euiPagination.lastRangeAriaLabel": "ページ{firstPage}を{lastPage}にスキップしています", - "core.euiPagination.nextPage": "次のページ、{page}", "core.euiPagination.pageOfTotalCompressed": "{total}ページ中{page}ページ", - "core.euiPagination.previousPage": "前のページ、{page}", "core.euiPaginationButton.longPageString": "{page}/{totalPages}ページ", "core.euiPaginationButton.shortPageString": "{page}ページ", "core.euiPinnableListGroup.pinExtraActionLabel": "項目をピン留め", @@ -440,10 +436,7 @@ "core.euiQuickSelect.unitLabel": "時間単位", "core.euiQuickSelect.valueLabel": "時間値", "core.euiRecentlyUsed.legend": "最近使用した日付範囲", - "core.euiRefreshInterval.fullDescription": "現在{optionValue} {optionText}に設定されている間隔を更新します。", "core.euiRefreshInterval.legend": "以下の感覚ごとに更新", - "core.euiRefreshInterval.start": "開始", - "core.euiRefreshInterval.stop": "終了", "core.euiRelativeTab.dateInputError": "有効な範囲でなければなりません", "core.euiRelativeTab.fullDescription": "単位は変更可能です。現在 {unit} に設定されています。", "core.euiRelativeTab.numberInputError": "0以上でなければなりません", @@ -485,12 +478,6 @@ "core.euiStepStrings.simpleWarning": "ステップ{number}には警告があります", "core.euiStepStrings.step": "ステップ{number}: {title}", "core.euiStepStrings.warning": "ステップ{number}: {title}には警告があります", - "core.euiStyleSelector.buttonLegend": "データグリッドの表示密度を選択", - "core.euiStyleSelector.buttonText": "密度", - "core.euiStyleSelector.labelCompact": "コンパクト密度", - "core.euiStyleSelector.labelExpanded": "拡張密度", - "core.euiStyleSelector.labelNormal": "標準密度", - "core.euiSuperDatePicker.showDatesButtonLabel": "日付を表示", "core.euiSuperSelectControl.selectAnOption": "オプションの選択:{selectedValue} を選択済み", "core.euiSuperUpdateButton.cannotUpdateTooltip": "アップデートできません", "core.euiSuperUpdateButton.clickToApplyTooltip": "クリックして適用", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 0650fa8a260f0..ec52610bfb4a2 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -422,13 +422,9 @@ "core.euiNotificationEventReadIcon.readAria": "{eventName} 已读", "core.euiNotificationEventReadIcon.unread": "未读", "core.euiNotificationEventReadIcon.unreadAria": "{eventName} 未读", - "core.euiPagination.disabledNextPage": "下一页", - "core.euiPagination.disabledPreviousPage": "上一页", "core.euiPagination.firstRangeAriaLabel": "将跳过第 2 至 {lastPage} 页", "core.euiPagination.lastRangeAriaLabel": "将跳过第 {firstPage} 至 {lastPage} 页", - "core.euiPagination.nextPage": "下一页,{page}", "core.euiPagination.pageOfTotalCompressed": "{page} / {total}", - "core.euiPagination.previousPage": "上一页,{page}", "core.euiPaginationButton.longPageString": "第 {page} 页,共 {totalPages} 页", "core.euiPaginationButton.shortPageString": "第 {page} 页", "core.euiPinnableListGroup.pinExtraActionLabel": "固定项目", @@ -445,10 +441,7 @@ "core.euiQuickSelect.unitLabel": "时间单位", "core.euiQuickSelect.valueLabel": "时间值", "core.euiRecentlyUsed.legend": "最近使用的日期范围", - "core.euiRefreshInterval.fullDescription": "刷新时间间隔当前设置为 {optionValue} {optionText}。", "core.euiRefreshInterval.legend": "刷新频率", - "core.euiRefreshInterval.start": "启动", - "core.euiRefreshInterval.stop": "停止点", "core.euiRelativeTab.dateInputError": "必须为有效范围", "core.euiRelativeTab.fullDescription": "单位可更改。当前设置为 {unit}。", "core.euiRelativeTab.numberInputError": "必须 >= 0", @@ -490,12 +483,6 @@ "core.euiStepStrings.simpleWarning": "第 {number} 步有警告", "core.euiStepStrings.step": "第 {number} 步:{title}", "core.euiStepStrings.warning": "第 {number} 步:{title} 有警告", - "core.euiStyleSelector.buttonLegend": "选择数据网格的显示密度", - "core.euiStyleSelector.buttonText": "密度", - "core.euiStyleSelector.labelCompact": "紧凑密度", - "core.euiStyleSelector.labelExpanded": "扩展密度", - "core.euiStyleSelector.labelNormal": "正常密度", - "core.euiSuperDatePicker.showDatesButtonLabel": "显示日期", "core.euiSuperSelectControl.selectAnOption": "选择选项:{selectedValue} 已选", "core.euiSuperUpdateButton.cannotUpdateTooltip": "无法更新", "core.euiSuperUpdateButton.clickToApplyTooltip": "单击以应用", diff --git a/yarn.lock b/yarn.lock index cbba55f74ddd8..e2994d8012588 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1601,10 +1601,10 @@ resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314" integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ== -"@elastic/eui@41.2.3": - version "41.2.3" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-41.2.3.tgz#00f437bf197a809a7092524073174f413ce33f46" - integrity sha512-sBPn2O1nn8ZJZncUQf88jzxWtnXcx/X/CubvH8LS7H+GX94PQs1BWXKQtYBI21kUAevSiRdPeX66x3ywZpZliQ== +"@elastic/eui@43.0.0": + version "43.0.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-43.0.0.tgz#50718e995d308b2c6abb45fc8594d5895b616730" + integrity sha512-AOgJupnpDLNUBC/BCPryrrqSpBcxnKCfqlxh5B9z28m5/rr230GnqJMYKKhdVvjCIagtLdeJAjj/1suNT1/9jg== dependencies: "@types/chroma-js" "^2.0.0" "@types/lodash" "^4.14.160" @@ -1644,7 +1644,6 @@ url-parse "^1.5.3" uuid "^8.3.0" vfile "^4.2.0" - yargs "^17.2.1" "@elastic/filesaver@1.1.2": version "1.1.2" @@ -29893,19 +29892,6 @@ yargs@^17.0.1: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.2.1, yargs@~17.2.1: - version "17.2.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.2.1.tgz#e2c95b9796a0e1f7f3bf4427863b42e0418191ea" - integrity sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - yargs@^3.15.0: version "3.32.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" @@ -29938,6 +29924,19 @@ yargs@^7.1.0: y18n "^3.2.1" yargs-parser "5.0.0-security.0" +yargs@~17.2.1: + version "17.2.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.2.1.tgz#e2c95b9796a0e1f7f3bf4427863b42e0418191ea" + integrity sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" From ae5276ca6e0a162c6afb857d7a712bef63a3f6b1 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 9 Dec 2021 09:10:00 -0600 Subject: [PATCH 02/32] update themeprovider types --- src/core/public/theme/convert_core_theme.ts | 7 ++++--- .../public/theme/core_theme_provider.test.tsx | 3 ++- src/core/public/theme/core_theme_provider.tsx | 20 +++++++++++++++---- src/core/server/rendering/views/template.tsx | 3 +++ src/core/utils/index.ts | 1 + src/core/utils/meta.ts | 9 +++++++++ .../interactive_setup/public/theme/utils.ts | 8 ++++---- .../theme/kibana_theme_provider.test.tsx | 3 ++- .../kibana_react/public/theme/types.ts | 4 ++-- .../kibana_react/public/theme/utils.ts | 7 ++++--- .../public/util/to_mount_point.test.tsx | 3 ++- 11 files changed, 49 insertions(+), 19 deletions(-) create mode 100644 src/core/utils/meta.ts diff --git a/src/core/public/theme/convert_core_theme.ts b/src/core/public/theme/convert_core_theme.ts index 78acef40764b6..e0251de1d31be 100644 --- a/src/core/public/theme/convert_core_theme.ts +++ b/src/core/public/theme/convert_core_theme.ts @@ -6,12 +6,13 @@ * Side Public License, v 1. */ -import type { EuiThemeSystem, EuiThemeColorMode } from '@elastic/eui'; +import { COLOR_MODES_STANDARD } from '@elastic/eui'; +import type { EuiThemeSystem, EuiThemeColorModeStandard } from '@elastic/eui'; import type { CoreTheme } from './types'; /** @internal */ export interface EuiTheme { - colorMode: EuiThemeColorMode; + colorMode: EuiThemeColorModeStandard; euiThemeSystem?: EuiThemeSystem; } @@ -19,6 +20,6 @@ export interface EuiTheme { export const convertCoreTheme = (coreTheme: CoreTheme): EuiTheme => { const { darkMode } = coreTheme; return { - colorMode: darkMode ? 'DARK' : 'LIGHT', + colorMode: darkMode ? COLOR_MODES_STANDARD.dark : COLOR_MODES_STANDARD.light, }; }; diff --git a/src/core/public/theme/core_theme_provider.test.tsx b/src/core/public/theme/core_theme_provider.test.tsx index baa354f10f428..a0f0faf13b9da 100644 --- a/src/core/public/theme/core_theme_provider.test.tsx +++ b/src/core/public/theme/core_theme_provider.test.tsx @@ -11,12 +11,13 @@ import { act } from 'react-dom/test-utils'; import type { ReactWrapper } from 'enzyme'; import { of, BehaviorSubject } from 'rxjs'; import { useEuiTheme } from '@elastic/eui'; +import type { UseEuiTheme } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test/jest'; import { CoreThemeProvider } from './core_theme_provider'; import type { CoreTheme } from './types'; describe('CoreThemeProvider', () => { - let euiTheme: ReturnType | undefined; + let euiTheme: UseEuiTheme | undefined; beforeEach(() => { euiTheme = undefined; diff --git a/src/core/public/theme/core_theme_provider.tsx b/src/core/public/theme/core_theme_provider.tsx index 9f40cbd5393b8..e80ee8e56abd1 100644 --- a/src/core/public/theme/core_theme_provider.tsx +++ b/src/core/public/theme/core_theme_provider.tsx @@ -9,7 +9,9 @@ import React, { FC, useMemo } from 'react'; import { Observable } from 'rxjs'; import useObservable from 'react-use/lib/useObservable'; -import { EuiThemeProvider } from '@elastic/eui'; +import createCache from '@emotion/cache'; +import { EuiProvider } from '@elastic/eui'; +import { EUI_STYLES_GLOBAL } from '../../utils'; import { CoreTheme } from './types'; import { convertCoreTheme } from './convert_core_theme'; @@ -21,16 +23,26 @@ interface CoreThemeProviderProps { theme$: Observable; } +const emotionCache = createCache({ + key: 'eui-styles', + container: document.querySelector(`meta[name="${EUI_STYLES_GLOBAL}"]`) as HTMLElement, +}); + /** - * Wrapper around `EuiThemeProvider` converting (and exposing) core's theme to EUI theme. + * Wrapper around `EuiProvider` converting (and exposing) core's theme to EUI theme. * @internal Only meant to be used within core for internal usages of EUI/React */ export const CoreThemeProvider: FC = ({ theme$, children }) => { const coreTheme = useObservable(theme$, defaultTheme); const euiTheme = useMemo(() => convertCoreTheme(coreTheme), [coreTheme]); return ( - + {children} - + ); }; diff --git a/src/core/server/rendering/views/template.tsx b/src/core/server/rendering/views/template.tsx index 971a9e22e4fcc..47d9c98318c88 100644 --- a/src/core/server/rendering/views/template.tsx +++ b/src/core/server/rendering/views/template.tsx @@ -8,6 +8,7 @@ import React, { FunctionComponent, createElement } from 'react'; +import { EUI_STYLES_GLOBAL } from '../../../utils'; import { RenderingMetadata } from '../types'; import { Fonts } from './fonts'; import { Styles } from './styles'; @@ -42,6 +43,8 @@ export const Template: FunctionComponent = ({ + {/* Inject EUI reset and global styles before all other component styles */} + {/* Inject stylesheets into the before scripts so that KP plugins with bundled styles will override them */} diff --git a/src/core/utils/index.ts b/src/core/utils/index.ts index 73980983a12e1..82b636685a4d4 100644 --- a/src/core/utils/index.ts +++ b/src/core/utils/index.ts @@ -8,3 +8,4 @@ export { DEFAULT_APP_CATEGORIES } from './default_app_categories'; export { APP_WRAPPER_CLASS } from './app_wrapper_class'; +export { EUI_STYLES_GLOBAL } from './meta'; diff --git a/src/core/utils/meta.ts b/src/core/utils/meta.ts new file mode 100644 index 0000000000000..7d5e8b8ee63f9 --- /dev/null +++ b/src/core/utils/meta.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const EUI_STYLES_GLOBAL = 'eui-styles-global'; diff --git a/src/plugins/interactive_setup/public/theme/utils.ts b/src/plugins/interactive_setup/public/theme/utils.ts index 55730974afc16..052804073f226 100644 --- a/src/plugins/interactive_setup/public/theme/utils.ts +++ b/src/plugins/interactive_setup/public/theme/utils.ts @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -import type { EuiThemeColorMode } from '@elastic/eui/src/services/theme/types'; +import { COLOR_MODES_STANDARD } from '@elastic/eui'; +import type { EuiThemeColorModeStandard } from '@elastic/eui'; import type { CoreTheme } from '../../../../core/public'; /** * Copied from the `kibana_react` plugin, remove once https://github.com/elastic/kibana/issues/119204 is implemented. */ -export const getColorMode = (theme: CoreTheme): EuiThemeColorMode => { - // COLOR_MODES_STANDARD is not exported from eui - return theme.darkMode ? 'DARK' : 'LIGHT'; +export const getColorMode = (theme: CoreTheme): EuiThemeColorModeStandard => { + return theme.darkMode ? COLOR_MODES_STANDARD.dark : COLOR_MODES_STANDARD.light; }; diff --git a/src/plugins/kibana_react/public/theme/kibana_theme_provider.test.tsx b/src/plugins/kibana_react/public/theme/kibana_theme_provider.test.tsx index f2d1484e4bb56..ef7f79cdaa64e 100644 --- a/src/plugins/kibana_react/public/theme/kibana_theme_provider.test.tsx +++ b/src/plugins/kibana_react/public/theme/kibana_theme_provider.test.tsx @@ -11,12 +11,13 @@ import { act } from 'react-dom/test-utils'; import type { ReactWrapper } from 'enzyme'; import { of, BehaviorSubject } from 'rxjs'; import { useEuiTheme } from '@elastic/eui'; +import type { UseEuiTheme } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test/jest'; import type { CoreTheme } from 'src/core/public'; import { KibanaThemeProvider } from './kibana_theme_provider'; describe('KibanaThemeProvider', () => { - let euiTheme: ReturnType | undefined; + let euiTheme: UseEuiTheme | undefined; beforeEach(() => { euiTheme = undefined; diff --git a/src/plugins/kibana_react/public/theme/types.ts b/src/plugins/kibana_react/public/theme/types.ts index 4da25b7f4890a..607fff70915d1 100644 --- a/src/plugins/kibana_react/public/theme/types.ts +++ b/src/plugins/kibana_react/public/theme/types.ts @@ -6,6 +6,6 @@ * Side Public License, v 1. */ -import type { useEuiTheme } from '@elastic/eui'; +import type { UseEuiTheme } from '@elastic/eui'; -export type EuiTheme = ReturnType; +export type EuiTheme = UseEuiTheme; diff --git a/src/plugins/kibana_react/public/theme/utils.ts b/src/plugins/kibana_react/public/theme/utils.ts index b3d2f8bc6bb30..5377ff40ebab0 100644 --- a/src/plugins/kibana_react/public/theme/utils.ts +++ b/src/plugins/kibana_react/public/theme/utils.ts @@ -6,13 +6,14 @@ * Side Public License, v 1. */ -import type { EuiThemeColorMode } from '@elastic/eui/src/services/theme/types'; +import { COLOR_MODES_STANDARD } from '@elastic/eui'; +import type { EuiThemeColorModeStandard } from '@elastic/eui'; import type { CoreTheme } from '../../../../core/public'; // IMPORTANT: This code has been copied to the `interactive_setup` plugin, any changes here should be applied there too. // That copy and this comment can be removed once https://github.com/elastic/kibana/issues/119204 is implemented. -export const getColorMode = (theme: CoreTheme): EuiThemeColorMode => { +export const getColorMode = (theme: CoreTheme): EuiThemeColorModeStandard => { // COLOR_MODES_STANDARD is not exported from eui - return theme.darkMode ? 'DARK' : 'LIGHT'; + return theme.darkMode ? COLOR_MODES_STANDARD.dark : COLOR_MODES_STANDARD.light; }; diff --git a/src/plugins/kibana_react/public/util/to_mount_point.test.tsx b/src/plugins/kibana_react/public/util/to_mount_point.test.tsx index 7f5bd0789cb12..74566763d9215 100644 --- a/src/plugins/kibana_react/public/util/to_mount_point.test.tsx +++ b/src/plugins/kibana_react/public/util/to_mount_point.test.tsx @@ -10,11 +10,12 @@ import React, { FC, useEffect } from 'react'; import { act } from 'react-dom/test-utils'; import { of, BehaviorSubject } from 'rxjs'; import { useEuiTheme } from '@elastic/eui'; +import type { UseEuiTheme } from '@elastic/eui'; import type { CoreTheme } from 'src/core/public'; import { toMountPoint } from './to_mount_point'; describe('toMountPoint', () => { - let euiTheme: ReturnType | undefined; + let euiTheme: UseEuiTheme | undefined; beforeEach(() => { euiTheme = undefined; From 9e49e8febb31ddae8b4df5dce172c005cc0c46a3 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 9 Dec 2021 09:41:47 -0600 Subject: [PATCH 03/32] update sass import location --- .../shareable_runtime/components/footer/footer.module.scss | 2 +- .../shareable_runtime/components/footer/scrubber.module.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/canvas/shareable_runtime/components/footer/footer.module.scss b/x-pack/plugins/canvas/shareable_runtime/components/footer/footer.module.scss index 54f5983bd2e5a..a9a6e9d1cc196 100644 --- a/x-pack/plugins/canvas/shareable_runtime/components/footer/footer.module.scss +++ b/x-pack/plugins/canvas/shareable_runtime/components/footer/footer.module.scss @@ -1,5 +1,5 @@ @import '@elastic/eui/src/global_styling/variables/_size.scss'; -@import '@elastic/eui/src/global_styling/variables/_colors.scss'; +@import '@elastic/eui/src/themes/amsterdam/_colors_light.scss'; :global .kbnCanvas :local .root .bar { position: absolute; diff --git a/x-pack/plugins/canvas/shareable_runtime/components/footer/scrubber.module.scss b/x-pack/plugins/canvas/shareable_runtime/components/footer/scrubber.module.scss index a8b602d40e8cd..7599df7391295 100644 --- a/x-pack/plugins/canvas/shareable_runtime/components/footer/scrubber.module.scss +++ b/x-pack/plugins/canvas/shareable_runtime/components/footer/scrubber.module.scss @@ -1,5 +1,5 @@ @import '@elastic/eui/src/global_styling/variables/_size.scss'; -@import '@elastic/eui/src/global_styling/variables/_colors.scss'; +@import '@elastic/eui/src/themes/amsterdam/_colors_light.scss'; @import '@elastic/eui/src/global_styling/mixins/_helpers.scss'; :global .kbnCanvas :local .root { From d73dbee5238369acae787f70c0a3a4d02dfdb4f7 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 9 Dec 2021 11:04:35 -0600 Subject: [PATCH 04/32] storyshots --- .../time_filter.stories.storyshot | 162 ++- .../workpad_table.stories.storyshot | 14 +- .../keyboard_shortcuts_doc.stories.storyshot | 968 ++++++++++-------- 3 files changed, 690 insertions(+), 454 deletions(-) diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/time_filter/components/__stories__/__snapshots__/time_filter.stories.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/time_filter/components/__stories__/__snapshots__/time_filter.stories.storyshot index 646a2d3aa3583..5abd1e9fd05b6 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/time_filter/components/__stories__/__snapshots__/time_filter.stories.storyshot +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/time_filter/components/__stories__/__snapshots__/time_filter.stories.storyshot @@ -47,7 +47,7 @@ exports[`Storyshots renderers/TimeFilter default 1`] = ` className="euiButtonEmpty__text euiQuickSelectPopover__buttonText" > @@ -67,10 +67,36 @@ exports[`Storyshots renderers/TimeFilter default 1`] = ` onClick={[Function]} > Last 1 year + + + +
+
+
@@ -129,7 +155,7 @@ exports[`Storyshots renderers/TimeFilter with absolute time bounds 1`] = ` className="euiButtonEmpty__text euiQuickSelectPopover__buttonText" > @@ -188,6 +214,37 @@ exports[`Storyshots renderers/TimeFilter with absolute time bounds 1`] = `
+
+
+ +
+
@@ -242,7 +299,7 @@ exports[`Storyshots renderers/TimeFilter with commonlyUsedRanges 1`] = ` className="euiButtonEmpty__text euiQuickSelectPopover__buttonText" > @@ -262,10 +319,36 @@ exports[`Storyshots renderers/TimeFilter with commonlyUsedRanges 1`] = ` onClick={[Function]} > Last 30 days + + + +
+
+
@@ -324,7 +407,7 @@ exports[`Storyshots renderers/TimeFilter with dateFormat 1`] = ` className="euiButtonEmpty__text euiQuickSelectPopover__buttonText" > @@ -344,10 +427,36 @@ exports[`Storyshots renderers/TimeFilter with dateFormat 1`] = ` onClick={[Function]} > Last 24 hours + +
+ +
+
+
@@ -406,7 +515,7 @@ exports[`Storyshots renderers/TimeFilter with relative time bounds 1`] = ` className="euiButtonEmpty__text euiQuickSelectPopover__buttonText" > @@ -465,6 +574,37 @@ exports[`Storyshots renderers/TimeFilter with relative time bounds 1`] = `
+
+
+ +
+
diff --git a/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/workpad_table.stories.storyshot b/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/workpad_table.stories.storyshot index 1277505d2d208..12ca14a0a6286 100644 --- a/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/workpad_table.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/workpad_table.stories.storyshot @@ -899,9 +899,17 @@ exports[`Storyshots Home/Components/Workpad Table Workpad Table 1`] = ` aria-label="Pagination for table: " className="euiPagination" > + + Page 1 of 1 + - - - + /> + + + +
- - - - - - - + /> + + + + @@ -3002,54 +2997,57 @@ exports[`Inspector Data View component should support multiple datatables 1`] = aria-label="Pagination for table: " className="euiPagination" > - + + Page 1 of 1 + + + - - - - - - + /> + + + +
- - - - - - - + /> + + + + From 655ab863f0dae932d48c8e18033fd882d2c0c4df Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 9 Dec 2021 13:43:02 -0600 Subject: [PATCH 10/32] timepicker functional test helpers --- test/functional/page_objects/time_picker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/functional/page_objects/time_picker.ts b/test/functional/page_objects/time_picker.ts index b5daa42f977b8..995c13e3b1994 100644 --- a/test/functional/page_objects/time_picker.ts +++ b/test/functional/page_objects/time_picker.ts @@ -263,12 +263,14 @@ export class TimePickerPageObject extends FtrService { public async startAutoRefresh(intervalS = 3) { await this.quickSelectTimeMenuToggle.open(); + const refreshConfig = await this.getRefreshConfig(true); + if (refreshConfig.isPaused) { this.log.debug('start auto refresh'); await this.testSubjects.click('superDatePickerToggleRefreshButton'); } + await this.inputValue('superDatePickerRefreshIntervalInput', intervalS.toString()); - const refreshConfig = await this.getRefreshConfig(true); await this.quickSelectTimeMenuToggle.close(); } From af37e56618725972aca699bca635cc7ca3a255bc Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 9 Dec 2021 14:38:06 -0600 Subject: [PATCH 11/32] invert checked logic --- test/functional/page_objects/time_picker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/page_objects/time_picker.ts b/test/functional/page_objects/time_picker.ts index 995c13e3b1994..a6f753fe68635 100644 --- a/test/functional/page_objects/time_picker.ts +++ b/test/functional/page_objects/time_picker.ts @@ -205,7 +205,7 @@ export class TimePickerPageObject extends FtrService { return { interval, units: selectedUnit, - isPaused: toggleButtonChecked === 'true' ? true : false, + isPaused: toggleButtonChecked === 'true' ? false : true, }; } From 7f85b109611eb3c4500c77739913a407b553b001 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 9 Dec 2021 14:43:47 -0600 Subject: [PATCH 12/32] fix i18n token --- src/core/public/i18n/i18n_eui_mapping.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index b4b8e905f9568..4603a2074c4d9 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -531,7 +531,7 @@ export const getEuiContextMapping = (): EuiTokensObject => { defaultMessage: 'Single', }), 'euiDisplaySelector.labelAuto': i18n.translate('core.euiDisplaySelector.labelAuto', { - defaultMessage: 'Auto', + defaultMessage: 'Auto fit', }), 'euiDisplaySelector.labelCustom': i18n.translate('core.euiDisplaySelector.labelCustom', { defaultMessage: 'Custom', From 5e4a7643ebd7624f6904862567449e57b3b87581 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 9 Dec 2021 15:58:59 -0600 Subject: [PATCH 13/32] snapshots --- .../__snapshots__/i18n_service.test.tsx.snap | 38 ++-- .../collection_enabled.test.js.snap | 26 ++- .../collection_interval.test.js.snap | 52 +++--- .../__snapshots__/exporters.test.js.snap | 88 ++++----- .../__snapshots__/plugin_enabled.test.js.snap | 33 ++-- .../__snapshots__/reason_found.test.js.snap | 143 ++++++++------- .../__snapshots__/index.test.tsx.snap | 167 ++++++++++++++---- 7 files changed, 331 insertions(+), 216 deletions(-) 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 1c394112a404c..d4a3bd3a7ea74 100644 --- a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap +++ b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap @@ -7,6 +7,9 @@ exports[`#start() returns \`Context\` component 1`] = ` Object { "mapping": Object { "euiAccordion.isLoading": "Loading", + "euiAutoRefresh.autoRefreshLabel": "Auto refresh", + "euiAutoRefresh.buttonLabelOff": "Auto refresh is off", + "euiAutoRefresh.buttonLabelOn": [Function], "euiBasicTable.noItemsMessage": "No items found", "euiBasicTable.selectAllRows": "Select all rows", "euiBasicTable.selectThisRow": "Select this row", @@ -98,6 +101,17 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiDataGridToolbar.fullScreenButtonActive": "Exit full screen", "euiDatePopoverButton.invalidTitle": [Function], "euiDatePopoverButton.outdatedTitle": [Function], + "euiDisplaySelector.buttonText": "Display options", + "euiDisplaySelector.densityLabel": "Density", + "euiDisplaySelector.labelAuto": "Auto fit", + "euiDisplaySelector.labelCompact": "Compact", + "euiDisplaySelector.labelCustom": "Custom", + "euiDisplaySelector.labelExpanded": "Expanded", + "euiDisplaySelector.labelNormal": "Normal", + "euiDisplaySelector.labelSingle": "Single", + "euiDisplaySelector.lineCountLabel": "Lines per row", + "euiDisplaySelector.resetButtonText": "Reset to default", + "euiDisplaySelector.rowHeightLabel": "Row height", "euiErrorBoundary.error": "Error", "euiFieldPassword.maskPassword": "Mask password", "euiFieldPassword.showPassword": "Show password as plain text. Note: this will visually expose your password on the screen.", @@ -145,15 +159,20 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiNotificationEventReadIcon.readAria": [Function], "euiNotificationEventReadIcon.unread": "Unread", "euiNotificationEventReadIcon.unreadAria": [Function], - "euiPagination.disabledNextPage": "Next page", - "euiPagination.disabledPreviousPage": "Previous page", + "euiPagination.collection": "collection", "euiPagination.firstRangeAriaLabel": [Function], + "euiPagination.fromEndLabel": "from end", + "euiPagination.last": "Last", "euiPagination.lastRangeAriaLabel": [Function], - "euiPagination.nextPage": [Function], + "euiPagination.of": "of", + "euiPagination.page": "Page", "euiPagination.pageOfTotalCompressed": [Function], - "euiPagination.previousPage": [Function], "euiPaginationButton.longPageString": [Function], "euiPaginationButton.shortPageString": [Function], + "euiPaginationButtonArrow.firstPage": "First page", + "euiPaginationButtonArrow.lastPage": "Last page", + "euiPaginationButtonArrow.nextPage": "Next page", + "euiPaginationButtonArrow.previousPage": "Previous page", "euiPinnableListGroup.pinExtraActionLabel": "Pin item", "euiPinnableListGroup.pinnedExtraActionLabel": "Unpin item", "euiPopover.screenReaderAnnouncement": "You are in a dialog. To close this dialog, hit escape.", @@ -168,10 +187,9 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiQuickSelect.unitLabel": "Time unit", "euiQuickSelect.valueLabel": "Time value", "euiRecentlyUsed.legend": "Recently used date ranges", - "euiRefreshInterval.fullDescription": [Function], + "euiRefreshInterval.fullDescriptionOff": [Function], + "euiRefreshInterval.fullDescriptionOn": [Function], "euiRefreshInterval.legend": "Refresh every", - "euiRefreshInterval.start": "Start", - "euiRefreshInterval.stop": "Stop", "euiRelativeTab.dateInputError": "Must be a valid range", "euiRelativeTab.fullDescription": [Function], "euiRelativeTab.numberInputError": "Must be >= 0", @@ -213,12 +231,6 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiStepStrings.simpleWarning": [Function], "euiStepStrings.step": [Function], "euiStepStrings.warning": [Function], - "euiStyleSelector.buttonLegend": "Select the display density for the data grid", - "euiStyleSelector.buttonText": "Density", - "euiStyleSelector.labelCompact": "Compact density", - "euiStyleSelector.labelExpanded": "Expanded density", - "euiStyleSelector.labelNormal": "Normal density", - "euiSuperDatePicker.showDatesButtonLabel": "Show dates", "euiSuperSelect.screenReaderAnnouncement": "You are in a form selector and must select a single option. Use the up and down keys to navigate or escape to close.", "euiSuperSelectControl.selectAnOption": [Function], "euiSuperUpdateButton.cannotUpdateTooltip": "Cannot update", diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__snapshots__/collection_enabled.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__snapshots__/collection_enabled.test.js.snap index cab1e9190a8b3..7a6c10c27602d 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__snapshots__/collection_enabled.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__snapshots__/collection_enabled.test.js.snap @@ -187,27 +187,21 @@ exports[`ExplainCollectionEnabled should explain about xpack.monitoring.collecti > We checked the cluster settings and found that - - - - xpack.monitoring.collection.enabled - - - + xpack.monitoring.collection.enabled + is set to - - - - -1 - - - + -1 + .
diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__snapshots__/collection_interval.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__snapshots__/collection_interval.test.js.snap index 80802e4e77029..c8ee61ff0a492 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__snapshots__/collection_interval.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__snapshots__/collection_interval.test.js.snap @@ -360,27 +360,21 @@ exports[`ExplainCollectionInterval collection interval setting updates should sh > We checked the cluster settings and found that - - - - xpack.monitoring.collection.interval - - - + xpack.monitoring.collection.interval + is set to - - - - -1 - - - + -1 + . @@ -687,27 +681,21 @@ exports[`ExplainCollectionInterval should explain about xpack.monitoring.collect > We checked the cluster settings and found that - - - - xpack.monitoring.collection.interval - - - + xpack.monitoring.collection.interval + is set to - - - - -1 - - - + -1 + . diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/__snapshots__/exporters.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/__snapshots__/exporters.test.js.snap index 6bfc17121d511..499d50155a06b 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/__snapshots__/exporters.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/__snapshots__/exporters.test.js.snap @@ -26,59 +26,67 @@ Array [ >

We checked the - - - esProd001 - - + + esProd001 + settings for - - - xpack.monitoring.exporters - - + + xpack.monitoring.exporters + , and found the reason: - - - myMonitoringClusterExporter1 - - + + myMonitoringClusterExporter1 + .

Using monitoring exporters to ship the monitoring data to a remote monitoring cluster is highly recommended as it keeps the integrity of the monitoring data safe no matter what the state of the production cluster. However, as this instance of Kibana could not find any monitoring data, there seems to be a problem with the - - - xpack.monitoring.exporters - - + + xpack.monitoring.exporters + configuration, or the - - - xpack.monitoring.elasticsearch - - + + xpack.monitoring.elasticsearch + settings in - - - kibana.yml - - + + kibana.yml + .

Check that the intended exporters are enabled for sending statistics to the monitoring cluster, and that the monitoring cluster host matches the - - - xpack.monitoring.elasticsearch - - + + xpack.monitoring.elasticsearch + setting in - - - kibana.yml - - + + kibana.yml + to see monitoring data in this instance of Kibana.

, diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/__snapshots__/plugin_enabled.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/__snapshots__/plugin_enabled.test.js.snap index 63053c3f7c0cd..8d09ead405e21 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/__snapshots__/plugin_enabled.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/__snapshots__/plugin_enabled.test.js.snap @@ -26,23 +26,26 @@ Array [ >

We checked the cluster settings and found that - - - xpack.monitoring.enabled - - + + xpack.monitoring.enabled + is set to - - - false - - + + false + set, which disables monitoring. Removing the - - - xpack.monitoring.enabled: false - - + + xpack.monitoring.enabled: false + setting from your configuration will put the default into effect and enable Monitoring.

, diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/__snapshots__/reason_found.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/reasons/__snapshots__/reason_found.test.js.snap index 649d5f7f757ab..3de2fbd3406e9 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/__snapshots__/reason_found.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/__snapshots__/reason_found.test.js.snap @@ -26,17 +26,19 @@ Array [ >

We checked the cluster settings and found that - - - xpack.monitoring.collection.interval - - + + xpack.monitoring.collection.interval + is set to - - - -1 - - + + -1 + .

@@ -101,59 +103,67 @@ Array [ >

We checked the - - - node001foo - - + + node001foo + settings for - - - xpack.monitoring.exporters - - + + xpack.monitoring.exporters + , and found the reason: - - - myMonitoringClusterExporter1 - - + + myMonitoringClusterExporter1 + .

Using monitoring exporters to ship the monitoring data to a remote monitoring cluster is highly recommended as it keeps the integrity of the monitoring data safe no matter what the state of the production cluster. However, as this instance of Kibana could not find any monitoring data, there seems to be a problem with the - - - xpack.monitoring.exporters - - + + xpack.monitoring.exporters + configuration, or the - - - xpack.monitoring.elasticsearch - - + + xpack.monitoring.elasticsearch + settings in - - - kibana.yml - - + + kibana.yml + .

Check that the intended exporters are enabled for sending statistics to the monitoring cluster, and that the monitoring cluster host matches the - - - xpack.monitoring.elasticsearch - - + + xpack.monitoring.elasticsearch + setting in - - - kibana.yml - - + + kibana.yml + to see monitoring data in this instance of Kibana.

, @@ -268,23 +278,26 @@ Array [ >

We checked the node001foo settings and found that - - - xpack.monitoring.enabled - - + + xpack.monitoring.enabled + is set to - - - false - - + + false + set, which disables monitoring. Removing the - - - xpack.monitoring.enabled: false - - + + xpack.monitoring.enabled: false + setting from your configuration will put the default into effect and enable Monitoring.

, 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 b9ea31e67098a..ec36b048b51f0 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 @@ -215,9 +215,17 @@ exports[`TrustedAppsGrid renders correctly when failed loading data for the seco