Add list of users from public keys.

This commit is contained in:
Spencer Ofwiti
2021-03-16 20:13:48 +03:00
parent 03be46e169
commit 6dc44be4eb
5 changed files with 31 additions and 62 deletions

View File

@@ -58,8 +58,7 @@
<div class="card mb-3">
<mat-card-title class="card-header">
<div class="row">
USERS
<button mat-raised-button color="primary" routerLink="/settings/invite" type="button" class="btn btn-outline-primary ml-auto"><i class="fa fa-plus"> NEW USER </i></button>
TRUSTED USERS
</div>
</mat-card-title>
<div class="card-body">
@@ -70,46 +69,24 @@
</mat-form-field>
<mat-table class="mat-elevation-z10" [dataSource]="dataSource" matSort matSortActive="name"
matSortDirection="asc" matSortDisableClear>
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header> NAME </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
</ng-container>
<ng-container matColumnDef="accountType">
<mat-header-cell *matHeaderCellDef mat-sort-header> ACCOUNT TYPE </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.accountType}} </mat-cell>
<ng-container matColumnDef="email">
<mat-header-cell *matHeaderCellDef mat-sort-header> EMAIL </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.email}} </mat-cell>
</ng-container>
<ng-container matColumnDef="created">
<mat-header-cell *matHeaderCellDef mat-sort-header> CREATED </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.created}} </mat-cell>
</ng-container>
<ng-container matColumnDef="status">
<mat-header-cell *matHeaderCellDef mat-sort-header> STATUS </mat-header-cell>
<mat-cell *matCellDef="let user">
<span *ngIf="user.status === 'activated'" class="badge badge-success badge-pill"> {{user.status}} </span>
<span *ngIf="user.status === 'deactivated'" class="badge badge-danger badge-pill"> {{user.status}} </span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="options">
<mat-header-cell *matHeaderCellDef> OPTIONS </mat-header-cell>
<mat-cell *matCellDef="let user" class="dropdown">
<button mat-raised-button color="warn" [matMenuTriggerFor]="menu" class="btn btn-outline-danger ml-1"><i class="fa fa-ellipsis-h"></i></button>
<mat-menu #menu='matMenu'>
<button mat-menu-item (click)="changeStaffType(user.id, 'SuperAdmin')">Change to Super Admin</button>
<button mat-menu-item (click)="changeStaffType(user.id, 'Admin')">Change to Admin</button>
<button mat-menu-item (click)="changeStaffType(user.id, 'Enroller')">Change to Enroller</button>
<button mat-menu-item (click)="changeStaffType(user.id, 'View')">Change to View Only</button>
<button *ngIf="user.status === 'activated'" mat-menu-item (click)="deactivateStaff(user.id)">Deactivate User</button>
<button *ngIf="user.status === 'deactivated'" mat-menu-item (click)="activateStaff(user.id)">Activate User</button>
</mat-menu>
</mat-cell>
<ng-container matColumnDef="userId">
<mat-header-cell *matHeaderCellDef mat-sort-header> USER ID </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.userid}} </mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let transaction; columns: displayedColumns"></mat-row>
<mat-row *matRowDef="let user; columns: displayedColumns"></mat-row>
</mat-table>
<mat-paginator [pageSize]="5" [pageSizeOptions]="[5, 10, 20, 50, 100]" showFirstLastButtons></mat-paginator>