add-operator-dialog.component.html
4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<mat-card>
<mat-toolbar color="primary">Add Operator</mat-toolbar>
<form [formGroup]="form">
<mat-card-content>
<div fxLayout="row wrap">
<div class="mb-1">
<mat-form-field style="width: 100%">
<input matInput placeholder="First name" autofocus [formControl]="form.controls['fname']">
</mat-form-field>
<small *ngIf="form.controls['fname'].hasError('required') && form.controls['fname'].touched"
class="mat-text-warn">You must include a first name.</small>
<small *ngIf="form.controls['fname'].hasError('minlength') && form.controls['fname'].touched"
class="mat-text-warn">Your first name must be at least 5 characters long.</small>
<small *ngIf="form.controls['fname'].hasError('maxlength') && form.controls['fname'].touched"
class="mat-text-warn">Your first name cannot exceed 10 characters.</small>
</div>
</div>
<div fxLayout="row wrap">
<div class="mb-1">
<mat-form-field style="width: 100%">
<input matInput placeholder="Last name" [formControl]="form.controls['lname']">
</mat-form-field>
<small *ngIf="form.controls['lname'].hasError('required') && form.controls['lname'].touched"
class="mat-text-warn">You must include a last name.</small>
<small *ngIf="form.controls['lname'].hasError('minlength') && form.controls['lname'].touched"
class="mat-text-warn">Your last name must be at least 5 characters long.</small>
<small *ngIf="form.controls['lname'].hasError('maxlength') && form.controls['lname'].touched"
class="mat-text-warn">Your last name cannot exceed 10 characters.</small>
</div>
</div>
<div fxLayout="row wrap">
<div class="mb-1">
<mat-form-field style="width: 100%">
<input matInput placeholder="User name" [formControl]="form.controls['uname']">
</mat-form-field>
<small *ngIf="form.controls['uname'].hasError('required') && form.controls['uname'].touched"
class="mat-text-warn">You must include a user name.</small>
<small *ngIf="form.controls['uname'].hasError('minlength') && form.controls['uname'].touched"
class="mat-text-warn">Your user name must be at least 5 characters long.</small>
<small *ngIf="form.controls['uname'].hasError('maxlength') && form.controls['uname'].touched"
class="mat-text-warn">Your user name cannot exceed 10 characters.</small>
</div>
</div>
<div class="mb-1">
<mat-form-field style="width: 100%">
<input matInput placeholder="Email address" [formControl]="form.controls['email']" type="email">
</mat-form-field>
<small *ngIf="form.controls['email'].hasError('required') && form.controls['email'].touched"
class="mat-text-warn">You must include an email address.</small>
<small *ngIf="form.controls['email'].errors?.email && form.controls['email'].touched" class="mat-text-warn">You
must include a valid email address.</small>
</div>
<div class="mb-1">
<mat-form-field style="width: 100%">
<input matInput placeholder="Password" [formControl]="form.controls['password']" type="password">
</mat-form-field>
<small *ngIf="form.controls['password'].hasError('required') && form.controls['password'].touched"
class="mat-text-warn">You must include password.</small>
</div>
<div class="mb-1">
<mat-form-field style="width: 100%">
<mat-select placeholder="Role" [formControl]="form.controls['role']">
<mat-option>--</mat-option>
<mat-option value="SUPERADMIN">Super Admin</mat-option>
<mat-option value="ADMIN">Admin</mat-option>
<mat-option value="MARKETING">Marketing</mat-option>
<mat-option value="DEVELOPER">Developer</mat-option>
<mat-option value="QA">QA</mat-option>
<mat-option value="CS">CS</mat-option>
</mat-select>
</mat-form-field>
<small *ngIf="form.controls['role'].hasError('required') && form.controls['role'].touched"
class="mat-text-warn">You must include role.</small>
</div>
</mat-card-content>
<hr>
<mat-card-actions>
<button mat-raised-button color="primary" type="submit" [disabled]="!form.valid">Submit</button>
<button mat-raised-button color="accent" (click)="dialogRef.close(false)">Close</button>
</mat-card-actions>
</form>
</mat-card>