1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix sorting of table rows

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-02-02 13:10:01 +02:00
parent 569ff997bb
commit f46c3748e7
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A

View File

@ -209,37 +209,35 @@ export class ItemListLayoutContent<I extends ItemObject> extends React.Component
return null; return null;
} }
const { store, isConfigurable, isSelectable, customizeTableRowProps } = this.props;
const enabledItems = this.props
.getItems()
.filter((item) => !customizeTableRowProps(item).disabled);
return ( return (
<TableHead showTopLine nowrap> <TableHead showTopLine nowrap>
<Observer> {isSelectable && (
{() => { <Observer>
const { store, isConfigurable, isSelectable, customizeTableRowProps } = this.props; {() => (
const enabledItems = this.props.getItems().filter(item => !customizeTableRowProps(item).disabled); <TableCell
checkbox
isChecked={store.isSelectedAll(enabledItems)}
onClick={prevDefault(() => store.toggleSelectionAll(enabledItems))}
/>
)}
</Observer>
return ( )}
<> {renderTableHeader.map(
{isSelectable && ( (cellProps, index) =>
<TableCell this.showColumn(cellProps) && (
checkbox <TableCell key={cellProps.id ?? index} {...cellProps} />
isChecked={store.isSelectedAll(enabledItems)} ),
onClick={prevDefault(() => )}
store.toggleSelectionAll(enabledItems), <TableCell className="menu">
)} {isConfigurable && this.renderColumnVisibilityMenu()}
/> </TableCell>
)}
{renderTableHeader.map(
(cellProps, index) =>
this.showColumn(cellProps) && (
<TableCell key={cellProps.id ?? index} {...cellProps} />
),
)}
<TableCell className="menu">
{isConfigurable && this.renderColumnVisibilityMenu()}
</TableCell>
</>
);
}}
</Observer>
</TableHead> </TableHead>
); );
} }