<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">
			<div>
				<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>
	</div>
	<mat-form-field *ngIf="this.nowEditing" class="select-role roles-width-180 col-auto">
		<mat-select formControlName="appRoles" multiple required>
			<ng-container *ngFor="let role of getPrincipalAppRoleValues()">
				<mat-option [value]="role">{{getPrincipalAppRoleWithLanguage(role)}}</mat-option>
			</ng-container>
		</mat-select>
		<mat-error *ngIf="getFormControl('appRoles').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
	</mat-form-field>

	<button *ngIf="!this.nowEditing" class="col-auto" mat-icon-button color="primary" type="button" (click)="editItem()">
		<!-- <mat-icon class="mat-24">edit</mat-icon> -->
		<span class="row-action">{{'USERS.ACTIONS.EDIT' | translate}}</span>
	</button>
	<button *ngIf="this.nowEditing" class="col-auto" mat-icon-button color="primary" type="submit">
		<!-- <mat-icon class="mat-24">save</mat-icon> -->
		<span class="row-action">{{'USERS.ACTIONS.SAVE' | translate}}</span>
	</button>
</form>
