From 0156ea23ffe7dcc74f785ad295f2a3a5fca4b7d9 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Wed, 26 Sep 2018 17:11:25 -0500 Subject: [PATCH] fix sorting of Languages and Software filters --- .../modules/home/components/listsTable/columns/Languages.tsx | 3 ++- .../modules/home/components/listsTable/columns/Software.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Languages.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Languages.tsx index 47dc37e12..a91b5d6e4 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Languages.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Languages.tsx @@ -33,7 +33,8 @@ const Filter = (props: any, languages: ILanguage[]) => value={props.filter ? props.filter.value : "any"}> {languages.length > 0 - ? languages.map((l: ILanguage, i: number) => ) + ? languages.sort((a, b) => a.name.localeCompare(b.name)) + .map((l: ILanguage, i: number) => ) : null} ; diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Software.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Software.tsx index a8976fa22..f5a5b55e4 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Software.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Software.tsx @@ -34,7 +34,7 @@ const Filter = (props: any, software: ISoftware[]) => value={props.filter ? props.filter.value : "any"}> {software.length > 0 - ? software.map( + ? software.sort((a, b) => a.name.localeCompare(b.name)).map( (s: ISoftware, i: number) => ) : null} ; @@ -42,5 +42,5 @@ const Filter = (props: any, software: ISoftware[]) => const Cell = (listSyntaxId: number, software: ISoftware[]) => listSyntaxId ? software.filter((s: ISoftware) => s.syntaxIds.indexOf(listSyntaxId) > -1) - .map((s: ISoftware, i: number) => ) + .map((s: ISoftware, i: number) => ) : null; \ No newline at end of file