From 3ac22ac6200e9cd81ee977fd28e0c2d69f98dd24 Mon Sep 17 00:00:00 2001 From: ektaghag-eaton Date: Thu, 28 Sep 2023 15:43:35 +0530 Subject: [PATCH 1/2] Fix ResetPasswordScreen error configuration --- .../screens/ResetPasswordScreen/ResetPasswordScreen.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreen.tsx b/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreen.tsx index c1b649e8..8bff4520 100644 --- a/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreen.tsx +++ b/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreen.tsx @@ -32,6 +32,14 @@ export const ResetPasswordScreen: React.FC = (props) = const passwordRef = useRef(null); const confirmRef = useRef(null); const { triggerError, errorManagerConfig } = useErrorManager(); + const errorDisplayConfig = { + ...errorManagerConfig, + ...props.errorDisplayConfig, + onClose: (): void => { + if (props.errorDisplayConfig && props.errorDisplayConfig.onClose) props.errorDisplayConfig.onClose(); + if (errorManagerConfig.onClose) errorManagerConfig?.onClose(); + }, + }; const { WorkflowCardBaseProps, @@ -39,7 +47,6 @@ export const ResetPasswordScreen: React.FC = (props) = WorkflowCardInstructionProps, WorkflowCardActionsProps, PasswordProps, - errorDisplayConfig = errorManagerConfig, slots = {}, slotProps = {}, } = props; From 95adc784e510283fefb96e3349caf77f82ba09aa Mon Sep 17 00:00:00 2001 From: ektaghag-eaton Date: Thu, 28 Sep 2023 18:15:28 +0530 Subject: [PATCH 2/2] show password and confirm field after error --- .../src/screens/ResetPasswordScreen/ResetPasswordScreen.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreen.tsx b/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreen.tsx index 8bff4520..d96f6bbd 100644 --- a/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreen.tsx +++ b/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreen.tsx @@ -155,6 +155,8 @@ export const ResetPasswordScreen: React.FC = (props) = passwordRef, confirmRef, ...PasswordProps, + initialNewPasswordValue: passwordInput, + initialConfirmPasswordValue: confirmInput, onPasswordChange: (passwordData: { password: string; confirm: string }): void => { updateFields(passwordData); PasswordProps?.onPasswordChange?.(passwordData);