From 277196a3a544ea8f2c34f41f463afa3e9aa9d5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Franco=20Knob?= Date: Mon, 20 Jan 2020 09:19:59 -0300 Subject: [PATCH 1/3] Adds data-test-subj to the EuiContextMenuItem component rendered in EuiTablePagination --- src/components/table/table_pagination/table_pagination.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/table/table_pagination/table_pagination.tsx b/src/components/table/table_pagination/table_pagination.tsx index bf83e722257..b040cff2ab3 100644 --- a/src/components/table/table_pagination/table_pagination.tsx +++ b/src/components/table/table_pagination/table_pagination.tsx @@ -6,11 +6,12 @@ import { EuiFlexGroup, EuiFlexItem } from '../../flex'; import { EuiPagination } from '../../pagination'; import { EuiPopover } from '../../popover'; import { EuiI18n } from '../../i18n'; +import { CommonProps } from '../../common'; export type PageChangeHandler = (pageIndex: number) => void; export type ItemsPerPageChangeHandler = (pageSize: number) => void; -export interface Props { +export interface Props extends CommonProps { activePage?: number; hidePerPageOptions?: boolean; itemsPerPage?: number; @@ -50,6 +51,7 @@ export class EuiTablePagination extends Component { onChangeItemsPerPage = () => {}, onChangePage, pageCount, + 'data-test-subj': dataTestSubj, } = this.props; const button = ( @@ -75,7 +77,8 @@ export class EuiTablePagination extends Component { onClick={() => { this.closePopover(); onChangeItemsPerPage(itemsPerPageOption); - }}> + }} + data-test-subj={dataTestSubj}> Date: Tue, 21 Jan 2020 13:09:36 -0300 Subject: [PATCH 2/3] Changes how the data-test-subj value is set --- src/components/table/table_pagination/table_pagination.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/table/table_pagination/table_pagination.tsx b/src/components/table/table_pagination/table_pagination.tsx index b040cff2ab3..3e97b246bdb 100644 --- a/src/components/table/table_pagination/table_pagination.tsx +++ b/src/components/table/table_pagination/table_pagination.tsx @@ -6,12 +6,11 @@ import { EuiFlexGroup, EuiFlexItem } from '../../flex'; import { EuiPagination } from '../../pagination'; import { EuiPopover } from '../../popover'; import { EuiI18n } from '../../i18n'; -import { CommonProps } from '../../common'; export type PageChangeHandler = (pageIndex: number) => void; export type ItemsPerPageChangeHandler = (pageSize: number) => void; -export interface Props extends CommonProps { +export interface Props { activePage?: number; hidePerPageOptions?: boolean; itemsPerPage?: number; @@ -51,7 +50,6 @@ export class EuiTablePagination extends Component { onChangeItemsPerPage = () => {}, onChangePage, pageCount, - 'data-test-subj': dataTestSubj, } = this.props; const button = ( @@ -78,7 +76,7 @@ export class EuiTablePagination extends Component { this.closePopover(); onChangeItemsPerPage(itemsPerPageOption); }} - data-test-subj={dataTestSubj}> + data-test-subj={`tablePagination-${itemsPerPageOption}-rows`}> Date: Tue, 21 Jan 2020 13:40:42 -0300 Subject: [PATCH 3/3] Adds CHANGELOG line --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f29b7b639..718fc17ac39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Converted `EuiFilterButton` to TypeScript ([#2761](https://github.com/elastic/eui/pull/2761)) - Converted `EuiFilterSelectItem` to TypeScript ([#2761](https://github.com/elastic/eui/pull/2761)) - Converted `EuiFieldSearch` to TypeScript ([#2775](https://github.com/elastic/eui/pull/2775)) +- Added `data-test-subj` to the `EuiContextMenuItem` in `EuiTablePagination` ([#2778](https://github.com/elastic/eui/pull/2778)) **Bug fixes**