1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 11:43:46 +00:00

people listing

This commit is contained in:
Kyle Spearrin
2018-07-06 15:01:23 -04:00
parent 634e5e27d3
commit 35bb106654
5 changed files with 92 additions and 32 deletions

View File

@@ -15,6 +15,8 @@ import { UserService } from 'jslib/abstractions/user.service';
import { Organization } from 'jslib/models/domain/organization';
import { Utils } from 'jslib/misc/utils';
@Component({
selector: 'app-organizations',
templateUrl: 'organizations.component.html',
@@ -37,20 +39,7 @@ export class OrganizationsComponent implements OnInit {
async load() {
const orgs = await this.userService.getAllOrganizations();
orgs.sort((a, b) => {
if (a.name == null && b.name != null) {
return -1;
}
if (a.name != null && b.name == null) {
return 1;
}
if (a.name == null && b.name == null) {
return 0;
}
return this.i18nService.collator ? this.i18nService.collator.compare(a.name, b.name) :
a.name.localeCompare(b.name);
});
orgs.sort(Utils.getSortFunction(this.i18nService, 'name'));
this.organizations = orgs;
this.loaded = true;
}