From 6388c3b4d41e0e0caf7398ccfb7d248f1856de5d Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Fri, 19 Nov 2021 10:45:45 -0600 Subject: [PATCH 01/17] Bumping EUI to v41.2.0 --- package.json | 2 +- src/dev/license_checker/config.ts | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 84bd703dba4ef7..bd3ef98a2078e8 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,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.0.0", + "@elastic/eui": "41.2.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 078786abb8c647..8beeab9f80b5fb 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@41.0.0': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@41.2.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 9ae9d163a0463b..5a2359b0e93982 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1697,10 +1697,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.0.0": - version "41.0.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-41.0.0.tgz#64d7efef5a15d5495f2db1eebd5384e412296e06" - integrity sha512-+cExohPqWzahLW6Z6X6dc0voaDkYQ4ruHMSFe0H78YhTECrbu+f9mWDx841C7WDtvKKJVPbCZ/dyTeB2Ogwabw== +"@elastic/eui@41.2.0": + version "41.2.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-41.2.0.tgz#290f1361ab18439d396a5df4a9539e8aad7dfdfb" + integrity sha512-OcEPWeKJ+b3DgEg3dO+iOhhCqCIqdoWNkBagJpzOilWiWys2rRg8uKoOI0KJeii63pyChKPMoBnhn2UjMio+7w== dependencies: "@types/chroma-js" "^2.0.0" "@types/lodash" "^4.14.160" From 709c15f3df1f73a138ecdff7a24971424504c442 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Fri, 19 Nov 2021 11:15:22 -0600 Subject: [PATCH 02/17] Updating translations for EUI Super Select. --- src/core/public/i18n/i18n_eui_mapping.tsx | 15 ++++++++++----- .../plugins/translations/translations/ja-JP.json | 1 - .../plugins/translations/translations/zh-CN.json | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 79180575129ea1..424a20eaa27530 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -663,6 +663,10 @@ export const getEuiContextMapping = (): EuiTokensObject => { defaultMessage: '+ {messagesLength} more', values: { messagesLength }, }), + 'euiErrorBoundary.error': i18n.translate('core.euiErrorBoundary.error', { + defaultMessage: 'Error', + description: 'Error boundary for uncaught exceptions when rendering part of the application', + }), 'euiNotificationEventMessages.accordionAriaLabelButtonText': ({ messagesLength, eventName, @@ -1046,12 +1050,13 @@ export const getEuiContextMapping = (): EuiTokensObject => { description: 'Displayed in a button that shows date picker', } ), - 'euiSuperSelect.screenReaderAnnouncement': ({ optionsCount }: EuiValues) => - i18n.translate('core.euiSuperSelect.screenReaderAnnouncement', { + 'euiSuperSelect.screenReaderAnnouncement': i18n.translate( + 'core.euiSuperSelect.screenReaderAnnouncement', + { defaultMessage: - 'You are in a form selector of {optionsCount} items and must select a single option. Use the up and down keys to navigate or escape to close.', - values: { optionsCount }, - }), + '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': ({ selectedValue }: EuiValues) => i18n.translate('core.euiSuperSelectControl.selectAnOption', { defaultMessage: 'Select an option: {selectedValue}, is selected', diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index daecf9ad68536b..99c987ef8ea93b 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -491,7 +491,6 @@ "core.euiStyleSelector.labelExpanded": "拡張密度", "core.euiStyleSelector.labelNormal": "標準密度", "core.euiSuperDatePicker.showDatesButtonLabel": "日付を表示", - "core.euiSuperSelect.screenReaderAnnouncement": "{optionsCount} 件のアイテムのフォームセレクターを使用しています。1 つのオプションを選択する必要があります。上下の矢印キーで移動するか、Escキーで閉じます。", "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 5e57556b22c92d..96037dc9bb71f1 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -496,7 +496,6 @@ "core.euiStyleSelector.labelExpanded": "扩展密度", "core.euiStyleSelector.labelNormal": "正常密度", "core.euiSuperDatePicker.showDatesButtonLabel": "显示日期", - "core.euiSuperSelect.screenReaderAnnouncement": "您位于包含 {optionsCount} 个项目的表单选择器中,必须选择单个选项。使用向上和向下箭头键导航,使用 Esc 键关闭。", "core.euiSuperSelectControl.selectAnOption": "选择选项:{selectedValue} 已选", "core.euiSuperUpdateButton.cannotUpdateTooltip": "无法更新", "core.euiSuperUpdateButton.clickToApplyTooltip": "单击以应用", From ac7ae096e6fbe5e75bd43d4d2301371a5bd91af1 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Fri, 19 Nov 2021 17:40:17 -0600 Subject: [PATCH 03/17] Bumping to v41.2.1 for an EUI fix. --- package.json | 2 +- src/dev/license_checker/config.ts | 2 +- yarn.lock | 22 ++++++++++++++++++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index bd3ef98a2078e8..b15b15d91409e8 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,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.0", + "@elastic/eui": "41.2.1", "@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 8beeab9f80b5fb..52151fd04c91a4 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@41.2.0': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@41.2.1': ['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 5a2359b0e93982..77e4b6edaf7f75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1697,10 +1697,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.0": - version "41.2.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-41.2.0.tgz#290f1361ab18439d396a5df4a9539e8aad7dfdfb" - integrity sha512-OcEPWeKJ+b3DgEg3dO+iOhhCqCIqdoWNkBagJpzOilWiWys2rRg8uKoOI0KJeii63pyChKPMoBnhn2UjMio+7w== +"@elastic/eui@41.2.1": + version "41.2.1" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-41.2.1.tgz#e8348587592e87aa5438faa24158f2bc3f8fd839" + integrity sha512-3TCJCp5EGgLeHCVUPspVBlvw/1pXdQ7eoFDJ5ZwLt48J+BAolduy/+MdrlV9sMSeuVr+wHaOau2KTff1hue3Iw== dependencies: "@types/chroma-js" "^2.0.0" "@types/lodash" "^4.14.160" @@ -1740,6 +1740,7 @@ 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" @@ -30090,6 +30091,19 @@ yargs@^17.0.1: y18n "^5.0.5" yargs-parser "^20.2.2" +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" From 25c0177bbb3c33698c22bf91dfdf897d7c79d946 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 22 Nov 2021 09:58:01 -0600 Subject: [PATCH 04/17] Updating ten Jest snapshots --- .../__snapshots__/i18n_service.test.tsx.snap | 3 +- .../__snapshots__/data_view.test.tsx.snap | 102 ++++---- .../__snapshots__/source.test.tsx.snap | 233 ++++++++++-------- .../visualization_noresults.test.js.snap | 39 ++- .../__snapshots__/policy_table.test.tsx.snap | 99 ++++---- .../roles_grid_page.test.tsx.snap | 133 +++++----- .../__snapshots__/prompt_page.test.tsx.snap | 4 +- .../unauthenticated_page.test.tsx.snap | 2 +- .../reset_session_page.test.tsx.snap | 2 +- .../__snapshots__/index.test.tsx.snap | 20 +- 10 files changed, 362 insertions(+), 275 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 e93ef34c38025c..1c394112a404ca 100644 --- a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap +++ b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap @@ -98,6 +98,7 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiDataGridToolbar.fullScreenButtonActive": "Exit full screen", "euiDatePopoverButton.invalidTitle": [Function], "euiDatePopoverButton.outdatedTitle": [Function], + "euiErrorBoundary.error": "Error", "euiFieldPassword.maskPassword": "Mask password", "euiFieldPassword.showPassword": "Show password as plain text. Note: this will visually expose your password on the screen.", "euiFilePicker.clearSelectedFiles": "Clear selected files", @@ -218,7 +219,7 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiStyleSelector.labelExpanded": "Expanded density", "euiStyleSelector.labelNormal": "Normal density", "euiSuperDatePicker.showDatesButtonLabel": "Show dates", - "euiSuperSelect.screenReaderAnnouncement": [Function], + "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", "euiSuperUpdateButton.clickToApplyTooltip": "Click to apply", 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 b59756ef1e90e1..3262ee70dff860 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 @@ -173,56 +173,74 @@ exports[`Inspector Data View component should render empty state 1`] = ` } > -
- -

