From 68860c5d84290396400580ab15943d4d0f56a1da Mon Sep 17 00:00:00 2001 From: Rachael Parris <43251054+rachaelparris@users.noreply.github.com> Date: Fri, 15 Mar 2019 09:31:37 -0700 Subject: [PATCH] 962: globally close modals when backend errors occur --- web-client/src/presenter/sequences/notFoundErrorSequence.js | 2 ++ .../src/presenter/sequences/setCurrentPageErrorSequence.js | 2 ++ .../src/presenter/sequences/unauthorizedErrorSequence.js | 4 +++- .../src/presenter/sequences/unidentifiedUserErrorSequence.js | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web-client/src/presenter/sequences/notFoundErrorSequence.js b/web-client/src/presenter/sequences/notFoundErrorSequence.js index e8aca8ee2e9..c2ffb10cbfa 100644 --- a/web-client/src/presenter/sequences/notFoundErrorSequence.js +++ b/web-client/src/presenter/sequences/notFoundErrorSequence.js @@ -1,3 +1,4 @@ +import { clearModalAction } from '../actions/clearModalAction'; import { setAlertFromExceptionAction } from '../actions/setAlertFromExceptionAction'; import { setCurrentPageAction } from '../actions/setCurrentPageAction'; import { unsetFormSubmittingAction } from '../actions/unsetFormSubmittingAction'; @@ -5,5 +6,6 @@ import { unsetFormSubmittingAction } from '../actions/unsetFormSubmittingAction' export const notFoundErrorSequence = [ unsetFormSubmittingAction, setAlertFromExceptionAction, + clearModalAction, setCurrentPageAction('Error'), ]; diff --git a/web-client/src/presenter/sequences/setCurrentPageErrorSequence.js b/web-client/src/presenter/sequences/setCurrentPageErrorSequence.js index 42b44cb068d..0048739d842 100644 --- a/web-client/src/presenter/sequences/setCurrentPageErrorSequence.js +++ b/web-client/src/presenter/sequences/setCurrentPageErrorSequence.js @@ -1,8 +1,10 @@ import { set } from 'cerebral/factories'; import { state } from 'cerebral'; import { setAlertFromExceptionAction } from '../actions/setAlertFromExceptionAction'; +import { clearModalAction } from '../actions/clearModalAction'; export const setCurrentPageErrorSequence = [ set(state.submitting, false), setAlertFromExceptionAction, + clearModalAction, ]; diff --git a/web-client/src/presenter/sequences/unauthorizedErrorSequence.js b/web-client/src/presenter/sequences/unauthorizedErrorSequence.js index 0b0ccc997da..4f1827248bd 100644 --- a/web-client/src/presenter/sequences/unauthorizedErrorSequence.js +++ b/web-client/src/presenter/sequences/unauthorizedErrorSequence.js @@ -1,9 +1,11 @@ +import { clearModalAction } from '../actions/clearModalAction'; +import { redirectToCognitoAction } from '../actions/redirectToCognitoAction'; import { setAlertFromExceptionAction } from '../actions/setAlertFromExceptionAction'; import { unsetFormSubmittingAction } from '../actions/unsetFormSubmittingAction'; -import { redirectToCognitoAction } from '../actions/redirectToCognitoAction'; export const unauthorizedErrorSequence = [ unsetFormSubmittingAction, setAlertFromExceptionAction, + clearModalAction, redirectToCognitoAction, ]; diff --git a/web-client/src/presenter/sequences/unidentifiedUserErrorSequence.js b/web-client/src/presenter/sequences/unidentifiedUserErrorSequence.js index 4837835cea4..73816ca26e6 100644 --- a/web-client/src/presenter/sequences/unidentifiedUserErrorSequence.js +++ b/web-client/src/presenter/sequences/unidentifiedUserErrorSequence.js @@ -1,3 +1,4 @@ +import { clearModalAction } from '../actions/clearModalAction'; import { redirectToCognitoAction } from '../actions/redirectToCognitoAction'; import { setAlertFromExceptionAction } from '../actions/setAlertFromExceptionAction'; import { unsetFormSubmittingAction } from '../actions/unsetFormSubmittingAction'; @@ -5,5 +6,6 @@ import { unsetFormSubmittingAction } from '../actions/unsetFormSubmittingAction' export const unidentifiedUserErrorSequence = [ unsetFormSubmittingAction, setAlertFromExceptionAction, + clearModalAction, redirectToCognitoAction, ];