Spaces:
Running
Running
Create user-info.component.html
Browse files
flare-ui/src/app/components/user-info/user-info.component.html
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="user-info-container">
|
2 |
+
<h2>Change Password</h2>
|
3 |
+
|
4 |
+
<form [formGroup]="passwordForm" (ngSubmit)="onSubmit()">
|
5 |
+
<mat-form-field appearance="outline" class="full-width">
|
6 |
+
<mat-label>Current Password</mat-label>
|
7 |
+
<input matInput
|
8 |
+
[type]="hideCurrentPassword ? 'password' : 'text'"
|
9 |
+
formControlName="currentPassword"
|
10 |
+
autocomplete="current-password">
|
11 |
+
<button mat-icon-button matSuffix
|
12 |
+
(click)="hideCurrentPassword = !hideCurrentPassword"
|
13 |
+
type="button">
|
14 |
+
<mat-icon>{{hideCurrentPassword ? 'visibility_off' : 'visibility'}}</mat-icon>
|
15 |
+
</button>
|
16 |
+
<mat-error *ngIf="passwordForm.get('currentPassword')?.hasError('required')">
|
17 |
+
Current password is required
|
18 |
+
</mat-error>
|
19 |
+
</mat-form-field>
|
20 |
+
|
21 |
+
<mat-form-field appearance="outline" class="full-width">
|
22 |
+
<mat-label>New Password</mat-label>
|
23 |
+
<input matInput
|
24 |
+
[type]="hideNewPassword ? 'password' : 'text'"
|
25 |
+
formControlName="newPassword"
|
26 |
+
autocomplete="new-password">
|
27 |
+
<button mat-icon-button matSuffix
|
28 |
+
(click)="hideNewPassword = !hideNewPassword"
|
29 |
+
type="button">
|
30 |
+
<mat-icon>{{hideNewPassword ? 'visibility_off' : 'visibility'}}</mat-icon>
|
31 |
+
</button>
|
32 |
+
<mat-error *ngIf="passwordForm.get('newPassword')?.hasError('required')">
|
33 |
+
New password is required
|
34 |
+
</mat-error>
|
35 |
+
<mat-error *ngIf="passwordForm.get('newPassword')?.hasError('minlength')">
|
36 |
+
Password must be at least 8 characters
|
37 |
+
</mat-error>
|
38 |
+
<mat-error *ngIf="passwordForm.get('newPassword')?.hasError('pattern')">
|
39 |
+
Password must contain uppercase, lowercase and numbers
|
40 |
+
</mat-error>
|
41 |
+
</mat-form-field>
|
42 |
+
|
43 |
+
<div class="password-strength" *ngIf="passwordForm.get('newPassword')?.value">
|
44 |
+
<div class="strength-label">
|
45 |
+
Password Strength: <span [class]="'strength-' + passwordStrengthColor">{{passwordStrengthText}}</span>
|
46 |
+
</div>
|
47 |
+
<mat-progress-bar [value]="passwordStrength" [color]="passwordStrengthColor"></mat-progress-bar>
|
48 |
+
</div>
|
49 |
+
|
50 |
+
<mat-form-field appearance="outline" class="full-width">
|
51 |
+
<mat-label>Confirm New Password</mat-label>
|
52 |
+
<input matInput
|
53 |
+
[type]="hideConfirmPassword ? 'password' : 'text'"
|
54 |
+
formControlName="confirmPassword"
|
55 |
+
autocomplete="new-password">
|
56 |
+
<button mat-icon-button matSuffix
|
57 |
+
(click)="hideConfirmPassword = !hideConfirmPassword"
|
58 |
+
type="button">
|
59 |
+
<mat-icon>{{hideConfirmPassword ? 'visibility_off' : 'visibility'}}</mat-icon>
|
60 |
+
</button>
|
61 |
+
<mat-error *ngIf="passwordForm.get('confirmPassword')?.hasError('required')">
|
62 |
+
Please confirm your password
|
63 |
+
</mat-error>
|
64 |
+
<mat-error *ngIf="passwordForm.get('confirmPassword')?.hasError('passwordMismatch')">
|
65 |
+
Passwords do not match
|
66 |
+
</mat-error>
|
67 |
+
</mat-form-field>
|
68 |
+
|
69 |
+
<div class="form-actions">
|
70 |
+
<button mat-raised-button color="primary"
|
71 |
+
type="submit"
|
72 |
+
[disabled]="passwordForm.invalid">
|
73 |
+
Save
|
74 |
+
</button>
|
75 |
+
</div>
|
76 |
+
</form>
|
77 |
+
</div>
|