Change password view enhancement to support and display password validations
This commit is contained in:
@@ -4,6 +4,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { UntypedFormBuilder, Validators, ValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { PasswordsUtility } from 'app/core/utils/passwords-utility';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
/**
|
||||
* Change Password Dialog component.
|
||||
@@ -14,6 +15,8 @@ import { PasswordsUtility } from 'app/core/utils/passwords-utility';
|
||||
styleUrls: ['./change-password-dialog.component.scss']
|
||||
})
|
||||
export class ChangePasswordDialogComponent implements OnInit {
|
||||
minPasswordLength: number = environment.minPasswordLength | 12;
|
||||
|
||||
/** Change Password Form */
|
||||
changePasswordForm: any;
|
||||
/** Password input field type. */
|
||||
@@ -37,15 +40,6 @@ export class ChangePasswordDialogComponent implements OnInit {
|
||||
this.createChangePasswordForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the visibility of the password input field.
|
||||
*
|
||||
* Changes the input type between 'password' and 'text'.
|
||||
*/
|
||||
togglePasswordVisibility(index: number) {
|
||||
this.passwordInputType[index] = this.passwordInputType[index] === 'password' ? 'text' : 'password';
|
||||
}
|
||||
|
||||
/** Change Password form */
|
||||
createChangePasswordForm() {
|
||||
this.changePasswordForm = this.formBuilder.group({
|
||||
|
||||
Reference in New Issue
Block a user