forked from ustaxcourt/ef-cms
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1124 from flexion/962-close-modals
962: globally close modals when backend errors occur
- Loading branch information
Showing
4 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { clearModalAction } from '../actions/clearModalAction'; | ||
import { setAlertFromExceptionAction } from '../actions/setAlertFromExceptionAction'; | ||
import { setCurrentPageAction } from '../actions/setCurrentPageAction'; | ||
import { unsetFormSubmittingAction } from '../actions/unsetFormSubmittingAction'; | ||
|
||
export const notFoundErrorSequence = [ | ||
unsetFormSubmittingAction, | ||
setAlertFromExceptionAction, | ||
clearModalAction, | ||
setCurrentPageAction('Error'), | ||
]; |
2 changes: 2 additions & 0 deletions
2
web-client/src/presenter/sequences/setCurrentPageErrorSequence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
]; |
4 changes: 3 additions & 1 deletion
4
web-client/src/presenter/sequences/unauthorizedErrorSequence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
]; |
2 changes: 2 additions & 0 deletions
2
web-client/src/presenter/sequences/unidentifiedUserErrorSequence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { clearModalAction } from '../actions/clearModalAction'; | ||
import { redirectToCognitoAction } from '../actions/redirectToCognitoAction'; | ||
import { setAlertFromExceptionAction } from '../actions/setAlertFromExceptionAction'; | ||
import { unsetFormSubmittingAction } from '../actions/unsetFormSubmittingAction'; | ||
|
||
export const unidentifiedUserErrorSequence = [ | ||
unsetFormSubmittingAction, | ||
setAlertFromExceptionAction, | ||
clearModalAction, | ||
redirectToCognitoAction, | ||
]; |