From a8c72c8a397da7ca7805a33eb96ea19db8dd880d Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Tue, 15 May 2018 14:03:03 -0600 Subject: [PATCH 1/2] pass extra props from EuiInMemoryTable to EuiBasicTable --- .../__snapshots__/basic_table.test.js.snap | 32 +++++++ .../in_memory_table.test.js.snap | 88 +++++++++++++++++++ src/components/basic_table/basic_table.js | 27 +++++- src/components/basic_table/in_memory_table.js | 2 + 4 files changed, 147 insertions(+), 2 deletions(-) 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 b54c262d81f..052faed5f43 100644 --- a/src/components/basic_table/__snapshots__/basic_table.test.js.snap +++ b/src/components/basic_table/__snapshots__/basic_table.test.js.snap @@ -2,7 +2,9 @@ exports[`EuiBasicTable basic - empty - custom message 1`] = `
@@ -37,7 +39,9 @@ exports[`EuiBasicTable basic - empty - custom message 1`] = ` exports[`EuiBasicTable basic - empty - custom message as node 1`] = `
@@ -80,7 +84,9 @@ exports[`EuiBasicTable basic - empty - custom message as node 1`] = ` exports[`EuiBasicTable basic - empty 1`] = `
@@ -115,7 +121,9 @@ exports[`EuiBasicTable basic - empty 1`] = ` exports[`EuiBasicTable basic - with items 1`] = `
@@ -276,7 +284,9 @@ exports[`EuiBasicTable itemIdToExpandedRowMap renders an expanded row 1`] = ` exports[`EuiBasicTable with pagination - 2nd page 1`] = `
@@ -344,7 +354,9 @@ exports[`EuiBasicTable with pagination - 2nd page 1`] = ` exports[`EuiBasicTable with pagination 1`] = `
@@ -428,7 +440,9 @@ exports[`EuiBasicTable with pagination 1`] = ` exports[`EuiBasicTable with pagination and error 1`] = `
@@ -469,7 +483,9 @@ exports[`EuiBasicTable with pagination and error 1`] = ` exports[`EuiBasicTable with pagination and selection 1`] = `
@@ -611,7 +627,9 @@ exports[`EuiBasicTable with pagination and selection 1`] = ` exports[`EuiBasicTable with pagination, selection and sorting 1`] = `
@@ -770,7 +788,9 @@ exports[`EuiBasicTable with pagination, selection and sorting 1`] = ` exports[`EuiBasicTable with pagination, selection, sorting and a single record action 1`] = `
@@ -1020,7 +1040,9 @@ exports[`EuiBasicTable with pagination, selection, sorting and a single record a exports[`EuiBasicTable with pagination, selection, sorting and column dataType 1`] = `
@@ -1179,7 +1201,9 @@ exports[`EuiBasicTable with pagination, selection, sorting and column dataType 1 exports[`EuiBasicTable with pagination, selection, sorting and column renderer 1`] = `
@@ -1338,7 +1362,9 @@ exports[`EuiBasicTable with pagination, selection, sorting and column renderer 1 exports[`EuiBasicTable with pagination, selection, sorting and multiple record actions 1`] = `
@@ -1582,7 +1608,9 @@ exports[`EuiBasicTable with pagination, selection, sorting and multiple record a exports[`EuiBasicTable with pagination, selection, sorting, column renderer and column dataType 1`] = `
@@ -1741,7 +1769,9 @@ exports[`EuiBasicTable with pagination, selection, sorting, column renderer and exports[`EuiBasicTable with sortable columns and sorting disabled 1`] = `
@@ -1814,7 +1844,9 @@ exports[`EuiBasicTable with sortable columns and sorting disabled 1`] = ` exports[`EuiBasicTable with sorting 1`] = `
diff --git a/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap b/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap index e628f608a7b..9521fd17c07 100644 --- a/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap +++ b/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap @@ -2,6 +2,8 @@ exports[`EuiInMemoryTable empty array 1`] = ` @@ -138,6 +150,8 @@ exports[`EuiInMemoryTable with items and expanded item 1`] = ` exports[`EuiInMemoryTable with items and message - expecting to show the items 1`] = ` +
{table} {paginationBar}
diff --git a/src/components/basic_table/in_memory_table.js b/src/components/basic_table/in_memory_table.js index d06bf0f05da..b5a39f8578e 100644 --- a/src/components/basic_table/in_memory_table.js +++ b/src/components/basic_table/in_memory_table.js @@ -260,6 +260,7 @@ export class EuiInMemoryTable extends Component { pagination: hasPagination, sorting: hasSorting, itemIdToExpandedRowMap, + ...rest } = this.props; const { @@ -307,6 +308,7 @@ export class EuiInMemoryTable extends Component { noItemsMessage={message} compressed={compressed} itemIdToExpandedRowMap={itemIdToExpandedRowMap} + {...rest} /> ); From 8130a1dd29d494509fd4cb6fe4a95b37e0ecd388 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Thu, 17 May 2018 13:14:42 -0600 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5156fd31ab9..c9d7a103532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## [`master`](https://github.com/elastic/eui/tree/master) +**Bug fixes** +- `EuiInMemoryTable` and `EuiBasicTable` now pass unknown props through to their child ([#836](https://github.com/elastic/eui/pull/836)) + **Breaking changes** - Move `EuiBasicTable`'s `itemId` prop from `selection` to a top-level property ([#830](https://github.com/elastic/eui/pull/830))