mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add software column sorter
This commit is contained in:
parent
b5ad44b5ce
commit
abe3616bc5
1 changed files with 7 additions and 1 deletions
|
|
@ -62,7 +62,13 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
|
|||
: <Table.Column<List>
|
||||
title="Software"
|
||||
dataIndex={nameof<List>("syntaxId")}
|
||||
width={160}
|
||||
sorter={(a, b) => {
|
||||
const getSoftwareIds = (l: List) => props.software.filter((s: Software) => s.syntaxIds.includes(l.syntaxId)).map(s => s.id);
|
||||
const aSoftwareIds = getSoftwareIds(a);
|
||||
const bSoftwareIds = getSoftwareIds(b);
|
||||
return arraySorter(aSoftwareIds, bSoftwareIds, props.software);
|
||||
}}
|
||||
width={140}
|
||||
className={styles.nogrow}
|
||||
render={(syntaxId: number) => syntaxId ? <SoftwareCloud software={props.software.filter((s: Software) => s.syntaxIds.includes(syntaxId))} /> : null} />}
|
||||
{tablePageSize.isNarrowWindow
|
||||
|
|
|
|||
Loading…
Reference in a new issue