mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-11 16:45:13 +00:00
fix(console): ui/ux improvements, delete user phone, pinned cards, user grant role load fix (#357)
* project grant member edit * project grant member dialog, import cleanup * readd project roles * user login-methods cleanup * fix sw config, user grant context * delete user grants, context for creation, search * contributor box shadow * password to detail view * user detail notification * ui ux improvements * pinned section * project pinnable grid, rem columns, move buttons * user detail mfa, move user comonents, user grant * del phone * user detail service * delete phone for auth, mgmt user
This commit is contained in:
@@ -77,25 +77,22 @@
|
||||
|
||||
<ng-container matColumnDef="roleNamesList">
|
||||
<th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.GRANT.ROLENAMESLIST' | translate }} </th>
|
||||
<td mat-cell *matCellDef="let grant">
|
||||
<!-- TODO check behaviour for empty role projects -->
|
||||
<ng-container *ngIf="roleOptions.length === 0; else showOptions">
|
||||
<td mat-cell *matCellDef="let grant; let i = index">
|
||||
<ng-container *ngIf="loadedProjectId !== grant.projectId">
|
||||
<span class="role app-label" *ngFor="let role of grant.roleKeysList">{{role}}</span>
|
||||
<button mat-icon-button (click)="loadRoleOptions(grant.projectId)">
|
||||
<mat-icon>edit</mat-icon>
|
||||
<i class="las la-edit"></i>
|
||||
</button>
|
||||
</ng-container>
|
||||
<ng-template #showOptions>
|
||||
<mat-form-field class="form-field" appearance="outline" *ngIf="projectId">
|
||||
<mat-label>{{ 'PROJECT.GRANT.TITLE' | translate }}</mat-label>
|
||||
<mat-select [(ngModel)]="grant.roleKeysList" multiple [disabled]="allowCreate == false"
|
||||
(selectionChange)="updateRoles(grant, $event)">
|
||||
<mat-option *ngFor="let role of roleOptions" [value]="role.key">
|
||||
{{ role.displayName }} {{role.key}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</ng-template>
|
||||
<mat-form-field class="form-field" appearance="outline" *ngIf="loadedProjectId === grant.projectId">
|
||||
<mat-label>{{ 'PROJECT.GRANT.TITLE' | translate }}</mat-label>
|
||||
<mat-select [(ngModel)]="grant.roleKeysList" multiple [disabled]="allowCreate == false"
|
||||
(selectionChange)="updateRoles(grant, $event)">
|
||||
<mat-option *ngFor="let role of roleOptions" [value]="role.key">
|
||||
{{role.key}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ export class UserGrantsComponent implements OnInit, AfterViewInit {
|
||||
public roleOptions: ProjectRoleView.AsObject[] = [];
|
||||
public routerLink: any = [''];
|
||||
|
||||
public loadedProjectId: string = '';
|
||||
constructor(
|
||||
private userService: MgmtUserService,
|
||||
private projectService: ProjectService,
|
||||
@@ -121,16 +122,14 @@ export class UserGrantsComponent implements OnInit, AfterViewInit {
|
||||
|
||||
public getRoleOptions(projectId: string): void {
|
||||
this.projectService.SearchProjectRoles(projectId, 100, 0).then(resp => {
|
||||
this.loadedProjectId = projectId;
|
||||
this.roleOptions = resp.toObject().resultList;
|
||||
console.log(this.roleOptions);
|
||||
});
|
||||
}
|
||||
|
||||
updateRoles(grant: UserGrant.AsObject, selectionChange: MatSelectChange): void {
|
||||
console.log(grant, selectionChange.value);
|
||||
this.userService.UpdateUserGrant(grant.id, grant.userId, selectionChange.value)
|
||||
.then((newmember: UserGrant) => {
|
||||
console.log(newmember.toObject());
|
||||
this.toast.showInfo('Grant updated!');
|
||||
}).catch(error => {
|
||||
this.toast.showError(error.message);
|
||||
|
||||
Reference in New Issue
Block a user