Skip to content

Commit

Permalink
10553: Display initial message for users verifying pending email; Dis…
Browse files Browse the repository at this point in the history
…play new error message for when the request times out;
  • Loading branch information
nechama-krigsman committed Dec 4, 2024
1 parent 09ef490 commit 0f7d774
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const setInitialVerifyAlertMessageAction = () => {
return {
alertInfo: {
message: 'DAWSON is updating your email. Please wait.',
title: 'Updating email address',
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ const expiredTokenAlertError = {
title: 'Verification email link expired',
};

const requestTimedOutAlertError = {
message: (
<>
Request timed out. This potentially means another process is currently
updating this user. Your request cannot be completed. Please try to log
in. If you’re still having trouble, contact{' '}
<a href={`mailto:${TROUBLESHOOTING_INFO.APP_SUPPORT_EMAIL}`}>
{TROUBLESHOOTING_INFO.APP_SUPPORT_EMAIL}
</a>
.
</>
),
title: 'Request Timed Out',
};

export const genericAlertError = {
message: (
<>
Expand Down Expand Up @@ -52,8 +67,12 @@ export const verifyUserPendingEmailAction = async ({
alertError: expiredTokenAlertError,
});
}
if (e.message === 'Endpoint request timed out') {
return path.error({
alertError: requestTimedOutAlertError,
});
}

//if timeout display new message
return path.error({
alertError: genericAlertError,
});
Expand Down
7 changes: 5 additions & 2 deletions web-client/src/presenter/sequences/gotoVerifyEmailSequence.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { clearUserAction } from '../actions/clearUserAction';
import { navigateToLoginAction } from '@web-client/presenter/actions/Login/navigateToLoginAction';
import { setAlertErrorAction } from '@web-client/presenter/actions/setAlertErrorAction';
import { setAlertInfoAction } from '@web-client/presenter/actions/setAlertInfoAction';
import { setAlertSuccessAction } from '@web-client/presenter/actions/setAlertSuccessAction';
import { setInitialVerifyAlertMessageAction } from '@web-client/presenter/actions/setInitialVerifyAlertMessageAction';
import { verifyUserPendingEmailAction } from '../actions/verifyUserPendingEmailAction';

export const gotoVerifyEmailSequence = [
//set initial message here
setInitialVerifyAlertMessageAction,
setAlertInfoAction,
navigateToLoginAction,
verifyUserPendingEmailAction,
{
error: [setAlertErrorAction],
success: [setAlertSuccessAction],
},
clearUserAction,
navigateToLoginAction,
] as unknown as (props: { token: string }) => void;

0 comments on commit 0f7d774

Please sign in to comment.