Skip to content

Commit

Permalink
fix: added new user dialog password validator
Browse files Browse the repository at this point in the history
  • Loading branch information
RFbkak37y3kIY committed May 6, 2024
1 parent ac06349 commit 8e56a9b
Show file tree
Hide file tree
Showing 2 changed files with 301 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
[placeholder]="'preference.users.dialog.password' | translate"
[type]="hidePass1 ? 'password' : 'text'"
[formControl]="password"
(change)="validate()" (blur)="validate()" (keyup)="validate()"
required />
<mat-error *ngIf="data.isNew && password?.errors?.['required']">The password {{'validators.required' | translate }}</mat-error>
<mat-error *ngIf="password?.errors?.['minlength']">
Expand All @@ -85,7 +86,9 @@
<mat-error *ngIf="password?.errors?.['maxlength']">
{{ password?.errors?.['maxlength']?.requiredLength }} {{'validators.maxChars' | translate }}
</mat-error>

<mat-error *ngIf="password?.errors?.['missingCharacters'] && !password?.errors?.['maxlength'] && !password?.errors?.['minlength'] && !password?.errors?.['required']">
{{'validators.pattern' | translate }} [aA-Zz], [0-9] and "~!@#$%^&*()_"]
</mat-error>
<mat-icon matSuffix
style="cursor: pointer"
(click)="hidePass1 = !hidePass1"
Expand Down Expand Up @@ -113,6 +116,9 @@
<mat-error *ngIf="password2?.errors?.['maxlength']">
{{ password2?.errors?.['maxlength']?.requiredLength }} {{'validators.maxChars' | translate }}
</mat-error>
<mat-error *ngIf="password2?.errors?.['missingCharacters'] && !password2?.errors?.['maxlength'] && !password2?.errors?.['minlength'] && !password?.errors?.['required']">
{{'validators.pattern' | translate }} [aA-Zz], [0-9] and "~!@#$%^&*()_"]
</mat-error>
</mat-form-field>
</div>
<strong>{{ 'preference.users.dialog.personalInfo' | translate }}</strong>
Expand Down Expand Up @@ -237,7 +243,7 @@
class="setting-btn-ok"
(click)="onSubmit()"
cdkFocusInitial
[disabled]="isCopy && isNotChanged">
[disabled]="(isCopy && isNotChanged) || isDisabled">
{{'LINK.buttons.save' | translate}}
</button>
</div>
Loading

0 comments on commit 8e56a9b

Please sign in to comment.