From 05dba5aa6e5cce3427a9f369799720ea7bec052b Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sun, 30 Aug 2020 10:38:37 -0500 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E2=9C=A8=20re-enable=20lang=20col?= =?UTF-8?q?umn=20(less=20sorter)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/listsTable/ListsTable.tsx | 23 ++++++++++---------- web/src/interfaces/List.ts | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/web/src/components/listsTable/ListsTable.tsx b/web/src/components/listsTable/ListsTable.tsx index d10457085..ab80012c0 100644 --- a/web/src/components/listsTable/ListsTable.tsx +++ b/web/src/components/listsTable/ListsTable.tsx @@ -219,14 +219,14 @@ export const ListsTable = (props: RouteComponentProps & Props) => { }} /> )} */} - {/* {tablePageSize.isNarrowWindow ? null : ( + {tablePageSize.isNarrowWindow ? null : ( title="Languages" key="Languages" - dataIndex={nameof("languageIds")} - sorter={(a, b) => - arraySorter(a.languageIso6391s, b.languageIso6391s, languages) - } + dataIndex={nameof("languageIso6391s")} + // sorter={(a, b) => + // arraySorter(a.languageIso6391s, b.languageIso6391s, languages) + // } width={129} className={styles.nogrow} filters={languages.map((l) => ({ @@ -237,30 +237,31 @@ export const ListsTable = (props: RouteComponentProps & Props) => { { visibleLists.filter( (li) => - li.languageIso6391s && li.languageIso6391s.includes(l.id) + li.languageIso6391s && + li.languageIso6391s.includes(l.iso6391) ).length } ) ), - value: l.id.toString(), + value: l.iso6391.toString(), }))} onFilter={(value, record) => record.languageIso6391s - ? record.languageIso6391s.includes(+value) + ? record.languageIso6391s.includes(value as string) : false } - render={(languageIds: number[]) => + render={(languageIds: string[]) => languageIds ? ( - languageIds.includes(l.id) + languageIds.includes(l.iso6391) )} /> ) : null } /> - )} */} + )} {tablePageSize.isNarrowWindow ? null : ( title="Tags" diff --git a/web/src/interfaces/List.ts b/web/src/interfaces/List.ts index 8a4ed4909..0055329e0 100644 --- a/web/src/interfaces/List.ts +++ b/web/src/interfaces/List.ts @@ -4,7 +4,7 @@ description: string; licenseId: number; syntaxIds: number[]; - languageIso6391s: number[]; + languageIso6391s: string[]; tagIds: number[]; maintainerIds: number[];