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;
}
const { store, isConfigurable, isSelectable, customizeTableRowProps } = this.props;
const enabledItems = this.props
.getItems()
.filter((item) => !customizeTableRowProps(item).disabled);
return (
<TableHead showTopLine nowrap>
<Observer>
{() => {
const { store, isConfigurable, isSelectable, customizeTableRowProps } = this.props;
const enabledItems = this.props.getItems().filter(item => !customizeTableRowProps(item).disabled);
{isSelectable && (
<Observer>
{() => (
<TableCell
checkbox
isChecked={store.isSelectedAll(enabledItems)}
onClick={prevDefault(() => store.toggleSelectionAll(enabledItems))}
/>
)}
</Observer>
return (
<>
{isSelectable && (
<TableCell
checkbox
isChecked={store.isSelectedAll(enabledItems)}
onClick={prevDefault(() =>
store.toggleSelectionAll(enabledItems),
)}
/>
)}
{renderTableHeader.map(
(cellProps, index) =>
this.showColumn(cellProps) && (
<TableCell key={cellProps.id ?? index} {...cellProps} />
),
)}
<TableCell className="menu">
{isConfigurable && this.renderColumnVisibilityMenu()}
</TableCell>
</>
);
}}
</Observer>
)}
{renderTableHeader.map(
(cellProps, index) =>
this.showColumn(cellProps) && (
<TableCell key={cellProps.id ?? index} {...cellProps} />
),
)}
<TableCell className="menu">
{isConfigurable && this.renderColumnVisibilityMenu()}
</TableCell>
</TableHead>
);
}