1
0
mirror of https://github.com/bitwarden/web synced 2025-12-21 02:33:19 +00:00

collection and group listing from org admin

This commit is contained in:
Kyle Spearrin
2018-07-06 12:49:06 -04:00
parent d830499c76
commit 93582da044
8 changed files with 168 additions and 17 deletions

View File

@@ -1,7 +1,39 @@
import { Component } from '@angular/core';
import {
Component,
OnInit,
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ApiService } from 'jslib/abstractions/api.service';
import { GroupResponse } from 'jslib/models/response/groupUserResponse';
@Component({
selector: 'app-org-groups',
templateUrl: 'groups.component.html',
})
export class GroupsComponent { }
export class GroupsComponent implements OnInit {
loading = true;
organizationId: string;
groups: GroupResponse[];
searchText: string;
constructor(private apiService: ApiService, private route: ActivatedRoute) { }
async ngOnInit() {
this.route.parent.parent.params.subscribe(async (params) => {
this.organizationId = params.organizationId;
});
await this.load();
}
async load() {
const response = await this.apiService.getGroups(this.organizationId);
if (response.data != null && response.data.length > 0) {
this.groups = response.data;
} else {
this.groups = [];
}
this.loading = false;
}
}