gns3-web-ui/src/app/components/user-management/edit-user-dialog/edit-user-dialog.component.html
2022-02-28 13:50:10 +01:00

43 lines
1.9 KiB
HTML

<h1 mat-dialog-title>Update user</h1>
<form [formGroup]="editUserForm" class="input-field">
<mat-form-field class="input-field">
<input matInput type="text" formControlName="username" placeholder="Username" />
<mat-error *ngIf="form.username?.touched && form.username?.errors && form.username?.errors.required"
>Username is required</mat-error>
<mat-error *ngIf="form.username?.errors && form.username?.errors.pattern"
>Username is incorrect</mat-error>
<mat-error *ngIf="form.username?.errors && form.username?.errors.userExists"
>User with this username exists</mat-error>
</mat-form-field>
<mat-form-field class="input-field">
<input matInput type="text" formControlName="full_name" placeholder="Full name" />
</mat-form-field>
<mat-form-field class="input-field">
<input matInput type="text" formControlName="email" placeholder="Email" />
<mat-error *ngIf="form.email?.touched && form.email?.errors && form.email?.errors.required"
>Email is required</mat-error>
<mat-error *ngIf="form.email?.errors && form.email?.errors.email"
>Email is invalid</mat-error>
<mat-error *ngIf="form.email?.errors && form.email?.errors.emailExists"
>User with this email exists</mat-error>
</mat-form-field>
<mat-form-field class="input-field">
<input matInput type="password" formControlName="password" placeholder="Password" />
<mat-error *ngIf="form.password?.touched && form.password?.errors"
>Password must be between 6 and 100 characters</mat-error>
</mat-form-field>
<mat-checkbox formControlName="is_active">Is active</mat-checkbox>
<div mat-dialog-actions class="button-div">
<button mat-button (click)="onCancelClick()" color="accent">Cancel</button>
<button mat-button (click)="onEditClick()" tabindex="2" mat-raised-button color="primary"
[disabled]="!editUserForm.valid">
Edit user
</button>
</div>
</form>