argos/dmp-frontend/src/app/ui/admin/user/listing/role-editor/user-role-editor.component....

33 lines
1.6 KiB
HTML
Raw Normal View History

2023-11-28 14:15:16 +01:00
<form class="row user-role-editor" *ngIf="formGroup" [formGroup]="formGroup" (ngSubmit)="formSubmit()">
2024-04-01 15:04:33 +02:00
<div class="row align-items-center">
<div *ngIf="!this.nowEditing"class="roles col">
2023-11-28 14:15:16 +01:00
<ng-container *ngFor="let role of this.formGroup.get('roles').value">
2021-07-23 13:16:59 +02:00
<div>
2024-04-16 10:02:17 +02:00
<span class="user-role" [ngClass]="{'user': role == appRole.User, 'tenant-manager': role == appRole.TenantManager, 'admin': role == appRole.Admin, 'tenant-admin': role == appRole.TenantAdmin, 'tenant-user': role == appRole.TenantUser,'tenant-description-template-editor': role == appRole.TenantDescriptionTemplateEditor}">
2023-11-28 14:15:16 +01:00
{{enumUtils.toAppRoleString(role)}}
</span>
</div>
</ng-container>
2020-12-04 17:26:20 +01:00
</div>
2024-04-01 15:04:33 +02:00
<div class="col-8">
<mat-form-field *ngIf="this.nowEditing" class="w-100">
<mat-select formControlName="roles" multiple required>
<ng-container *ngFor="let role of appRoleEnumValues">
<mat-option [value]="role">{{enumUtils.toAppRoleString(role)}}</mat-option>
</ng-container>
</mat-select>
<mat-error *ngIf="formGroup.get('roles').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
2018-02-01 15:04:36 +01:00
2024-04-01 15:04:33 +02:00
<button *ngIf="!this.nowEditing" class="col" mat-icon-button color="primary" type="button" (click)="editItem()">
2023-11-28 14:15:16 +01:00
<mat-icon class="mat-24" matTooltip="{{'USER-LISTING.ACTIONS.EDIT' | translate}}">edit</mat-icon>
<span class="row-action"></span>
2018-02-01 15:04:36 +01:00
</button>
2023-11-28 14:15:16 +01:00
<button *ngIf="this.nowEditing" class="col-auto save-button" mat-icon-button color="primary" type="submit">
<mat-icon class="mat-24" matTooltip="{{'USER-LISTING.ACTIONS.SAVE' | translate}}">save</mat-icon>
2018-02-01 15:04:36 +01:00
</button>
2024-04-01 15:04:33 +02:00
</div>
2018-10-05 17:00:54 +02:00
</form>