2021-04-12 11:05:12 +02:00
|
|
|
|
<form class="row user-role-editor" [formGroup]="formGroup" (ngSubmit)="formSubmit()">
|
|
|
|
|
<div *ngIf="!this.nowEditing"class="roles col">
|
|
|
|
|
<ng-container *ngFor="let role of this.formGroup.get('appRoles').value">
|
2021-07-23 13:16:59 +02:00
|
|
|
|
<div>
|
2021-04-12 11:05:12 +02:00
|
|
|
|
<span class="user-role" [ngClass]="{'user': role == 0, 'manager': role == 1, 'admin': role == 2, 'dataset-template-editor': role == 3}">
|
|
|
|
|
{{getPrincipalAppRoleWithLanguage(role)}}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</ng-container>
|
2020-12-04 17:26:20 +01:00
|
|
|
|
</div>
|
2021-04-12 11:05:12 +02:00
|
|
|
|
<mat-form-field *ngIf="this.nowEditing" class="select-role roles-width-180 col-auto">
|
2018-10-05 17:00:54 +02:00
|
|
|
|
<mat-select formControlName="appRoles" multiple required>
|
2021-04-13 10:19:09 +02:00
|
|
|
|
<ng-container *ngFor="let role of getPrincipalAppRoleValues()">
|
2021-07-23 13:16:59 +02:00
|
|
|
|
<mat-option [value]="role">{{getPrincipalAppRoleWithLanguage(role)}}</mat-option>
|
2021-04-13 10:19:09 +02:00
|
|
|
|
</ng-container>
|
2018-02-01 15:04:36 +01:00
|
|
|
|
</mat-select>
|
2018-11-27 18:33:17 +01:00
|
|
|
|
<mat-error *ngIf="getFormControl('appRoles').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
2018-02-01 15:04:36 +01:00
|
|
|
|
</mat-form-field>
|
|
|
|
|
|
2021-04-12 11:05:12 +02:00
|
|
|
|
<button *ngIf="!this.nowEditing" class="col-auto" mat-icon-button color="primary" type="button" (click)="editItem()">
|
2020-12-04 17:26:20 +01:00
|
|
|
|
<!-- <mat-icon class="mat-24">edit</mat-icon> -->
|
|
|
|
|
<span class="row-action">{{'USERS.ACTIONS.EDIT' | translate}}</span>
|
2018-02-01 15:04:36 +01:00
|
|
|
|
</button>
|
2021-04-12 11:05:12 +02:00
|
|
|
|
<button *ngIf="this.nowEditing" class="col-auto" mat-icon-button color="primary" type="submit">
|
2020-12-04 17:26:20 +01:00
|
|
|
|
<!-- <mat-icon class="mat-24">save</mat-icon> -->
|
|
|
|
|
<span class="row-action">{{'USERS.ACTIONS.SAVE' | translate}}</span>
|
2018-02-01 15:04:36 +01:00
|
|
|
|
</button>
|
2018-10-05 17:00:54 +02:00
|
|
|
|
</form>
|