mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
added default for customizeTableRowProps
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
parent
ec1573dc4c
commit
31dfe20d54
@ -89,7 +89,8 @@ const defaultProps: Partial<ItemListLayoutProps> = {
|
|||||||
filterItems: [],
|
filterItems: [],
|
||||||
hasDetailsView: true,
|
hasDetailsView: true,
|
||||||
onDetails: noop,
|
onDetails: noop,
|
||||||
virtual: true
|
virtual: true,
|
||||||
|
customizeTableRowProps: () => ({} as TableRowProps),
|
||||||
};
|
};
|
||||||
|
|
||||||
interface ItemListLayoutUserSettings {
|
interface ItemListLayoutUserSettings {
|
||||||
@ -241,7 +242,7 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
|
|||||||
sortItem={item}
|
sortItem={item}
|
||||||
selected={detailsItem && detailsItem.getId() === itemId}
|
selected={detailsItem && detailsItem.getId() === itemId}
|
||||||
onClick={hasDetailsView ? prevDefault(() => onDetails(item)) : undefined}
|
onClick={hasDetailsView ? prevDefault(() => onDetails(item)) : undefined}
|
||||||
{...(customizeTableRowProps ? customizeTableRowProps(item) : {})}
|
{...customizeTableRowProps(item)}
|
||||||
>
|
>
|
||||||
{isSelectable && (
|
{isSelectable && (
|
||||||
<TableCell
|
<TableCell
|
||||||
@ -398,9 +399,7 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const enabledItems = customizeTableRowProps
|
const enabledItems = this.items.filter(item => !customizeTableRowProps(item).disabled);
|
||||||
? this.items.filter(item => !customizeTableRowProps(item).disabled)
|
|
||||||
: this.items;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableHead showTopLine nowrap>
|
<TableHead showTopLine nowrap>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user