mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
updates to some column sorts
This commit is contained in:
parent
6def1034bb
commit
3aa18fc9ac
3 changed files with 16 additions and 15 deletions
|
|
@ -17,12 +17,12 @@ const sortMethod = (a: string, b: string) =>
|
|||
a
|
||||
? b
|
||||
? a > b
|
||||
? 1
|
||||
: -1
|
||||
: 1
|
||||
: -1;
|
||||
? -1
|
||||
: 1
|
||||
: -1
|
||||
: 1;
|
||||
|
||||
const Cell = (ruleCount: number) =>
|
||||
ruleCount
|
||||
? <span>{ruleCount.toLocaleString() }</span>
|
||||
? <span>{ ruleCount.toLocaleString() }</span>
|
||||
: null;
|
||||
|
|
@ -6,7 +6,8 @@ import { IColumnVisibility, ITag } from "../../../interfaces";
|
|||
export const Tags = (columnVisibility: IColumnVisibility[], tags: ITag[]) => {
|
||||
const tagsSorted = tags.sort((a: ITag, b: ITag) => a.name.localeCompare(b.name));
|
||||
return ({
|
||||
Header: <span title="Generic taxonomies applied to the FilterList to provide information about its contents and/or purpose.">Tags</span>,
|
||||
Header:
|
||||
<span title="Generic taxonomies applied to the FilterList to provide information about its contents and/or purpose.">Tags</span>,
|
||||
accessor: "tagIds",
|
||||
filterable: true,
|
||||
filterMethod: (f: Filter, r: any[]) => filterMethod(f, r),
|
||||
|
|
@ -46,13 +47,13 @@ const sortMethod = (a: number[], b: number[], tags: ITag[]): any => {
|
|||
? tags.filter((t: ITag) => a.indexOf(t.id) > -1).map((t: ITag) => t.name).join()
|
||||
.toLowerCase() >
|
||||
tags.filter((t: ITag) => b.indexOf(t.id) > -1).map((t: ITag) => t.name).join().toLowerCase()
|
||||
? -1
|
||||
: 1
|
||||
: a.length > b.length
|
||||
? 1
|
||||
: -1
|
||||
: 1
|
||||
: -1;
|
||||
: a.length > b.length
|
||||
? -1
|
||||
: 1
|
||||
: -1
|
||||
: 1;
|
||||
};
|
||||
|
||||
const Cell = (tagIds: number[], tags: ITag[]) =>
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ const sortMethod = (a: string, b: string) =>
|
|||
a && moment(a).isValid()
|
||||
? (b && moment(b).isValid()
|
||||
? (moment(a).isBefore(b)
|
||||
? -1
|
||||
: 1)
|
||||
: 1)
|
||||
: -1;
|
||||
? 1
|
||||
: -1)
|
||||
: -1)
|
||||
: 1;
|
||||
|
||||
const Cell = (updatedDate: string) =>
|
||||
updatedDate
|
||||
|
|
|
|||
Loading…
Reference in a new issue