- - No data available - -

-
- - -
- - -
-

- +

- The element did not provide any data. - -

+ + No data available + +

+ + + + +
+ + +
+

+ + The element did not provide any data. + +

+
+
+ +
- -
-
-
+
+
+ + diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/__snapshots__/source.test.tsx.snap b/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/__snapshots__/source.test.tsx.snap index 352006ba1c83b6..b78463a44e9773 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/__snapshots__/source.test.tsx.snap +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/__snapshots__/source.test.tsx.snap @@ -136,129 +136,144 @@ exports[`Source Viewer component renders error state 1`] = ` } > -
- - - -
- - -

- An Error Occurred -

-
- - - + + + +
+
- - -
-
- Could not fetch data at this time. Refresh the tab to try again. - +

-
- - + + + - - - - -
+ + + +

+
+
+ +
- - - -
+
+ + + `; diff --git a/src/plugins/visualizations/public/components/__snapshots__/visualization_noresults.test.js.snap b/src/plugins/visualizations/public/components/__snapshots__/visualization_noresults.test.js.snap index 56e2cb1b60f3c7..98d37568e45416 100644 --- a/src/plugins/visualizations/public/components/__snapshots__/visualization_noresults.test.js.snap +++ b/src/plugins/visualizations/public/components/__snapshots__/visualization_noresults.test.js.snap @@ -6,29 +6,42 @@ exports[`VisualizationNoResults should render according to snapshot 1`] = ` data-test-subj="visNoResult" >
-
-
+ +
+
- No results found + +
+
+ No results found +
+
+
-
+
`; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/__snapshots__/policy_table.test.tsx.snap b/x-pack/plugins/index_lifecycle_management/__jest__/__snapshots__/policy_table.test.tsx.snap index 8f375305d359e7..f4d7fc149a6948 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/__snapshots__/policy_table.test.tsx.snap +++ b/x-pack/plugins/index_lifecycle_management/__jest__/__snapshots__/policy_table.test.tsx.snap @@ -42,57 +42,70 @@ exports[`policy table shows empty state when there are no policies 1`] = ` role="main" >
-
-

- Create your first index lifecycle policy -

- -
-

- An index lifecycle policy helps you manage your indices as they age. -

-
- -
- +

+ Create your first index lifecycle policy +

+ +
+
+

+ An index lifecycle policy helps you manage your indices as they age. +

+
+ +
+ +
+
+
`; diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/__snapshots__/roles_grid_page.test.tsx.snap b/x-pack/plugins/security/public/management/roles/roles_grid/__snapshots__/roles_grid_page.test.tsx.snap index 6e99fdfd7743c4..ce469faf1237e5 100644 --- a/x-pack/plugins/security/public/management/roles/roles_grid/__snapshots__/roles_grid_page.test.tsx.snap +++ b/x-pack/plugins/security/public/management/roles/roles_grid/__snapshots__/roles_grid_page.test.tsx.snap @@ -40,76 +40,91 @@ exports[` renders permission denied if required 1`] = ` } > -
- - - -
- - -

- - You need permission to manage roles - -

-
- - - + + +
+
- - -
-

+

+ + You need permission to manage roles + +

+ + - - Contact your system administrator. - -

+ +
+ + +
+

+ + Contact your system administrator. + +

+
+
+ +
- - -
-
+
+
+
+
diff --git a/x-pack/plugins/security/server/__snapshots__/prompt_page.test.tsx.snap b/x-pack/plugins/security/server/__snapshots__/prompt_page.test.tsx.snap index 8e2b2a9a1f2228..99502f13d82c48 100644 --- a/x-pack/plugins/security/server/__snapshots__/prompt_page.test.tsx.snap +++ b/x-pack/plugins/security/server/__snapshots__/prompt_page.test.tsx.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PromptPage renders as expected with additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; +exports[`PromptPage renders as expected with additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; -exports[`PromptPage renders as expected without additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; +exports[`PromptPage renders as expected without additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; diff --git a/x-pack/plugins/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap b/x-pack/plugins/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap index 62200cb288e09d..720c30e9da211d 100644 --- a/x-pack/plugins/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap +++ b/x-pack/plugins/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`UnauthenticatedPage renders as expected 1`] = `"ElasticMockedFonts

We couldn't log you in

We hit an authentication error. Please check your credentials and try again. If you still can't log in, contact your system administrator.

"`; +exports[`UnauthenticatedPage renders as expected 1`] = `"ElasticMockedFonts

We couldn't log you in

We hit an authentication error. Please check your credentials and try again. If you still can't log in, contact your system administrator.

"`; diff --git a/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap b/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap index 8b882c9a6b442c..6df764625d7097 100644 --- a/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap +++ b/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ResetSessionPage renders as expected 1`] = `"ElasticMockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; +exports[`ResetSessionPage renders as expected 1`] = `"ElasticMockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; 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 64eca93be8bc3c..9be84b058b680e 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 @@ -32,11 +32,23 @@ exports[`TrustedAppsGrid renders correctly initially 1`] = ` class="body-content undefined" >
- - No items found - +
+
+
+ + No items found + +
+
+
From 514e47237d0e441994d3ba930b1839bc7d71229a Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 22 Nov 2021 10:38:30 -0600 Subject: [PATCH 05/17] Removing reference to packaged datepicker now in EUI. --- .../canvas/shareable_runtime/webpack.config.js | 2 +- x-pack/plugins/canvas/storybook/storyshots.test.tsx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js index b8074436d350b3..bd32b637c1e982 100644 --- a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js +++ b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js @@ -188,7 +188,7 @@ module.exports = { { test: [ require.resolve('@elastic/eui/es/components/drag_and_drop'), - require.resolve('@elastic/eui/packages/react-datepicker'), + // require.resolve('@elastic/eui/packages/react-datepicker'), require.resolve('highlight.js'), ], use: require.resolve('null-loader'), diff --git a/x-pack/plugins/canvas/storybook/storyshots.test.tsx b/x-pack/plugins/canvas/storybook/storyshots.test.tsx index 51afc10bea5e13..3682874249a6a6 100644 --- a/x-pack/plugins/canvas/storybook/storyshots.test.tsx +++ b/x-pack/plugins/canvas/storybook/storyshots.test.tsx @@ -37,12 +37,12 @@ Date.now = jest.fn(() => testTime.getTime()); jest.mock('../public/lib/ui_metric', () => ({ trackCanvasUiMetric: () => {} })); // Mock react-datepicker dep used by eui to avoid rendering the entire large component -jest.mock('@elastic/eui/packages/react-datepicker', () => { - return { - __esModule: true, - default: 'ReactDatePicker', - }; -}); +// jest.mock('@elastic/eui/packages/react-datepicker', () => { +// return { +// __esModule: true, +// default: 'ReactDatePicker', +// }; +// }); // Mock React Portal for components that use modals, tooltips, etc // @ts-expect-error Portal mocks are notoriously difficult to type From 68aa20297f32eff34588d42a8e42fcb7170b1b5f Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 22 Nov 2021 10:52:30 -0600 Subject: [PATCH 06/17] Final removal of packaged Datepicker reference. --- x-pack/plugins/canvas/shareable_runtime/webpack.config.js | 1 - x-pack/plugins/canvas/storybook/storyshots.test.tsx | 8 -------- 2 files changed, 9 deletions(-) diff --git a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js index bd32b637c1e982..42e96ab4471fef 100644 --- a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js +++ b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js @@ -188,7 +188,6 @@ module.exports = { { test: [ require.resolve('@elastic/eui/es/components/drag_and_drop'), - // require.resolve('@elastic/eui/packages/react-datepicker'), require.resolve('highlight.js'), ], use: require.resolve('null-loader'), diff --git a/x-pack/plugins/canvas/storybook/storyshots.test.tsx b/x-pack/plugins/canvas/storybook/storyshots.test.tsx index 3682874249a6a6..25fb06f2cdd3d9 100644 --- a/x-pack/plugins/canvas/storybook/storyshots.test.tsx +++ b/x-pack/plugins/canvas/storybook/storyshots.test.tsx @@ -36,14 +36,6 @@ Date.now = jest.fn(() => testTime.getTime()); // Mock telemetry service jest.mock('../public/lib/ui_metric', () => ({ trackCanvasUiMetric: () => {} })); -// Mock react-datepicker dep used by eui to avoid rendering the entire large component -// jest.mock('@elastic/eui/packages/react-datepicker', () => { -// return { -// __esModule: true, -// default: 'ReactDatePicker', -// }; -// }); - // Mock React Portal for components that use modals, tooltips, etc // @ts-expect-error Portal mocks are notoriously difficult to type ReactDOM.createPortal = jest.fn((element) => element); From 10a75b165694e61ec8bfdb02a644575c02e18f40 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 22 Nov 2021 17:34:48 -0600 Subject: [PATCH 07/17] Updating snapshots and datagrid test defaults. --- .../apps/dashboard/url_field_formatter.ts | 2 +- .../apps/discover/_data_grid_field_data.ts | 2 +- .../apps/visualize/_embedding_chart.ts | 2 +- .../page_objects/visualize_chart_page.ts | 12 ++- test/functional/services/data_grid.ts | 12 ++- .../asset_manager.stories.storyshot | 37 ++++++--- .../empty_prompt.stories.storyshot | 80 +++++++++++-------- .../saved_elements_modal.stories.storyshot | 59 ++++++++------ .../test/functional/page_objects/lens_page.ts | 10 +-- 9 files changed, 127 insertions(+), 89 deletions(-) diff --git a/test/functional/apps/dashboard/url_field_formatter.ts b/test/functional/apps/dashboard/url_field_formatter.ts index 254d71294d8c70..16cdb62768219b 100644 --- a/test/functional/apps/dashboard/url_field_formatter.ts +++ b/test/functional/apps/dashboard/url_field_formatter.ts @@ -56,7 +56,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await common.navigateToApp('dashboard'); await dashboard.loadSavedDashboard('dashboard with table'); await dashboard.waitForRenderComplete(); - const fieldLink = await visChart.getFieldLinkInVisTable(`${fieldName}: Descending`, 1); + const fieldLink = await visChart.getFieldLinkInVisTable(`${fieldName}: Descending`); await clickFieldAndCheckUrl(fieldLink); }); diff --git a/test/functional/apps/discover/_data_grid_field_data.ts b/test/functional/apps/discover/_data_grid_field_data.ts index 91c2d5914732d9..4a4e06e28c3212 100644 --- a/test/functional/apps/discover/_data_grid_field_data.ts +++ b/test/functional/apps/discover/_data_grid_field_data.ts @@ -71,7 +71,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.waitUntilSearchingHasFinished(); await retry.waitFor('first cell contains expected timestamp', async () => { - const cell = await dataGrid.getCellElement(1, 3); + const cell = await dataGrid.getCellElement(0, 2); const text = await cell.getVisibleText(); return text === expectedTimeStamp; }); diff --git a/test/functional/apps/visualize/_embedding_chart.ts b/test/functional/apps/visualize/_embedding_chart.ts index 93ab2987dc4a8e..808c645076fb2a 100644 --- a/test/functional/apps/visualize/_embedding_chart.ts +++ b/test/functional/apps/visualize/_embedding_chart.ts @@ -83,7 +83,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow to change timerange from the visualization in embedded mode', async () => { await retry.try(async () => { - await PageObjects.visChart.filterOnTableCell(1, 7); + await PageObjects.visChart.filterOnTableCell(1, 6); await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); diff --git a/test/functional/page_objects/visualize_chart_page.ts b/test/functional/page_objects/visualize_chart_page.ts index b0e9e21d07b0bc..514661fbc606d2 100644 --- a/test/functional/page_objects/visualize_chart_page.ts +++ b/test/functional/page_objects/visualize_chart_page.ts @@ -342,10 +342,14 @@ export class VisualizeChartPageObject extends FtrService { return await this.testSubjects.getVisibleText('dataGridHeader'); } - public async getFieldLinkInVisTable(fieldName: string, rowIndex: number = 1) { - const headers = await this.dataGrid.getHeaders(); - const fieldColumnIndex = headers.indexOf(fieldName); - const cell = await this.dataGrid.getCellElement(rowIndex, fieldColumnIndex + 1); + public async getFieldLinkInVisTable( + fieldName: string, + rowIndex: number = 0, + colIndex: number = 0 + ) { + // const headers = await this.dataGrid.getHeaders(); + // const fieldColumnIndex = headers.indexOf(fieldName); + const cell = await this.dataGrid.getCellElement(rowIndex, colIndex); return await cell.findByTagName('a'); } diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts index f54e7b65a46e2a..7f283a74e08679 100644 --- a/test/functional/services/data_grid.ts +++ b/test/functional/services/data_grid.ts @@ -85,14 +85,12 @@ export class DataGridService extends FtrService { * @param rowIndex data row index starting from 1 (1 means 1st row) * @param columnIndex column index starting from 1 (1 means 1st column) */ - public async getCellElement(rowIndex: number, columnIndex: number) { - const table = await this.find.byCssSelector('.euiDataGrid'); - const $ = await table.parseDomContent(); - const columnNumber = $('.euiDataGridHeaderCell__content').length; + public async getCellElement(rowIndex: number = 0, columnIndex: number = 0) { + // const table = await this.find.byCssSelector('.euiDataGrid'); + // const $ = await table.parseDomContent(); + // const columnNumber = $('.euiDataGridHeaderCell__content').length; return await this.find.byCssSelector( - `[data-test-subj="dataGridWrapper"] [data-test-subj="dataGridRowCell"]:nth-of-type(${ - columnNumber * (rowIndex - 1) + columnIndex + 1 - })` + `[data-test-subj="dataGridWrapper"] [data-test-subj="dataGridRowCell"][data-gridcell-id="${rowIndex},${columnIndex}"]` ); } diff --git a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot index b8013818ca58f2..d47ecf71b2293b 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot @@ -109,21 +109,34 @@ exports[`Storyshots components/Assets/AssetManager no assets 1`] = ` className="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow canvasAssetManager__emptyPanel" >
-
-

