diff --git a/jslib b/jslib index c29b53cd..b5db9edc 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit c29b53cdd62369de59f6ae483b78b9bcc67d9238 +Subproject commit b5db9edc3f930a4553f1bdab347cf8468f282a54 diff --git a/src/app/tabs/dashboard.component.ts b/src/app/tabs/dashboard.component.ts index 9b88bc0a..83cde573 100644 --- a/src/app/tabs/dashboard.component.ts +++ b/src/app/tabs/dashboard.component.ts @@ -7,6 +7,7 @@ import { GSuiteDirectoryService } from '../../services/gsuite-directory.service' import { LdapDirectoryService } from '../../services/ldap-directory.service'; import { SyncService } from '../../services/sync.service'; +import { Entry } from '../../models/entry'; import { GroupEntry } from '../../models/groupEntry'; import { UserEntry } from '../../models/userEntry'; @@ -49,6 +50,7 @@ export class DashboardComponent { const userMap = new Map(); if (this.simUsers != null) { + this.sort(this.simUsers); this.simUsers.forEach((u) => { userMap.set(u.externalId, u); if (u.deleted) { @@ -62,6 +64,7 @@ export class DashboardComponent { } if (userMap.size > 0 && this.simGroups != null) { + this.sort(this.simGroups); this.simGroups.forEach((g) => { if (g.userMemberExternalIds == null) { return; @@ -75,9 +78,20 @@ export class DashboardComponent { (g as any).users.push(userMap.get(uid)); } }); + + if ((g as any).users != null) { + this.sort((g as any).users); + } }); } resolve(); }); } + + private sort(arr: Entry[]) { + arr.sort((a, b) => { + return this.i18nService.collator ? this.i18nService.collator.compare(a.displayName, b.displayName) : + a.displayName.localeCompare(b.displayName); + }); + } } diff --git a/src/models/entry.ts b/src/models/entry.ts index df565056..4bfe120a 100644 --- a/src/models/entry.ts +++ b/src/models/entry.ts @@ -1,4 +1,8 @@ export abstract class Entry { referenceId: string; externalId: string; + + get displayName(): string { + return this.referenceId; + } }