1
0
mirror of https://github.com/bitwarden/web synced 2025-12-21 10:43:26 +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

@@ -9,6 +9,8 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
import { GroupResponse } from 'jslib/models/response/groupResponse';
import { Utils } from 'jslib/misc/utils';
@Component({
selector: 'app-org-groups',
templateUrl: 'groups.component.html',
@@ -32,20 +34,7 @@ export class GroupsComponent implements OnInit {
async load() {
const response = await this.apiService.getGroups(this.organizationId);
const groups = response.data != null && response.data.length > 0 ? response.data : [];
groups.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);
});
groups.sort(Utils.getSortFunction(this.i18nService, 'name'));
this.groups = groups;
this.loading = false;
}