From c2fdb17480c34e6bfdd2ed6f825056870174cc2f Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Thu, 28 Oct 2021 10:16:47 -0700 Subject: [PATCH 1/4] Upgrade EUI to v40.1.0 --- package.json | 2 +- src/dev/license_checker/config.ts | 2 +- yarn.lock | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 767972539ad54..b5ed143652559 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,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": "40.0.0", + "@elastic/eui": "40.1.0", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.3.0", "@elastic/node-crypto": "1.2.1", diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 4c630ae1c10e1..f23456bbaca07 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -75,6 +75,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@40.0.0': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@40.1.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/yarn.lock b/yarn.lock index 472d6ee0f7ad9..c119a3f1a247d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2411,10 +2411,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@40.0.0": - version "40.0.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-40.0.0.tgz#9556a87fa5eb7d9061e85f71ea9d3e6a9022dc3e" - integrity sha512-Zsz8eczEjthMgU00YhnsNmkKA8j4hxQpWNnrgecMgpcFEIj+Nn5WBofL/TJux/latS/mB4WWmrq4FTiSIyv/+Q== +"@elastic/eui@40.1.0": + version "40.1.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-40.1.0.tgz#d5ad63e9ed4ae482037a637e9b3f2598712c9e94" + integrity sha512-xlmbu4ZjdKtpgkQZ6GNMWCyyjSJaNFPMj97pLs11UEag2L1W0IwISlGF9+K45Qp4KLatR6iphwiyLFGmqGOOTA== dependencies: "@types/chroma-js" "^2.0.0" "@types/lodash" "^4.14.160" @@ -2444,6 +2444,7 @@ rehype-raw "^5.0.0" rehype-react "^6.0.0" rehype-stringify "^8.0.0" + remark-breaks "^2.0.2" remark-emoji "^2.1.0" remark-parse "^8.0.3" remark-rehype "^8.0.0" @@ -24920,6 +24921,13 @@ release-zalgo@^1.0.0: dependencies: es6-error "^4.0.1" +remark-breaks@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/remark-breaks/-/remark-breaks-2.0.2.tgz#55fdec6c7da84f659aa7fdb1aa95b632870cee8d" + integrity sha512-LsQnPPQ7Fzp9RTjj4IwdEmjPOr9bxe9zYKWhs9ZQOg9hMg8rOfeeqQ410cvVdIK87Famqza1CKRxNkepp2EvUA== + dependencies: + unist-util-visit "^2.0.0" + remark-emoji@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/remark-emoji/-/remark-emoji-2.1.0.tgz#69165d1181b98a54ad5d9ef811003d53d7ebc7db" From 362a85000ceb20b98aeb1726ad7327926baf6cd4 Mon Sep 17 00:00:00 2001 From: Uladzislau Lasitsa Date: Fri, 22 Oct 2021 11:35:01 +0300 Subject: [PATCH 2/4] [Discover] Remove temp fix + update snapshot --- .../table_vis_basic.test.tsx.snap | 3 --- .../public/components/table_vis_basic.tsx | 23 +------------------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/plugins/vis_types/table/public/components/__snapshots__/table_vis_basic.test.tsx.snap b/src/plugins/vis_types/table/public/components/__snapshots__/table_vis_basic.test.tsx.snap index 38e3dcbb7097c..85cf9422630d6 100644 --- a/src/plugins/vis_types/table/public/components/__snapshots__/table_vis_basic.test.tsx.snap +++ b/src/plugins/vis_types/table/public/components/__snapshots__/table_vis_basic.test.tsx.snap @@ -17,7 +17,6 @@ exports[`TableVisBasic should init data grid 1`] = ` "header": "underline", } } - key="0" minSizeForControls={1} onColumnResize={[Function]} renderCellValue={[Function]} @@ -56,7 +55,6 @@ exports[`TableVisBasic should init data grid with title provided - for split mod "header": "underline", } } - key="0" minSizeForControls={1} onColumnResize={[Function]} renderCellValue={[Function]} @@ -88,7 +86,6 @@ exports[`TableVisBasic should render the toolbar 1`] = ` "header": "underline", } } - key="0" minSizeForControls={1} onColumnResize={[Function]} renderCellValue={[Function]} 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 cfe1ce5d40a1e..2476c17c58a4d 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 @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { memo, useCallback, useMemo, useEffect, useState, useRef } from 'react'; +import React, { memo, useCallback, useMemo } from 'react'; import { EuiDataGrid, EuiDataGridProps, EuiDataGridSorting, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { orderBy } from 'lodash'; @@ -111,26 +111,6 @@ export const TableVisBasic = memo( [columns, setColumnsWidth] ); - const firstRender = useRef(true); - const [dataGridUpdateCounter, setDataGridUpdateCounter] = useState(0); - - // key was added as temporary solution to force re-render if we change autoFitRowToContent or we get new data - // cause we have problem with correct updating height cache in EUI datagrid when we use auto-height - // will be removed as soon as fix problem on EUI side - useEffect(() => { - // skip first render - if (firstRender.current) { - firstRender.current = false; - return; - } - // skip if auto height was turned off - if (!visConfig.autoFitRowToContent) { - return; - } - // update counter to remount grid from scratch - setDataGridUpdateCounter((counter) => counter + 1); - }, [visConfig.autoFitRowToContent, table, sort, pagination, columnsWidth]); - return ( <> {title && ( @@ -139,7 +119,6 @@ export const TableVisBasic = memo( )} Date: Thu, 28 Oct 2021 10:45:08 -0700 Subject: [PATCH 3/4] Fix deprecated `popperPlacement` prop --- .../inventory_view/components/waffle/waffle_time_controls.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_time_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_time_controls.tsx index 7ac618987b422..8c85ed718ad6b 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_time_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_time_controls.tsx @@ -65,7 +65,7 @@ export const WaffleTimeControls = withTheme(({ interval }: Props) => { injectTimes={currentMoment ? [currentMoment] : []} isLoading={isAutoReloading} onChange={handleChangeDate} - popperPlacement="top-end" + popoverPlacement="top-end" selected={currentMoment} shouldCloseOnSelect showTimeSelect From 064e01b2e60c75cce4eb8966072ca96727b37726 Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Thu, 28 Oct 2021 12:33:17 -0700 Subject: [PATCH 4/4] Update test snapshots with table cell change --- .../__snapshots__/data_view.test.tsx.snap | 4 +- .../url/__snapshots__/url.test.tsx.snap | 12 ++-- .../workpad_table.stories.storyshot | 24 +++---- .../report_listing.test.tsx.snap | 72 +++++++++---------- 4 files changed, 56 insertions(+), 56 deletions(-) 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 7773f2209bf96..b59756ef1e90e 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 @@ -1158,7 +1158,7 @@ exports[`Inspector Data View component should render single table without select textOnly={false} >