Skip to content

Commit

Permalink
Merge pull request #491 from etn-ccis/fix/reset-password-error-config
Browse files Browse the repository at this point in the history
Fix ResetPasswordScreen error configuration
  • Loading branch information
ektaghag-eaton authored Sep 29, 2023
2 parents 61162d3 + 95adc78 commit 7f59807
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,21 @@ export const ResetPasswordScreen: React.FC<ResetPasswordScreenProps> = (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,
WorkflowCardHeaderProps,
WorkflowCardInstructionProps,
WorkflowCardActionsProps,
PasswordProps,
errorDisplayConfig = errorManagerConfig,
slots = {},
slotProps = {},
} = props;
Expand Down Expand Up @@ -148,6 +155,8 @@ export const ResetPasswordScreen: React.FC<ResetPasswordScreenProps> = (props) =
passwordRef,
confirmRef,
...PasswordProps,
initialNewPasswordValue: passwordInput,
initialConfirmPasswordValue: confirmInput,
onPasswordChange: (passwordData: { password: string; confirm: string }): void => {
updateFields(passwordData);
PasswordProps?.onPasswordChange?.(passwordData);
Expand Down

0 comments on commit 7f59807

Please sign in to comment.