From a7336040325c8b167338f984c2d42c5685f288d2 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 4 Jan 2022 15:10:18 -0600 Subject: [PATCH] Revert "Upgrade EUI to v43.1.1 (#120935)" This reverts commit 604409b3de1a8a46a6900f1dd538fb7f7e474fd0. --- 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 +- .../__snapshots__/i18n_service.test.tsx.snap | 38 +- src/core/public/i18n/i18n_eui_mapping.tsx | 142 ++-- 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 | 19 +- src/core/server/rendering/views/styles.tsx | 4 - src/core/server/rendering/views/template.tsx | 3 - src/core/utils/index.ts | 1 - src/core/utils/meta.ts | 9 - src/dev/license_checker/config.ts | 2 +- .../query/timefilter/timefilter.test.ts | 3 +- .../public/query/timefilter/timefilter.ts | 8 +- .../__snapshots__/data_view.test.tsx.snap | 290 ++++---- .../components/discover_grid/constants.ts | 2 +- .../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 | 8 +- .../public/util/to_mount_point.test.tsx | 3 +- .../table_vis_basic.test.tsx.snap | 2 +- .../public/components/table_vis_basic.tsx | 2 +- test/functional/page_objects/time_picker.ts | 19 +- .../time_filter.stories.storyshot | 162 +--- .../workpad_table.stories.storyshot | 14 +- .../keyboard_shortcuts_doc.stories.storyshot | 704 +++++++++++------- .../components/footer/footer.module.scss | 2 +- .../components/footer/scrubber.module.scss | 2 +- .../api_code_example.test.tsx | 8 +- .../components/data_grid/common.ts | 2 +- .../evaluate_panel.tsx | 2 +- .../collection_enabled.test.js.snap | 24 +- .../collection_interval.test.js.snap | 48 +- .../__snapshots__/exporters.test.js.snap | 64 +- .../__snapshots__/plugin_enabled.test.js.snap | 24 +- .../__snapshots__/reason_found.test.js.snap | 104 ++- .../osquery/public/results/results_table.tsx | 2 +- .../nav_control/nav_control_service.test.ts | 1 - .../cypress/screens/timeline.ts | 2 +- .../super_date_picker/index.test.tsx | 14 +- .../__snapshots__/index.test.tsx.snap | 167 +---- .../spaces_grid_page.test.tsx.snap | 3 - .../space_avatar_internal.test.tsx.snap | 1 - .../public/components/t_grid/body/index.tsx | 2 +- .../translations/translations/ja-JP.json | 13 + .../translations/translations/zh-CN.json | 13 + .../__snapshots__/donut_chart.test.tsx.snap | 8 +- .../use_url_params.test.tsx.snap | 4 +- .../page_objects/infra_home_page.ts | 1 + .../services/observability/alerts/common.ts | 2 +- .../alerts/state_synchronization.ts | 3 +- yarn.lock | 35 +- 57 files changed, 995 insertions(+), 1040 deletions(-) delete mode 100644 src/core/utils/meta.ts diff --git a/package.json b/package.json index 49eceef7ac47a..9711ce1d2c326 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.1.0-canary.2", "@elastic/ems-client": "8.0.0", - "@elastic/eui": "43.1.1", + "@elastic/eui": "41.2.3", "@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 fe6ea54bbde05..dc95601fadd1a 100644 --- a/packages/elastic-eslint-config-kibana/.eslintrc.js +++ b/packages/elastic-eslint-config-kibana/.eslintrc.js @@ -91,6 +91,8 @@ 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 5b030a91e396e..197ec5e63ad7c 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_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', '@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_dark.css'], - 'kbn-ui-shared-deps-npm.v8.light': ['@elastic/eui/dist/eui_theme_light.css'], + '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'], }, 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 8fde5c63a292a..33b8a594bfa5d 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_light.json'; +import { default as v8Light } from '@elastic/eui/dist/eui_theme_amsterdam_light.json'; /* eslint-disable-next-line @kbn/eslint/module_migration */ -import { default as v8Dark } from '@elastic/eui/dist/eui_theme_dark.json'; +import { default as v8Dark } from '@elastic/eui/dist/eui_theme_amsterdam_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 df9f1a7493473..ce0eeea02eb3b 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/amsterdam/colors_dark'; -@import '@elastic/eui/src/themes/amsterdam/globals'; +@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_dark'; +@import '@elastic/eui/src/themes/eui-amsterdam/eui_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 07312b9cf08bf..1ec76902f6589 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/amsterdam/colors_light'; -@import '@elastic/eui/src/themes/amsterdam/globals'; +@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_light'; +@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals'; @import './mixins'; 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 d4a3bd3a7ea74..1c394112a404c 100644 --- a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap +++ b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap @@ -7,9 +7,6 @@ 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", @@ -101,17 +98,6 @@ 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.", @@ -159,20 +145,15 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiNotificationEventReadIcon.readAria": [Function], "euiNotificationEventReadIcon.unread": "Unread", "euiNotificationEventReadIcon.unreadAria": [Function], - "euiPagination.collection": "collection", + "euiPagination.disabledNextPage": "Next page", + "euiPagination.disabledPreviousPage": "Previous page", "euiPagination.firstRangeAriaLabel": [Function], - "euiPagination.fromEndLabel": "from end", - "euiPagination.last": "Last", "euiPagination.lastRangeAriaLabel": [Function], - "euiPagination.of": "of", - "euiPagination.page": "Page", + "euiPagination.nextPage": [Function], "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.", @@ -187,9 +168,10 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiQuickSelect.unitLabel": "Time unit", "euiQuickSelect.valueLabel": "Time value", "euiRecentlyUsed.legend": "Recently used date ranges", - "euiRefreshInterval.fullDescriptionOff": [Function], - "euiRefreshInterval.fullDescriptionOn": [Function], + "euiRefreshInterval.fullDescription": [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", @@ -231,6 +213,12 @@ 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/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 4603a2074c4d9..e3357d138e794 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -20,17 +20,6 @@ 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', @@ -506,42 +495,6 @@ 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 fit', - }), - '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.', @@ -755,6 +708,11 @@ 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}', @@ -772,21 +744,6 @@ 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}', @@ -799,24 +756,6 @@ 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', { @@ -872,19 +811,20 @@ 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.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 }, - }), + 'euiRefreshInterval.start': i18n.translate('core.euiRefreshInterval.start', { + defaultMessage: 'Start', + }), + 'euiRefreshInterval.stop': i18n.translate('core.euiRefreshInterval.stop', { + defaultMessage: 'Stop', + }), 'euiRelativeTab.fullDescription': ({ unit }: EuiValues) => i18n.translate('core.euiRelativeTab.fullDescription', { defaultMessage: 'The unit is changeable. Currently set to {unit}.', @@ -1088,6 +1028,28 @@ 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/core/public/theme/convert_core_theme.ts b/src/core/public/theme/convert_core_theme.ts index e0251de1d31be..78acef40764b6 100644 --- a/src/core/public/theme/convert_core_theme.ts +++ b/src/core/public/theme/convert_core_theme.ts @@ -6,13 +6,12 @@ * Side Public License, v 1. */ -import { COLOR_MODES_STANDARD } from '@elastic/eui'; -import type { EuiThemeSystem, EuiThemeColorModeStandard } from '@elastic/eui'; +import type { EuiThemeSystem, EuiThemeColorMode } from '@elastic/eui'; import type { CoreTheme } from './types'; /** @internal */ export interface EuiTheme { - colorMode: EuiThemeColorModeStandard; + colorMode: EuiThemeColorMode; euiThemeSystem?: EuiThemeSystem; } @@ -20,6 +19,6 @@ export interface EuiTheme { export const convertCoreTheme = (coreTheme: CoreTheme): EuiTheme => { const { darkMode } = coreTheme; return { - colorMode: darkMode ? COLOR_MODES_STANDARD.dark : COLOR_MODES_STANDARD.light, + colorMode: darkMode ? 'DARK' : 'LIGHT', }; }; diff --git a/src/core/public/theme/core_theme_provider.test.tsx b/src/core/public/theme/core_theme_provider.test.tsx index a0f0faf13b9da..baa354f10f428 100644 --- a/src/core/public/theme/core_theme_provider.test.tsx +++ b/src/core/public/theme/core_theme_provider.test.tsx @@ -11,13 +11,12 @@ 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: UseEuiTheme | undefined; + let euiTheme: ReturnType | 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 ee6ecbea836b5..9f40cbd5393b8 100644 --- a/src/core/public/theme/core_theme_provider.tsx +++ b/src/core/public/theme/core_theme_provider.tsx @@ -9,9 +9,7 @@ import React, { FC, useMemo } from 'react'; import { Observable } from 'rxjs'; import useObservable from 'react-use/lib/useObservable'; -import createCache from '@emotion/cache'; -import { EuiProvider } from '@elastic/eui'; -import { EUI_STYLES_GLOBAL } from '../../utils'; +import { EuiThemeProvider } from '@elastic/eui'; import { CoreTheme } from './types'; import { convertCoreTheme } from './convert_core_theme'; @@ -23,25 +21,16 @@ interface CoreThemeProviderProps { theme$: Observable; } -const emotionCache = createCache({ - key: 'eui-styles', - container: document.querySelector(`meta[name="${EUI_STYLES_GLOBAL}"]`) as HTMLElement, -}); - /** - * Wrapper around `EuiProvider` converting (and exposing) core's theme to EUI theme. + * Wrapper around `EuiThemeProvider` 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/styles.tsx b/src/core/server/rendering/views/styles.tsx index 9830cac55e9eb..fbeab4fb4388f 100644 --- a/src/core/server/rendering/views/styles.tsx +++ b/src/core/server/rendering/views/styles.tsx @@ -50,10 +50,6 @@ const InlineStyles: FC<{ darkMode: boolean }> = ({ darkMode }) => { display: block; } - html { - background-color: ${darkMode ? '#141519' : '#F8FAFD'} - } - .kbnWelcomeView { line-height: 1.5; height: 100%; diff --git a/src/core/server/rendering/views/template.tsx b/src/core/server/rendering/views/template.tsx index 47d9c98318c88..971a9e22e4fcc 100644 --- a/src/core/server/rendering/views/template.tsx +++ b/src/core/server/rendering/views/template.tsx @@ -8,7 +8,6 @@ import React, { FunctionComponent, createElement } from 'react'; -import { EUI_STYLES_GLOBAL } from '../../../utils'; import { RenderingMetadata } from '../types'; import { Fonts } from './fonts'; import { Styles } from './styles'; @@ -43,8 +42,6 @@ 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 82b636685a4d4..73980983a12e1 100644 --- a/src/core/utils/index.ts +++ b/src/core/utils/index.ts @@ -8,4 +8,3 @@ 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 deleted file mode 100644 index 7d5e8b8ee63f9..0000000000000 --- a/src/core/utils/meta.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * 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/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 7c76b73a27ee4..ef902f791e86d 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -77,6 +77,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@43.1.1': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@41.2.3': ['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/data/public/query/timefilter/timefilter.test.ts b/src/plugins/data/public/query/timefilter/timefilter.test.ts index e3fc3ac582d80..92ee6b0c30428 100644 --- a/src/plugins/data/public/query/timefilter/timefilter.test.ts +++ b/src/plugins/data/public/query/timefilter/timefilter.test.ts @@ -162,8 +162,7 @@ describe('setRefreshInterval', () => { expect(timefilter.getRefreshInterval()).toEqual({ pause: true, value: 0 }); }); - test('should set pause to true when interval is changed to zero from non-zero', () => { - timefilter.setRefreshInterval({ value: 1000, pause: false }); + test('should set pause to true when interval is zero', () => { timefilter.setRefreshInterval({ value: 0, pause: false }); expect(timefilter.getRefreshInterval()).toEqual({ pause: true, value: 0 }); }); diff --git a/src/plugins/data/public/query/timefilter/timefilter.ts b/src/plugins/data/public/query/timefilter/timefilter.ts index d289a90149fdd..e13e8b17a7f43 100644 --- a/src/plugins/data/public/query/timefilter/timefilter.ts +++ b/src/plugins/data/public/query/timefilter/timefilter.ts @@ -151,16 +151,10 @@ export class Timefilter { public setRefreshInterval = (refreshInterval: Partial) => { const prevRefreshInterval = this.getRefreshInterval(); const newRefreshInterval = { ...prevRefreshInterval, ...refreshInterval }; - let shouldUnpauseRefreshLoop = - newRefreshInterval.pause === false && prevRefreshInterval != null; - if (prevRefreshInterval?.value > 0 && newRefreshInterval.value <= 0) { - shouldUnpauseRefreshLoop = false; - } // If the refresh interval is <= 0 handle that as a paused refresh - // unless the user has un-paused the refresh loop and the value is not going from > 0 to 0 if (newRefreshInterval.value <= 0) { newRefreshInterval.value = 0; - newRefreshInterval.pause = shouldUnpauseRefreshLoop ? false : true; + newRefreshInterval.pause = true; } this._refreshInterval = { value: newRefreshInterval.value, 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 4db3f780fdebe..3262ee70dff86 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 @@ -1416,57 +1416,54 @@ exports[`Inspector Data View component should render single table without select aria-label="Pagination for table: " className="euiPagination" > - - - Page 1 of 1 - - - - - - - + type="arrowLeft" + > +