refactor: put the input password in a separate component
Some checks failed
Build and Deploy Angular App / build (push) Failing after 1m17s
Some checks failed
Build and Deploy Angular App / build (push) Failing after 1m17s
This commit is contained in:
@ -53,47 +53,7 @@
|
||||
}
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field color="accent" style="margin-bottom: 20px">
|
||||
<mat-label>Пароль</mat-label>
|
||||
<input matInput
|
||||
matTooltip="Укажите пароль"
|
||||
formControlName="password"
|
||||
required
|
||||
[type]="hidePass ? 'password' : 'text'">
|
||||
|
||||
<button mat-icon-button matSuffix (click)="togglePassword($event)" [attr.aria-label]="'Hide password'"
|
||||
[attr.aria-pressed]="hidePass">
|
||||
<mat-icon>{{ hidePass ? 'visibility_off' : 'visibility' }}</mat-icon>
|
||||
</button>
|
||||
|
||||
@if (createAdminForm.get('password')?.hasError('required')) {
|
||||
<mat-error>
|
||||
Пароль является <i>обязательным</i>
|
||||
</mat-error>
|
||||
}
|
||||
|
||||
@if (createAdminForm.get('password')?.hasError('minlength')) {
|
||||
<mat-error>
|
||||
Пароль должен быть не менее {{ policy.minimumLength }} символов
|
||||
</mat-error>
|
||||
}
|
||||
|
||||
@if (createAdminForm.get('password')?.hasError('pattern')) {
|
||||
<mat-error>
|
||||
Пароль должен содержать:
|
||||
@if (policy.requireLettersDifferentCase) {
|
||||
* Латинские символы разных регистров
|
||||
} @else if (policy.requireLetter) {
|
||||
* Один латинский символ
|
||||
} @else if (policy.requireDigit) {
|
||||
* Одну цифру
|
||||
}
|
||||
@if (policy.requireSpecialCharacter) {
|
||||
* специальный символ
|
||||
}
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<password-input [formGroup]="createAdminForm" [isSetupMode]="true"/>
|
||||
|
||||
<mat-form-field color="accent">
|
||||
<mat-label>Повторите пароль</mat-label>
|
||||
|
Reference in New Issue
Block a user