1
0
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:
Jim Ehrismann 2021-02-23 15:56:54 -05:00
parent ec1573dc4c
commit 31dfe20d54

View File

@ -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>