diff --git a/package.json b/package.json index fb41d811a1525..c9709f422161d 100644 --- a/package.json +++ b/package.json @@ -127,9 +127,9 @@ "@elastic/ecs": "^8.11.5", "@elastic/elasticsearch": "9.0.3", "@elastic/ems-client": "8.6.3", - "@elastic/eui": "104.1.0", - "@elastic/eui-amsterdam": "npm:@elastic/eui@104.1.0-amsterdam.0", - "@elastic/eui-theme-borealis": "3.1.0", + "@elastic/eui": "105.0.0", + "@elastic/eui-amsterdam": "npm:@elastic/eui@105.0.0-amsterdam.0", + "@elastic/eui-theme-borealis": "3.2.0", "@elastic/filesaver": "1.1.2", "@elastic/monaco-esql": "^3.1.5", "@elastic/node-crypto": "^1.2.3", diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 78ef41377d97c..e2e30a26d49fb 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -88,11 +88,11 @@ 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.6.3': ['Elastic License 2.0'], - '@elastic/eui@104.1.0': ['Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0'], - '@elastic/eui-amsterdam@104.1.0-amsterdam.0': [ + '@elastic/eui@105.0.0': ['Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0'], + '@elastic/eui-amsterdam@105.0.0-amsterdam.0': [ 'Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0', ], - '@elastic/eui-theme-borealis@3.1.0': ['Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0'], + '@elastic/eui-theme-borealis@3.2.0': ['Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0'], 'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry 'buffers@0.1.1': ['MIT'], // license in importing module https://www.npmjs.com/package/binary '@bufbuild/protobuf@2.5.2': ['Apache-2.0'], // license (Apache-2.0 AND BSD-3-Clause) diff --git a/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table_summary_column_header.tsx b/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table_summary_column_header.tsx index 4523484bebe13..041c7b95b5876 100644 --- a/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table_summary_column_header.tsx +++ b/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table_summary_column_header.tsx @@ -54,7 +54,7 @@ export const UnifiedDataTableSummaryColumnHeader = ({ diff --git a/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_stats.test.tsx b/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_stats.test.tsx index beb0e1f05e1b8..c8030f1b2c401 100644 --- a/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_stats.test.tsx +++ b/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_stats.test.tsx @@ -34,6 +34,18 @@ const mockedServices = { uiSettings: coreMock.createStart().uiSettings, }; +// Similar to wrapper.text() but filtered by a selector +export const getChildrenTextBySelector = (wrapper: ReactWrapper, selector: string) => { + let text = ''; + const children = wrapper.find(selector); + + children.forEach((element) => { + text += element.text(); + }); + + return text; +}; + describe('UnifiedFieldList FieldStats', () => { let defaultProps: FieldStatsWithKbnQuery; let dataView: DataView; @@ -433,8 +445,12 @@ describe('UnifiedFieldList FieldStats', () => { 'Calculated from 1624 records.' ); - expect(wrapper.text()).toBe( - 'Top values"success"41.5%"info"37.1%"security"10.1%"warning"5.0%"error"3.4%"login"2.7%Calculated from 1624 records.' + expect(wrapper.text()).toContain('Top values'); + + const text = getChildrenTextBySelector(wrapper, 'div.euiProgress__data'); + + expect(text).toBe( + '"success"41.5%"info"37.1%"security"10.1%"warning"5.0%"error"3.4%"login"2.7%' ); }); @@ -506,8 +522,16 @@ describe('UnifiedFieldList FieldStats', () => { expect(loadFieldStats).toHaveBeenCalledTimes(1); - expect(wrapper.text()).toBe( - 'Examples"success"41.5%"info"37.1%"security"10.1%"warning"5.0%"error"3.4%"login"2.7%Calculated from 1624 records.' + expect(wrapper.text()).toContain('Examples'); + + const text = getChildrenTextBySelector(wrapper, 'div.euiProgress__data'); + + expect(text).toBe( + '"success"41.5%"info"37.1%"security"10.1%"warning"5.0%"error"3.4%"login"2.7%' + ); + + expect(wrapper.find('[data-test-subj="testing-statsFooter"]').first().text()).toBe( + 'Calculated from 1624 records.' ); }); @@ -694,8 +718,14 @@ describe('UnifiedFieldList FieldStats', () => { expect(loadFieldStats).toHaveBeenCalledTimes(1); - expect(wrapper.text()).toBe( - 'Toggle either theTop valuesDistribution1273.9%1326.1%Calculated from 23 sample records.' + expect(wrapper.text()).toContain('Toggle either theTop valuesDistribution'); + + const text = getChildrenTextBySelector(wrapper, 'div.euiProgress__data'); + + expect(text).toBe('1273.9%1326.1%'); + + expect(wrapper.find('[data-test-subj="testing-statsFooter"]').first().text()).toBe( + 'Calculated from 23 sample records.' ); }); diff --git a/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_top_values.test.tsx b/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_top_values.test.tsx index edb38d4610864..035a08ba6ed19 100644 --- a/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_top_values.test.tsx +++ b/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_top_values.test.tsx @@ -12,6 +12,7 @@ import { EuiProgress, EuiButtonIcon } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { DataView } from '@kbn/data-views-plugin/common'; import { FieldTopValues, FieldTopValuesProps } from './field_top_values'; +import { getChildrenTextBySelector } from './field_stats.test'; import { fieldFormatsServiceMock } from '@kbn/field-formats-plugin/public/mocks'; import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; @@ -66,8 +67,9 @@ describe('UnifiedFieldList ', () => { it('should render correctly without filter actions', async () => { const wrapper = mountWithIntl(); + const text = getChildrenTextBySelector(wrapper, 'div.euiProgress__data'); - expect(wrapper.text()).toBe('sourceA10.0%sourceB0.0%Other90.0%'); + expect(text).toBe('sourceA10.0%sourceB0.0%Other90.0%'); expect(wrapper.find(EuiProgress)).toHaveLength(3); expect(wrapper.find(EuiButtonIcon)).toHaveLength(0); }); @@ -75,8 +77,9 @@ describe('UnifiedFieldList ', () => { it('should render correctly with filter actions', async () => { const mockAddFilter = jest.fn(); const wrapper = mountWithIntl(); + const text = getChildrenTextBySelector(wrapper, 'div.euiProgress__data'); - expect(wrapper.text()).toBe('sourceA10.0%sourceB0.0%Other90.0%'); + expect(text).toBe('sourceA10.0%sourceB0.0%Other90.0%'); expect(wrapper.find(EuiProgress)).toHaveLength(3); expect(wrapper.find(EuiButtonIcon)).toHaveLength(4); @@ -105,8 +108,9 @@ describe('UnifiedFieldList ', () => { ]} /> ); + const text = getChildrenTextBySelector(wrapper, 'div.euiProgress__data'); - expect(wrapper.text()).toBe('sourceA60.0%sourceB30.0%sourceC10.0%'); + expect(text).toBe('sourceA60.0%sourceB30.0%sourceC10.0%'); }); it('should render correctly with empty strings', async () => { @@ -129,8 +133,9 @@ describe('UnifiedFieldList ', () => { ]} /> ); + const text = getChildrenTextBySelector(wrapper, 'div.euiProgress__data'); - expect(wrapper.text()).toBe('(empty)60.0%sourceA30.0%sourceB0.4%Other9.6%'); + expect(text).toBe('(empty)60.0%sourceA30.0%sourceB0.4%Other9.6%'); }); it('should render correctly without floating point', async () => { @@ -145,7 +150,8 @@ describe('UnifiedFieldList ', () => { ]} /> ); + const text = getChildrenTextBySelector(wrapper, 'div.euiProgress__data'); - expect(wrapper.text()).toBe('sourceA100%'); + expect(text).toBe('sourceA100%'); }); }); diff --git a/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx b/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx index 64d4c75e228ce..9a057a5d760a9 100755 --- a/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx +++ b/src/platform/packages/shared/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx @@ -99,64 +99,66 @@ const FieldTopValuesBucket: React.FC = ({ min-width: 0; `} > - - - {(formattedFieldValue?.length ?? 0) > 0 ? ( - - - - {formattedFieldValue} - - - - ) : ( - - {type === 'other' - ? i18n.translate('unifiedFieldList.fieldStats.otherDocsLabel', { - defaultMessage: 'Other', - }) - : formattedFieldValue === '' - ? i18n.translate('unifiedFieldList.fieldStats.emptyStringValueLabel', { - defaultMessage: '(empty)', - }) - : '-'} - - )} - - - - - - {formattedPercentage} - - - - + + + {formattedPercentage} + + + + } + label={ +
+ {(formattedFieldValue?.length ?? 0) > 0 ? ( + + + + {formattedFieldValue} + + + + ) : ( + + {type === 'other' + ? i18n.translate('unifiedFieldList.fieldStats.otherDocsLabel', { + defaultMessage: 'Other', + }) + : formattedFieldValue === '' + ? i18n.translate('unifiedFieldList.fieldStats.emptyStringValueLabel', { + defaultMessage: '(empty)', + }) + : '-'} + + )} +
+ } + labelProps={{ + title: undefined, + css: css` + white-space: unset !important; + `, + }} /> {onAddFilter && field.filterable && ( diff --git a/src/platform/plugins/shared/unified_doc_viewer/public/components/observability/attributes/doc_viewer_attributes_overview/attributes_accordion.tsx b/src/platform/plugins/shared/unified_doc_viewer/public/components/observability/attributes/doc_viewer_attributes_overview/attributes_accordion.tsx index 76502f4749469..15945d899c4aa 100644 --- a/src/platform/plugins/shared/unified_doc_viewer/public/components/observability/attributes/doc_viewer_attributes_overview/attributes_accordion.tsx +++ b/src/platform/plugins/shared/unified_doc_viewer/public/components/observability/attributes/doc_viewer_attributes_overview/attributes_accordion.tsx @@ -56,7 +56,7 @@ export const AttributesAccordion = ({ {title} = ( )} > = ( )} > { label: 'label', }; - const { getByText } = render(); + const { container } = render(); + // target only the visible label/value, skip the one for screen readers + const data = within(container.querySelector('.euiProgress__data')!); - expect(getByText('percentageLabel')).toBeInTheDocument(); - expect(getByText('label')).toBeInTheDocument(); + expect(data.getByText('percentageLabel')).toBeInTheDocument(); + expect(data.getByText('label')).toBeInTheDocument(); }); it('should render key value when key is not Other', () => { @@ -34,9 +36,11 @@ describe('ProgressBarRow', () => { label: 'label', }; - const { getByText } = render(); + const { container } = render(); + // target only the visible label/value, skip the one for screen readers + const data = within(container.querySelector('.euiProgress__data')!); - expect(getByText('percentageLabel')).toBeInTheDocument(); - expect(getByText('key')).toBeInTheDocument(); + expect(data.getByText('percentageLabel')).toBeInTheDocument(); + expect(data.getByText('key')).toBeInTheDocument(); }); }); diff --git a/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/__snapshots__/index.test.tsx.snap index daf313db384bb..dd068f3623760 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/__snapshots__/index.test.tsx.snap +++ b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/__snapshots__/index.test.tsx.snap @@ -73,8 +73,16 @@ exports[`Overview Host Stat Data rendering it renders the default OverviewHostSt
+
+ + 246351 + +
+
+ + 73847 + +
+
+ + 107307 + +
+
+ + 60015 + +
+
+ + 2003 + +
+
+ + 1200 + +
+
+ + 1979 + +
+
+ + 156714735 + +
+
+ + 39123 + +
+
+ + 39456 + +
+
+ + 39789 + +
+
+ + 39101112 + +
+
+ + 39131415 + +
+
+ + 39161718 + +
+
+ + 39202122 + +
+
+ + 568 + +
+
+ + 568 + +
+
+ + 296999 + +
+
+ + 195929 + +
+
+ + 101070 + +
+
+ + 12 + +
+
+ + 12 + +
+
+ + 70860 + +
+
+ + 999 + +
+
+ + 7777 + +
+
+ + 66 + +
+
+ + 60015 + +
+
+ + 2003 + +
+
+ + 13677323 + +
+
+ + 10277307 + +
+
+ + 16 + +
+
+ + 3400000 + +
{ expandHostStats(); HOST_STATS.forEach((stat) => { - cy.get(stat.domId).should('have.text', stat.value); + cy.get(stat.domId).should('contain.text', stat.value); }); }); @@ -44,7 +44,7 @@ describe('Overview Page', { tags: ['@ess', '@serverless'] }, () => { expandNetworkStats(); NETWORK_STATS.forEach((stat) => { - cy.get(stat.domId).should('have.text', stat.value); + cy.get(stat.domId).should('contain.text', stat.value); }); }); diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/rule_details.ts b/x-pack/test/security_solution_cypress/cypress/tasks/rule_details.ts index aaaf37b9c5afc..412bfef1f3144 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/rule_details.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/rule_details.ts @@ -131,8 +131,12 @@ export const goToAlertsTab = () => { cy.get(ALERTS_TAB).click(); }; +// TODO remove the `{ force: true }` option +// see https://github.com/elastic/eui/pull/8771 +// https://github.com/orgs/elastic/projects/1079/views/2?pane=issue&itemId=119405120 export const goToExceptionsTab = () => { - cy.get(EXCEPTIONS_TAB).click(); + // eslint-disable-next-line cypress/no-force + cy.get(EXCEPTIONS_TAB).click({ force: true }); }; export const goToExecutionLogTab = () => { diff --git a/yarn.lock b/yarn.lock index 7241cd7b24417..a01d595f63588 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2167,12 +2167,12 @@ resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-2.0.0.tgz#dba9f302c3a611440c88d7c34371a86e6f2285ae" integrity sha512-AIhCyMfRNz80CdKZEllVW4VgqfXQgv3wE875lt228MAmwd3tAwNh0mROp8++kWb0WJoLAYW4vypw873AMWqyEw== -"@elastic/eui-amsterdam@npm:@elastic/eui@104.1.0-amsterdam.0": - version "104.1.0-amsterdam.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-104.1.0-amsterdam.0.tgz#f33bebccc49bc45741bafe21339d11cdca6a6ff9" - integrity sha512-o4yeyJnk5qaS61E781MQcgaCdc0ZB64fg08Ml2mTfnmKG/ekznSXpGdq2lAtNcfXDtdT0qDu2+A9yMSMPIlS6A== +"@elastic/eui-amsterdam@npm:@elastic/eui@105.0.0-amsterdam.0": + version "105.0.0-amsterdam.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-105.0.0-amsterdam.0.tgz#acbabca4f50e42ac4679fe797703e7b7d2a27709" + integrity sha512-QH9x02EH+pPC8gZjcrIgfNPjfEvdfu0zjkici56eLsptLugDsu2k6toyYAp8c3dimNLfLwjS0mWODbAvSLUeTQ== dependencies: - "@elastic/eui-theme-common" "2.1.0" + "@elastic/eui-theme-common" "2.2.0" "@elastic/prismjs-esql" "^1.1.0" "@hello-pangea/dnd" "^16.6.0" "@types/lodash" "^4.14.202" @@ -2208,26 +2208,26 @@ uuid "^8.3.0" vfile "^4.2.1" -"@elastic/eui-theme-borealis@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@elastic/eui-theme-borealis/-/eui-theme-borealis-3.1.0.tgz#548d55460e1d7339eac66ca1e6ac302bbd0b3946" - integrity sha512-TKek3OcMlUA2dmOhIm+SUHM0rTA4irltcHQl5tmlrKCdh51sxSfP+a91VSYlfQFZt8rpZaZAxKq6Z+eGHy52mQ== +"@elastic/eui-theme-borealis@3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@elastic/eui-theme-borealis/-/eui-theme-borealis-3.2.0.tgz#be8b294c8f9fbd20b46eb3f6587adb770a1c4a7f" + integrity sha512-9Sh4szzjKIOchpW8uOl+6E35OyrVFLB4e0ikW8wivxjxeHHc1QVQSCVwFoU1Lfh9wFNVRVw3P1qdMVEnrjKetg== -"@elastic/eui-theme-common@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@elastic/eui-theme-common/-/eui-theme-common-2.1.0.tgz#e48807a867e987543de14af0d6c3d99f57da5c2e" - integrity sha512-cKLuflczikSoUQkFViLjv9NBCoti/b8UNc6+sEDK7uuAgA5aYX5jUqH1x4A5dwZ3dBed0ekz23pL5Hv+C65bxQ== +"@elastic/eui-theme-common@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@elastic/eui-theme-common/-/eui-theme-common-2.2.0.tgz#d46d0f4f557fe573902ef72b1a69f94acdee0b7f" + integrity sha512-8IUs6foUaUs3LrR7ocveUCnm2WpWX3Nu5ivoXaB6HccNWN7g2JujmTgTle/vP+IbQFXEZ/EXvi763hEdf164VA== dependencies: "@types/lodash" "^4.14.202" chroma-js "^2.4.2" lodash "^4.17.21" -"@elastic/eui@104.1.0": - version "104.1.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-104.1.0.tgz#59a2468d24bf0c9d5449750d2f623a44363cb15a" - integrity sha512-exxfm7aOPO1iJD7F7QKZROghFjJh0AuvaV65rR/evNEv52QxbF7zvpGmeQZiUC0fSlAhLbDGPoTbjzPjYTWDIg== +"@elastic/eui@105.0.0": + version "105.0.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-105.0.0.tgz#db199d09172095ba7b4696178ed5084321000149" + integrity sha512-iPSwfQxmF5sDj9c2iWuewdaYaibz0o/DUtzjNg7jTVrjnhcwCKeHUVkPpZLRUrhPmt8x+MwtKHSWo9J9/SRLtA== dependencies: - "@elastic/eui-theme-common" "2.1.0" + "@elastic/eui-theme-common" "2.2.0" "@elastic/prismjs-esql" "^1.1.0" "@hello-pangea/dnd" "^16.6.0" "@types/lodash" "^4.14.202"