- Import your assets to get started -

+
+ +
+
+
+

+ Import your assets to get started +

+
+
+
diff --git a/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/empty_prompt.stories.storyshot b/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/empty_prompt.stories.storyshot index 6d782713d8fc17..8f00060a1dd1c3 100644 --- a/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/empty_prompt.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/empty_prompt.stories.storyshot @@ -16,49 +16,61 @@ exports[`Storyshots Home/Components/Empty Prompt Empty Prompt 1`] = ` className="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusNone euiPanel--subdued euiPanel--noShadow euiPanel--noBorder" >
-
-

- Add your first workpad -

-
+ className="euiEmptyPrompt__icon" + > + +
-

- Create a new workpad, start from a template, or import a workpad JSON file by dropping it here. -

-

- New to Canvas? - - +

Add your first workpad - - . -

+

+ +
+
+

+ Create a new workpad, start from a template, or import a workpad JSON file by dropping it here. +

+

+ New to Canvas? + + + Add your first workpad + + . +

+
+ +
-
+
diff --git a/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/saved_elements_modal.stories.storyshot b/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/saved_elements_modal.stories.storyshot index f019f9dc8f23d3..23202a7a1fb882 100644 --- a/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/saved_elements_modal.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/saved_elements_modal.stories.storyshot @@ -86,36 +86,49 @@ exports[`Storyshots components/SavedElementsModal no custom elements 1`] = ` className="euiSpacer euiSpacer--l" />
-
-

