From 69e059ba0118242ef6ab74e5693207aaa573010a Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 23 Jul 2018 10:57:25 -0400 Subject: [PATCH] sort user groups --- src/app/organizations/manage/user-groups.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/organizations/manage/user-groups.component.ts b/src/app/organizations/manage/user-groups.component.ts index c913b71547..5b551fbdc9 100644 --- a/src/app/organizations/manage/user-groups.component.ts +++ b/src/app/organizations/manage/user-groups.component.ts @@ -15,6 +15,8 @@ import { I18nService } from 'jslib/abstractions/i18n.service'; import { OrganizationUserUpdateGroupsRequest } from 'jslib/models/request/organizationUserUpdateGroupsRequest'; import { GroupResponse } from 'jslib/models/response/groupResponse'; +import { Utils } from 'jslib/misc/utils'; + @Component({ selector: 'app-user-groups', templateUrl: 'user-groups.component.html', @@ -34,7 +36,9 @@ export class UserGroupsComponent implements OnInit { async ngOnInit() { const groupsResponse = await this.apiService.getGroups(this.organizationId); - this.groups = groupsResponse.data.map((r) => r); + const groups = groupsResponse.data.map((r) => r); + groups.sort(Utils.getSortFunction(this.i18nService, 'name')); + this.groups = groups; try { const userGroups = await this.apiService.getOrganizationUserGroups(