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,24 +209,26 @@ export class ItemListLayoutContent<I extends ItemObject> extends React.Component
return null; return null;
} }
return (
<TableHead showTopLine nowrap>
<Observer>
{() => {
const { store, isConfigurable, isSelectable, customizeTableRowProps } = this.props; const { store, isConfigurable, isSelectable, customizeTableRowProps } = this.props;
const enabledItems = this.props.getItems().filter(item => !customizeTableRowProps(item).disabled);
const enabledItems = this.props
.getItems()
.filter((item) => !customizeTableRowProps(item).disabled);
return ( return (
<> <TableHead showTopLine nowrap>
{isSelectable && ( {isSelectable && (
<Observer>
{() => (
<TableCell <TableCell
checkbox checkbox
isChecked={store.isSelectedAll(enabledItems)} isChecked={store.isSelectedAll(enabledItems)}
onClick={prevDefault(() => onClick={prevDefault(() => store.toggleSelectionAll(enabledItems))}
store.toggleSelectionAll(enabledItems),
)}
/> />
)} )}
</Observer>
)}
{renderTableHeader.map( {renderTableHeader.map(
(cellProps, index) => (cellProps, index) =>
this.showColumn(cellProps) && ( this.showColumn(cellProps) && (
@ -236,10 +238,6 @@ export class ItemListLayoutContent<I extends ItemObject> extends React.Component
<TableCell className="menu"> <TableCell className="menu">
{isConfigurable && this.renderColumnVisibilityMenu()} {isConfigurable && this.renderColumnVisibilityMenu()}
</TableCell> </TableCell>
</>
);
}}
</Observer>
</TableHead> </TableHead>
); );
} }