|
3 | 3 | <div class="col-md-4"> |
4 | 4 | <h1 [translate]="'reset.finish.title'">Reset password</h1> |
5 | 5 |
|
6 | | - <div class="alert alert-danger" [translate]="'reset.finish.messages.keymissing'" *ngIf="initialized && !key"> |
7 | | - <strong>The password reset key is missing.</strong> |
8 | | - </div> |
| 6 | + @if (initialized && !key) { |
| 7 | + <div class="alert alert-danger" [translate]="'reset.finish.messages.keymissing'"> |
| 8 | + <strong>The password reset key is missing.</strong> |
| 9 | + </div> |
| 10 | + } |
9 | 11 |
|
10 | | - <div class="alert alert-warning" *ngIf="key && !success"> |
11 | | - <span [translate]="'reset.finish.messages.info'">Choose a new password</span> |
12 | | - </div> |
| 12 | + @if (key && !success) { |
| 13 | + <div class="alert alert-warning"> |
| 14 | + <span [translate]="'reset.finish.messages.info'">Choose a new password</span> |
| 15 | + </div> |
| 16 | + } |
13 | 17 |
|
14 | | - <div class="alert alert-danger" *ngIf="error"> |
15 | | - <span [translate]="'reset.finish.messages.error'" |
16 | | - >Your password couldn't be reset. Remember a password request is only valid for 24 hours.</span |
17 | | - > |
18 | | - </div> |
19 | | - |
20 | | - <div class="alert alert-success" *ngIf="success"> |
21 | | - <span [translate]="'reset.finish.messages.success'"><strong>Your password has been reset.</strong> Please </span> |
22 | | - <a class="alert-link" routerLink="/login" [translate]="'global.messages.info.authenticated.link'">sign in</a>. |
23 | | - </div> |
| 18 | + @if (error) { |
| 19 | + <div class="alert alert-danger"> |
| 20 | + <span [translate]="'reset.finish.messages.error'" |
| 21 | + >Your password couldn't be reset. Remember a password request is only valid for 24 hours.</span |
| 22 | + > |
| 23 | + </div> |
| 24 | + } |
24 | 25 |
|
25 | | - <div class="alert alert-danger" *ngIf="doNotMatch" [translate]="'global.messages.error.dontmatch'"> |
26 | | - The password and its confirmation do not match! |
27 | | - </div> |
| 26 | + @if (success) { |
| 27 | + <div class="alert alert-success"> |
| 28 | + <span [translate]="'reset.finish.messages.success'"><strong>Your password has been reset.</strong> Please </span> |
| 29 | + <a class="alert-link" routerLink="/login" [translate]="'global.messages.info.authenticated.link'">sign in</a>. |
| 30 | + </div> |
| 31 | + } |
28 | 32 |
|
29 | | - <div *ngIf="key && !success"> |
30 | | - <form name="form" role="form" (ngSubmit)="finishReset()" [formGroup]="passwordForm"> |
31 | | - <div class="mb-3"> |
32 | | - <label class="form-label" for="newPassword" [translate]="'global.form.newpassword.label'">New password</label> |
33 | | - <input |
34 | | - type="password" |
35 | | - class="form-control" |
36 | | - id="newPassword" |
37 | | - name="newPassword" |
38 | | - placeholder="{{ 'global.form.newpassword.placeholder' | translate }}" |
39 | | - formControlName="newPassword" |
40 | | - data-cy="resetPassword" |
41 | | - #newPassword |
42 | | - /> |
| 33 | + @if (doNotMatch) { |
| 34 | + <div class="alert alert-danger" [translate]="'global.messages.error.dontmatch'"> |
| 35 | + The password and its confirmation do not match! |
| 36 | + </div> |
| 37 | + } |
43 | 38 |
|
44 | | - <div |
45 | | - *ngIf=" |
| 39 | + @if (key && !success) { |
| 40 | + <div> |
| 41 | + <form name="form" role="form" (ngSubmit)="finishReset()" [formGroup]="passwordForm"> |
| 42 | + <div class="mb-3"> |
| 43 | + <label class="form-label" for="newPassword" [translate]="'global.form.newpassword.label'">New password</label> |
| 44 | + <input |
| 45 | + type="password" |
| 46 | + class="form-control" |
| 47 | + id="newPassword" |
| 48 | + name="newPassword" |
| 49 | + placeholder="{{ 'global.form.newpassword.placeholder' | translate }}" |
| 50 | + formControlName="newPassword" |
| 51 | + data-cy="resetPassword" |
| 52 | + #newPassword |
| 53 | + /> |
| 54 | + @if ( |
46 | 55 | passwordForm.get('newPassword')!.invalid && |
47 | 56 | (passwordForm.get('newPassword')!.dirty || passwordForm.get('newPassword')!.touched) |
48 | | - " |
49 | | - > |
50 | | - <small |
51 | | - class="form-text text-danger" |
52 | | - *ngIf="passwordForm.get('newPassword')?.errors?.required" |
53 | | - [translate]="'global.messages.validate.newpassword.required'" |
54 | | - > |
55 | | - Your password is required. |
56 | | - </small> |
57 | | - |
58 | | - <small |
59 | | - class="form-text text-danger" |
60 | | - *ngIf="passwordForm.get('newPassword')?.errors?.minlength" |
61 | | - [translate]="'global.messages.validate.newpassword.minlength'" |
62 | | - > |
63 | | - Your password is required to be at least 4 characters. |
64 | | - </small> |
65 | | - |
66 | | - <small |
67 | | - class="form-text text-danger" |
68 | | - *ngIf="passwordForm.get('newPassword')?.errors?.maxlength" |
69 | | - [translate]="'global.messages.validate.newpassword.maxlength'" |
70 | | - > |
71 | | - Your password cannot be longer than 50 characters. |
72 | | - </small> |
| 57 | + ) { |
| 58 | + <div> |
| 59 | + @if (passwordForm.get('newPassword')?.errors?.required) { |
| 60 | + <small class="form-text text-danger" [translate]="'global.messages.validate.newpassword.required'"> |
| 61 | + Your password is required. |
| 62 | + </small> |
| 63 | + } |
| 64 | + @if (passwordForm.get('newPassword')?.errors?.minlength) { |
| 65 | + <small class="form-text text-danger" [translate]="'global.messages.validate.newpassword.minlength'"> |
| 66 | + Your password is required to be at least 4 characters. |
| 67 | + </small> |
| 68 | + } |
| 69 | + @if (passwordForm.get('newPassword')?.errors?.maxlength) { |
| 70 | + <small class="form-text text-danger" [translate]="'global.messages.validate.newpassword.maxlength'"> |
| 71 | + Your password cannot be longer than 50 characters. |
| 72 | + </small> |
| 73 | + } |
| 74 | + </div> |
| 75 | + } |
| 76 | + <jhi-password-strength-bar [passwordToCheck]="passwordForm.get('newPassword')!.value"></jhi-password-strength-bar> |
73 | 77 | </div> |
74 | | - |
75 | | - <jhi-password-strength-bar [passwordToCheck]="passwordForm.get('newPassword')!.value"></jhi-password-strength-bar> |
76 | | - </div> |
77 | | - |
78 | | - <div class="mb-3"> |
79 | | - <label class="form-label" for="confirmPassword" [translate]="'global.form.confirmpassword.label'" |
80 | | - >New password confirmation</label |
81 | | - > |
82 | | - <input |
83 | | - type="password" |
84 | | - class="form-control" |
85 | | - id="confirmPassword" |
86 | | - name="confirmPassword" |
87 | | - placeholder="{{ 'global.form.confirmpassword.placeholder' | translate }}" |
88 | | - formControlName="confirmPassword" |
89 | | - data-cy="confirmResetPassword" |
90 | | - /> |
91 | | - |
92 | | - <div |
93 | | - *ngIf=" |
| 78 | + <div class="mb-3"> |
| 79 | + <label class="form-label" for="confirmPassword" [translate]="'global.form.confirmpassword.label'" |
| 80 | + >New password confirmation</label |
| 81 | + > |
| 82 | + <input |
| 83 | + type="password" |
| 84 | + class="form-control" |
| 85 | + id="confirmPassword" |
| 86 | + name="confirmPassword" |
| 87 | + placeholder="{{ 'global.form.confirmpassword.placeholder' | translate }}" |
| 88 | + formControlName="confirmPassword" |
| 89 | + data-cy="confirmResetPassword" |
| 90 | + /> |
| 91 | + @if ( |
94 | 92 | passwordForm.get('confirmPassword')!.invalid && |
95 | 93 | (passwordForm.get('confirmPassword')!.dirty || passwordForm.get('confirmPassword')!.touched) |
96 | | - " |
97 | | - > |
98 | | - <small |
99 | | - class="form-text text-danger" |
100 | | - *ngIf="passwordForm.get('confirmPassword')?.errors?.required" |
101 | | - [translate]="'global.messages.validate.confirmpassword.required'" |
102 | | - > |
103 | | - Your password confirmation is required. |
104 | | - </small> |
105 | | - |
106 | | - <small |
107 | | - class="form-text text-danger" |
108 | | - *ngIf="passwordForm.get('confirmPassword')?.errors?.minlength" |
109 | | - [translate]="'global.messages.validate.confirmpassword.minlength'" |
110 | | - > |
111 | | - Your password confirmation is required to be at least 4 characters. |
112 | | - </small> |
113 | | - |
114 | | - <small |
115 | | - class="form-text text-danger" |
116 | | - *ngIf="passwordForm.get('confirmPassword')?.errors?.maxlength" |
117 | | - [translate]="'global.messages.validate.confirmpassword.maxlength'" |
118 | | - > |
119 | | - Your password confirmation cannot be longer than 50 characters. |
120 | | - </small> |
| 94 | + ) { |
| 95 | + <div> |
| 96 | + @if (passwordForm.get('confirmPassword')?.errors?.required) { |
| 97 | + <small class="form-text text-danger" [translate]="'global.messages.validate.confirmpassword.required'"> |
| 98 | + Your password confirmation is required. |
| 99 | + </small> |
| 100 | + } |
| 101 | + @if (passwordForm.get('confirmPassword')?.errors?.minlength) { |
| 102 | + <small class="form-text text-danger" [translate]="'global.messages.validate.confirmpassword.minlength'"> |
| 103 | + Your password confirmation is required to be at least 4 characters. |
| 104 | + </small> |
| 105 | + } |
| 106 | + @if (passwordForm.get('confirmPassword')?.errors?.maxlength) { |
| 107 | + <small class="form-text text-danger" [translate]="'global.messages.validate.confirmpassword.maxlength'"> |
| 108 | + Your password confirmation cannot be longer than 50 characters. |
| 109 | + </small> |
| 110 | + } |
| 111 | + </div> |
| 112 | + } |
121 | 113 | </div> |
122 | | - </div> |
123 | | - |
124 | | - <button |
125 | | - type="submit" |
126 | | - [disabled]="passwordForm.invalid" |
127 | | - class="btn btn-primary" |
128 | | - [translate]="'reset.finish.form.button'" |
129 | | - data-cy="submit" |
130 | | - > |
131 | | - Reset Password |
132 | | - </button> |
133 | | - </form> |
134 | | - </div> |
| 114 | + <button |
| 115 | + type="submit" |
| 116 | + [disabled]="passwordForm.invalid" |
| 117 | + class="btn btn-primary" |
| 118 | + [translate]="'reset.finish.form.button'" |
| 119 | + data-cy="submit" |
| 120 | + > |
| 121 | + Reset Password |
| 122 | + </button> |
| 123 | + </form> |
| 124 | + </div> |
| 125 | + } |
135 | 126 | </div> |
136 | 127 | </div> |
137 | 128 | </div> |
0 commit comments