Skip to content

Commit

Permalink
Merge pull request #1124 from flexion/962-close-modals
Browse files Browse the repository at this point in the history
962: globally close modals when backend errors occur
  • Loading branch information
rachaelparris authored Mar 15, 2019
2 parents 5de9fd7 + 68860c5 commit 8fda695
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions web-client/src/presenter/sequences/notFoundErrorSequence.js
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'),
];
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,
];
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,
];
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,
];

0 comments on commit 8fda695

Please sign in to comment.