- Add new elements -

-
+ className="euiEmptyPrompt__icon" + > + +
-

- Group and save workpad elements to create new elements -

+
+

+ Add new elements +

+ +
+
+

+ Group and save workpad elements to create new elements +

+
+ +
- +
diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index 78b9762e3889ae..9e03eb17a67c66 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -817,13 +817,11 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont }, async getDatatableCell(rowIndex = 0, colIndex = 0) { - const table = await find.byCssSelector('.euiDataGrid'); - const $ = await table.parseDomContent(); - const columnNumber = $('.euiDataGridHeaderCell__content').length; + // const table = await find.byCssSelector('.euiDataGrid'); + // const $ = await table.parseDomContent(); + // const columnNumber = $('.euiDataGridHeaderCell__content').length; return await find.byCssSelector( - `[data-test-subj="lnsDataTable"] [data-test-subj="dataGridRowCell"]:nth-child(${ - rowIndex * columnNumber + colIndex + 2 - })` + `[data-test-subj="lnsDataTable"] [data-test-subj="dataGridRowCell"][data-gridcell-id="${rowIndex},${colIndex}"]` ); }, From 12f31a95785479458b0f6f33fdf0f8accfb6fbe6 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 23 Nov 2021 11:06:21 -0600 Subject: [PATCH 08/17] Fixing last functional test for data grid --- .../apps/visualize/_embedding_chart.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/functional/apps/visualize/_embedding_chart.ts b/test/functional/apps/visualize/_embedding_chart.ts index 808c645076fb2a..eaf38092a274bc 100644 --- a/test/functional/apps/visualize/_embedding_chart.ts +++ b/test/functional/apps/visualize/_embedding_chart.ts @@ -83,22 +83,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow to change timerange from the visualization in embedded mode', async () => { await retry.try(async () => { - await PageObjects.visChart.filterOnTableCell(1, 6); + await PageObjects.visChart.filterOnTableCell(0, 5); await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); const data = await PageObjects.visChart.getTableVisContent(); expect(data).to.be.eql([ - ['03:00', '0B', '1'], ['03:00', '1.953KB', '1'], ['03:00', '3.906KB', '1'], - ['03:00', '5.859KB', '2'], - ['03:10', '0B', '1'], - ['03:10', '5.859KB', '1'], - ['03:10', '7.813KB', '1'], - ['03:15', '0B', '1'], - ['03:15', '1.953KB', '1'], - ['03:20', '1.953KB', '1'], + ['03:15', '3.906KB', '1'], + ['03:15', '7.813KB', '2'], + ['03:15', '9.766KB', '1'], + ['03:20', '7.813KB', '2'], + ['03:25', '5.859KB', '1'], + ['03:30', '1.953KB', '1'], + ['03:35', '3.906KB', '1'], + ['03:35', '7.813KB', '1'], ]); }); }); From de5dd8911044d587be9adb6bfdf2490ff25811e0 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 23 Nov 2021 12:53:24 -0600 Subject: [PATCH 09/17] Reverting data source to upstream example for one test. --- .../apps/visualize/_embedding_chart.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/functional/apps/visualize/_embedding_chart.ts b/test/functional/apps/visualize/_embedding_chart.ts index eaf38092a274bc..9531eafc33bedc 100644 --- a/test/functional/apps/visualize/_embedding_chart.ts +++ b/test/functional/apps/visualize/_embedding_chart.ts @@ -83,22 +83,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow to change timerange from the visualization in embedded mode', async () => { await retry.try(async () => { - await PageObjects.visChart.filterOnTableCell(0, 5); + await PageObjects.visChart.filterOnTableCell(0, 6); await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); const data = await PageObjects.visChart.getTableVisContent(); expect(data).to.be.eql([ + ['03:00', '0B', '1'], ['03:00', '1.953KB', '1'], ['03:00', '3.906KB', '1'], - ['03:15', '3.906KB', '1'], - ['03:15', '7.813KB', '2'], - ['03:15', '9.766KB', '1'], - ['03:20', '7.813KB', '2'], - ['03:25', '5.859KB', '1'], - ['03:30', '1.953KB', '1'], - ['03:35', '3.906KB', '1'], - ['03:35', '7.813KB', '1'], + ['03:00', '5.859KB', '2'], + ['03:10', '0B', '1'], + ['03:10', '5.859KB', '1'], + ['03:10', '7.813KB', '1'], + ['03:15', '0B', '1'], + ['03:15', '1.953KB', '1'], + ['03:20', '1.953KB', '1'], ]); }); }); From bd3ff259d287b2de284f72748503edab688c1b56 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 23 Nov 2021 14:54:02 -0600 Subject: [PATCH 10/17] Adding a fix for _data_table.ts test. --- test/functional/apps/visualize/_data_table.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/visualize/_data_table.ts b/test/functional/apps/visualize/_data_table.ts index 14181c084a77fc..77973b8fb9b67e 100644 --- a/test/functional/apps/visualize/_data_table.ts +++ b/test/functional/apps/visualize/_data_table.ts @@ -268,7 +268,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should apply correct filter', async () => { - await PageObjects.visChart.filterOnTableCell(1, 3); + await PageObjects.visChart.filterOnTableCell(0, 2); await PageObjects.visChart.waitForVisualizationRenderingStabilized(); const data = await PageObjects.visChart.getTableVisContent(); expect(data).to.be.eql([ From 2768738fc83b3c5b3a400851960cdbb5af785139 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 23 Nov 2021 16:16:57 -0600 Subject: [PATCH 11/17] Adding a fix for _data_table)notimeindex_filters.ts --- .../apps/visualize/_data_table_notimeindex_filters.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/visualize/_data_table_notimeindex_filters.ts b/test/functional/apps/visualize/_data_table_notimeindex_filters.ts index ef664bf4b30545..51ceef947bfac1 100644 --- a/test/functional/apps/visualize/_data_table_notimeindex_filters.ts +++ b/test/functional/apps/visualize/_data_table_notimeindex_filters.ts @@ -70,7 +70,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await retry.try(async () => { // hover and click on cell to filter - await PageObjects.visChart.filterOnTableCell(1, 2); + await PageObjects.visChart.filterOnTableCell(0, 1); await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); From 285ed1b62fc953264007265296e46211b8c4dfb1 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 24 Nov 2021 15:45:02 -0600 Subject: [PATCH 12/17] Bumping to 41.2.2 patch fix --- package.json | 2 +- src/dev/license_checker/config.ts | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 075cd27ef861ed..00a1238c93b60b 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,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.1", + "@elastic/eui": "41.2.2", "@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 52151fd04c91a4..d6f16c56410846 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@41.2.1': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@41.2.2': ['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 16e6ca67bac986..b3c2df2d24f7c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1697,10 +1697,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.1": - version "41.2.1" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-41.2.1.tgz#e8348587592e87aa5438faa24158f2bc3f8fd839" - integrity sha512-3TCJCp5EGgLeHCVUPspVBlvw/1pXdQ7eoFDJ5ZwLt48J+BAolduy/+MdrlV9sMSeuVr+wHaOau2KTff1hue3Iw== +"@elastic/eui@41.2.2": + version "41.2.2" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-41.2.2.tgz#95db66a94389d450a2fbb4a242b5fa4f30dde2e2" + integrity sha512-//MctF/vvjx6T5wE/wHLgQXMzogPnjhHpymN1v5aaWqvVnLVLqQlACm29+VT5mu2vdWdVyaWGP8R8VVSKVrm0g== dependencies: "@types/chroma-js" "^2.0.0" "@types/lodash" "^4.14.160" From d606dee301ebdefcb90f6d501a9a059d4d000273 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 29 Nov 2021 10:29:41 -0600 Subject: [PATCH 13/17] Removing unneeded test code and updating comment --- test/functional/page_objects/visualize_chart_page.ts | 2 -- test/functional/services/data_grid.ts | 8 ++------ x-pack/test/functional/page_objects/lens_page.ts | 3 --- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/test/functional/page_objects/visualize_chart_page.ts b/test/functional/page_objects/visualize_chart_page.ts index 514661fbc606d2..99e57eeb531a82 100644 --- a/test/functional/page_objects/visualize_chart_page.ts +++ b/test/functional/page_objects/visualize_chart_page.ts @@ -347,8 +347,6 @@ export class VisualizeChartPageObject extends FtrService { rowIndex: number = 0, colIndex: number = 0 ) { - // const headers = await this.dataGrid.getHeaders(); - // const fieldColumnIndex = headers.indexOf(fieldName); const cell = await this.dataGrid.getCellElement(rowIndex, colIndex); return await cell.findByTagName('a'); } diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts index 7f283a74e08679..d49ef5fa0990a1 100644 --- a/test/functional/services/data_grid.ts +++ b/test/functional/services/data_grid.ts @@ -81,14 +81,10 @@ export class DataGridService extends FtrService { /** * Returns a grid cell element by row & column indexes. - * The row offset equals 1 since the first row of data grid is the header row. - * @param rowIndex data row index starting from 1 (1 means 1st row) - * @param columnIndex column index starting from 1 (1 means 1st column) + * @param rowIndex data row index starting from 0 (0 means 1st row) + * @param columnIndex column index starting from 0 (0 means 1st column) */ public async getCellElement(rowIndex: number = 0, columnIndex: number = 0) { - // const table = await this.find.byCssSelector('.euiDataGrid'); - // const $ = await table.parseDomContent(); - // const columnNumber = $('.euiDataGridHeaderCell__content').length; return await this.find.byCssSelector( `[data-test-subj="dataGridWrapper"] [data-test-subj="dataGridRowCell"][data-gridcell-id="${rowIndex},${columnIndex}"]` ); diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index 9e03eb17a67c66..565601209fc963 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -817,9 +817,6 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont }, async getDatatableCell(rowIndex = 0, colIndex = 0) { - // const table = await find.byCssSelector('.euiDataGrid'); - // const $ = await table.parseDomContent(); - // const columnNumber = $('.euiDataGridHeaderCell__content').length; return await find.byCssSelector( `[data-test-subj="lnsDataTable"] [data-test-subj="dataGridRowCell"][data-gridcell-id="${rowIndex},${colIndex}"]` ); From 0b3547c4106c9a538a03f7180d7c7ad038171232 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 6 Dec 2021 15:25:54 -0600 Subject: [PATCH 14/17] Bumping to 41.2.3 for bug fix. --- package.json | 2 +- yarn.lock | 23 +++++------------------ 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 034a44c60dd1da..ee2926cdeffd91 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.2", + "@elastic/eui": "41.2.3", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.3.0", "@elastic/node-crypto": "1.2.1", diff --git a/yarn.lock b/yarn.lock index d484ddb6e4866f..6c45f9b22dc55d 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.2": - version "41.2.2" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-41.2.2.tgz#95db66a94389d450a2fbb4a242b5fa4f30dde2e2" - integrity sha512-//MctF/vvjx6T5wE/wHLgQXMzogPnjhHpymN1v5aaWqvVnLVLqQlACm29+VT5mu2vdWdVyaWGP8R8VVSKVrm0g== +"@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== dependencies: "@types/chroma-js" "^2.0.0" "@types/lodash" "^4.14.160" @@ -29850,7 +29850,7 @@ yargs@^17.0.1: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.2.1: +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== @@ -29895,19 +29895,6 @@ 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 3738b140bcf074f16d61400298d797002d732861 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 6 Dec 2021 15:27:11 -0600 Subject: [PATCH 15/17] Adding a missed file. --- src/dev/license_checker/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index fefdc0f7036554..9674694c0d6559 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.2': ['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 }; From 9b0235640df25e17d6f62b756fcb1585f2e8111d Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 6 Dec 2021 17:21:40 -0600 Subject: [PATCH 16/17] Adjusting test for tooltip overlap assertion. --- .../cypress/integration/timelines/row_renderers.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/cypress/integration/timelines/row_renderers.spec.ts b/x-pack/plugins/security_solution/cypress/integration/timelines/row_renderers.spec.ts index 2219339d0577d4..ed2bc8b98d24dc 100644 --- a/x-pack/plugins/security_solution/cypress/integration/timelines/row_renderers.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/timelines/row_renderers.spec.ts @@ -98,7 +98,7 @@ describe('Row renderers', () => { expect( elementsOverlap($googleLinkTooltip, $signatureTooltip), 'tooltips do not overlap' - ).to.equal(false); + ).to.equal(true); }); }); }); From de8c73e2a75ed207d61d3af2785bcceaa474551e Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 8 Dec 2021 10:21:41 -0600 Subject: [PATCH 17/17] Updating two tests in Security Solution Platform. --- .../integration/detection_alerts/cti_enrichments.spec.ts | 6 ++++-- .../cypress/integration/timelines/row_renderers.spec.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/cti_enrichments.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/cti_enrichments.spec.ts index 0e87378f4ef962..075616606b4ee9 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/cti_enrichments.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/cti_enrichments.spec.ts @@ -75,7 +75,7 @@ describe('CTI Enrichment', () => { it('Displays persisted enrichments on the JSON view', () => { const expectedEnrichment = [ { - feed: {}, + feed: { name: 'AbuseCH malware' }, indicator: { first_seen: '2021-03-10T08:02:14.000Z', file: { @@ -113,6 +113,7 @@ describe('CTI Enrichment', () => { it('Displays threat indicator details on the threat intel tab', () => { const expectedThreatIndicatorData = [ + { field: 'feed.name', value: 'AbuseCH malware' }, { field: 'indicator.file.hash.md5', value: '9b6c3518a91d23ed77504b5416bfb5b3' }, { field: 'indicator.file.hash.sha256', @@ -173,6 +174,7 @@ describe('CTI Enrichment', () => { const indicatorMatchRuleEnrichment = { field: 'myhash.mysha256', value: 'a04ac6d98ad989312783d4fe3456c53730b212c79a426fb215708b6c6daa3de3', + feedName: 'AbuseCH malware', }; const investigationTimeEnrichment = { field: 'source.ip', @@ -188,7 +190,7 @@ describe('CTI Enrichment', () => { .should('exist') .should( 'have.text', - `${indicatorMatchRuleEnrichment.field} ${indicatorMatchRuleEnrichment.value}` + `${indicatorMatchRuleEnrichment.field} ${indicatorMatchRuleEnrichment.value} from ${indicatorMatchRuleEnrichment.feedName}` ); cy.get(`${INVESTIGATION_TIME_ENRICHMENT_SECTION} ${THREAT_DETAILS_ACCORDION}`) diff --git a/x-pack/plugins/security_solution/cypress/integration/timelines/row_renderers.spec.ts b/x-pack/plugins/security_solution/cypress/integration/timelines/row_renderers.spec.ts index ed2bc8b98d24dc..2219339d0577d4 100644 --- a/x-pack/plugins/security_solution/cypress/integration/timelines/row_renderers.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/timelines/row_renderers.spec.ts @@ -98,7 +98,7 @@ describe('Row renderers', () => { expect( elementsOverlap($googleLinkTooltip, $signatureTooltip), 'tooltips do not overlap' - ).to.equal(true); + ).to.equal(false); }); }); });