mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-24 19:58:11 +08:00
Clean up max-category front-end limit (#2347)
* remove topN category truncation from component rendering layer * clean up category item limit implementation * name change for clarity * fix snapshot * comments
This commit is contained in:
@@ -18,15 +18,11 @@ function caseInsensitiveCompare(a: any, b: any) {
|
||||
return textA < textB ? -1 : textA > textB ? 1 : 0;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||
const catLabelSort = (isUserAnno: any, values: any) => {
|
||||
const catLabelSort = (isUserAnno: boolean, values: any[]): any[] => {
|
||||
/* this sort could be memoized for perf */
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||
const strings: any = [];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||
const ints: any = [];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||
const strings: string[] = [];
|
||||
const ints: number[] = [];
|
||||
const unassignedOrNaN: any = [];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||
@@ -43,11 +39,10 @@ const catLabelSort = (isUserAnno: any, values: any) => {
|
||||
});
|
||||
|
||||
strings.sort(caseInsensitiveCompare);
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'a' implicitly has an 'any' type.
|
||||
ints.sort((a, b) => +a - +b);
|
||||
unassignedOrNaN.sort(caseInsensitiveCompare);
|
||||
|
||||
return ints.concat(strings, unassignedOrNaN);
|
||||
return (<any>ints).concat(strings, unassignedOrNaN);
|
||||
};
|
||||
|
||||
export default catLabelSort;
|
||||
|
||||
Reference in New Issue
Block a user