1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +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

@@ -1,7 +1,41 @@
import { Component } from '@angular/core';
import {
Component,
OnInit,
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ApiService } from 'jslib/abstractions/api.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { OrganizationUserUserDetailsResponse } from 'jslib/models/response/organizationUserResponse';
import { Utils } from 'jslib/misc/utils';
@Component({
selector: 'app-org-people',
templateUrl: 'people.component.html',
})
export class PeopleComponent { }
export class PeopleComponent implements OnInit {
loading = true;
organizationId: string;
users: OrganizationUserUserDetailsResponse[];
searchText: string;
constructor(private apiService: ApiService, private route: ActivatedRoute,
private i18nService: I18nService) { }
async ngOnInit() {
this.route.parent.parent.params.subscribe(async (params) => {
this.organizationId = params.organizationId;
});
await this.load();
}
async load() {
const response = await this.apiService.getOrganizationUsers(this.organizationId);
const users = response.data != null && response.data.length > 0 ? response.data : [];
users.sort(Utils.getSortFunction(this.i18nService, 'email'));
this.users = users;
this.loading = false;
}
}