mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
people listing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user