From 3b70e23da04fd7abe2636dd0c29e9c77934bd239 Mon Sep 17 00:00:00 2001 From: Mazdak Gibran <141390141+mazdakgibran@users.noreply.github.com> Date: Tue, 27 Jan 2026 11:29:39 +0500 Subject: [PATCH] Add reset password modal to user management Introduced a new ResetPasswordModalComponent for resetting user passwords from the setup user page. Updated the setup-user component and template to include a reset password button and modal, and refactored password-hide-show to support resetting its state. Also adjusted reset-password component to enable userId input. --- .../password-hide-show.component.ts | 5 +- .../reset-password-modal.component.html | 78 ++++++++++++ .../reset-password-modal.component.scss | 0 .../reset-password-modal.component.spec.ts | 23 ++++ .../reset-password-modal.component.ts | 112 ++++++++++++++++++ .../reset-password.component.ts | 2 +- .../setup-user/setup-user.component.html | 13 +- .../setup-user/setup-user.component.ts | 20 +++- 8 files changed, 244 insertions(+), 9 deletions(-) create mode 100644 src/app/user-management/reset-password-modal/reset-password-modal.component.html create mode 100644 src/app/user-management/reset-password-modal/reset-password-modal.component.scss create mode 100644 src/app/user-management/reset-password-modal/reset-password-modal.component.spec.ts create mode 100644 src/app/user-management/reset-password-modal/reset-password-modal.component.ts diff --git a/src/app/shared/components/password-hide-show/password-hide-show.component.ts b/src/app/shared/components/password-hide-show/password-hide-show.component.ts index c937edd..601af4d 100644 --- a/src/app/shared/components/password-hide-show/password-hide-show.component.ts +++ b/src/app/shared/components/password-hide-show/password-hide-show.component.ts @@ -13,7 +13,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms'; styleUrl: './password-hide-show.component.scss' }) export class PasswordHideShowComponent { -@Output() onEyeClick = new EventEmitter(); + @Output() onEyeClick = new EventEmitter(); @Input() showPassword : boolean = false; inputType : String = ''; constructor() { } @@ -26,4 +26,7 @@ export class PasswordHideShowComponent { this.showPassword = !this.showPassword; this.onEyeClick.emit(); } + reset() { + this.showPassword = true; + } } diff --git a/src/app/user-management/reset-password-modal/reset-password-modal.component.html b/src/app/user-management/reset-password-modal/reset-password-modal.component.html new file mode 100644 index 0000000..75546b7 --- /dev/null +++ b/src/app/user-management/reset-password-modal/reset-password-modal.component.html @@ -0,0 +1,78 @@ +