From 82b273651f0ac538297a981a96514895ff067fe3 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 6 Feb 2023 09:46:27 +0100 Subject: [PATCH] [EC-1025] fix: sort on each data field separately (#4609) --- .../access-selector/access-selector.component.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/organizations/shared/components/access-selector/access-selector.component.ts b/apps/web/src/app/organizations/shared/components/access-selector/access-selector.component.ts index e531d21667..7767953b30 100644 --- a/apps/web/src/app/organizations/shared/components/access-selector/access-selector.component.ts +++ b/apps/web/src/app/organizations/shared/components/access-selector/access-selector.component.ts @@ -285,12 +285,11 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On } private _itemComparator(a: AccessItemView, b: AccessItemView) { - if (a.type != b.type) { - return a.type - b.type; - } - return this.i18nService.collator.compare( - a.listName + a.labelName + a.readonly, - b.listName + b.labelName + b.readonly + return ( + a.type - b.type || + this.i18nService.collator.compare(a.listName, b.listName) || + this.i18nService.collator.compare(a.labelName, b.labelName) || + Number(b.readonly) - Number(a.readonly) ); } }