From 775a0c3ebef211fae184d3c70d5dd17889dae8d8 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Fri, 25 May 2018 09:11:55 -0700 Subject: [PATCH] Remove columnIndex from cellProps callback. --- src-docs/src/views/tables/basic/basic.js | 5 +++-- .../basic_table/__snapshots__/basic_table.test.js.snap | 6 +++--- src/components/basic_table/basic_table.js | 6 +++--- src/components/basic_table/basic_table.test.js | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src-docs/src/views/tables/basic/basic.js b/src-docs/src/views/tables/basic/basic.js index ca6f08f0c8dc..dbe7c930fd0c 100644 --- a/src-docs/src/views/tables/basic/basic.js +++ b/src-docs/src/views/tables/basic/basic.js @@ -91,11 +91,12 @@ export const Table = () => { }; }; - const getCellProps = (item, column, columnIndex) => { + const getCellProps = (item, column) => { const { id } = item; + const { field } = column; return { className: 'customCellClass', - 'data-test-subj': `cell-${id}-${columnIndex}`, + 'data-test-subj': `cell-${id}-${field}`, }; }; diff --git a/src/components/basic_table/__snapshots__/basic_table.test.js.snap b/src/components/basic_table/__snapshots__/basic_table.test.js.snap index e3c98dd8fe49..b6e91edcfa26 100644 --- a/src/components/basic_table/__snapshots__/basic_table.test.js.snap +++ b/src/components/basic_table/__snapshots__/basic_table.test.js.snap @@ -28,7 +28,7 @@ exports[`EuiBasicTable cellProps renders cells with custom props from a callback { description: 'description' } ], - cellProps: (item, column, columnIndex) => { + cellProps: (item, column) => { const { id } = item; const { field } = column; return { - 'data-test-subj': `cell-${id}-${columnIndex}-${field}`, + 'data-test-subj': `cell-${id}-${field}`, className: 'customRowClass', onClick: () => {}, };