Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- Fixed tick and level alignment in `Eui[Dual]Range` ([#5181](https://github.com/elastic/eui/pull/5181))
- Fixed duplicate IDs on mobile/desktop select all checkboxes in `EuiBasicTable` ([#5237](https://github.com/elastic/eui/pull/5237))
- Fixed missing i18n token in `EuiBasicTable`'s no items message ([#5242](https://github.com/elastic/eui/pull/5242))

**Breaking changes**

Expand Down
12 changes: 10 additions & 2 deletions src/components/basic_table/__snapshots__/basic_table.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ exports[`EuiBasicTable empty is rendered 1`] = `
colSpan={1}
isMobileFullWidth={true}
>
No items found
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
</EuiTableRowCell>
</EuiTableRow>
</EuiTableBody>
Expand Down Expand Up @@ -1417,7 +1420,12 @@ exports[`EuiBasicTable with initial selection 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
responsive={true}
selection={
Object {
Expand Down
126 changes: 108 additions & 18 deletions src/components/basic_table/__snapshots__/in_memory_table.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ exports[`EuiInMemoryTable behavior pagination 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -770,7 +775,12 @@ exports[`EuiInMemoryTable empty array 1`] = `
}
data-test-subj="test subject string"
items={Array []}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
responsive={true}
tableLayout="fixed"
Expand All @@ -792,7 +802,12 @@ exports[`EuiInMemoryTable with executeQueryOptions 1`] = `
}
data-test-subj="test subject string"
items={Array []}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
responsive={true}
tableLayout="fixed"
Expand Down Expand Up @@ -874,7 +889,12 @@ exports[`EuiInMemoryTable with initial selection 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
responsive={true}
selection={
Expand Down Expand Up @@ -1422,7 +1442,12 @@ exports[`EuiInMemoryTable with initial sorting 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
responsive={true}
sorting={
Expand Down Expand Up @@ -1468,7 +1493,12 @@ exports[`EuiInMemoryTable with items 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
responsive={true}
tableLayout="fixed"
Expand Down Expand Up @@ -1513,7 +1543,12 @@ exports[`EuiInMemoryTable with items and expanded item 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
responsive={true}
tableLayout="fixed"
Expand Down Expand Up @@ -1628,7 +1663,12 @@ exports[`EuiInMemoryTable with pagination 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -1670,7 +1710,12 @@ exports[`EuiInMemoryTable with pagination and default page size and index 1`] =
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -1721,7 +1766,12 @@ exports[`EuiInMemoryTable with pagination and selection 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -1769,7 +1819,12 @@ exports[`EuiInMemoryTable with pagination, default page size and error 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -1819,7 +1874,12 @@ exports[`EuiInMemoryTable with pagination, hiding the per page options 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -1871,7 +1931,12 @@ exports[`EuiInMemoryTable with pagination, selection and sorting 1`] = `
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -1951,7 +2016,12 @@ exports[`EuiInMemoryTable with pagination, selection, sorting and simple search
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -2025,7 +2095,12 @@ exports[`EuiInMemoryTable with pagination, selection, sorting and a single recor
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -2085,7 +2160,12 @@ exports[`EuiInMemoryTable with pagination, selection, sorting and column rendere
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -2174,7 +2254,12 @@ exports[`EuiInMemoryTable with pagination, selection, sorting and configured sea
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
pagination={
Object {
Expand Down Expand Up @@ -2258,7 +2343,12 @@ exports[`EuiInMemoryTable with search and component between search and table 1`]
},
]
}
noItemsMessage="No items found"
noItemsMessage={
<EuiI18n
default="No items found"
token="euiBasicTable.noItemsMessage"
/>
}
onChange={[Function]}
responsive={true}
tableLayout="fixed"
Expand Down
4 changes: 3 additions & 1 deletion src/components/basic_table/basic_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ export class EuiBasicTable<T = any> extends Component<
static defaultProps = {
responsive: true,
tableLayout: 'fixed',
noItemsMessage: 'No items found',
noItemsMessage: (
<EuiI18n token="euiBasicTable.noItemsMessage" default="No items found" />
),
};

static getDerivedStateFromProps<T>(
Expand Down