diff --git a/src/lib/alerts/index.jsx b/src/lib/alerts/index.jsx index 9fb1800f8..96d16a04e 100644 --- a/src/lib/alerts/index.jsx +++ b/src/lib/alerts/index.jsx @@ -48,6 +48,7 @@ const alerts = [ }, { alertId: 'creatingError', + clearList: ['creating', 'createSuccess'], content: ( { - this.props.onShowSaveSuccessAlert(); - // there is nothing we expect to find in response that we need to check here + // there's an http response object available here, but we don't need to examine + // it, because there are no values contained in it that we care about this.props.onUpdatedProject(this.props.loadingState); + this.props.onShowSaveSuccessAlert(); }) .catch(err => { // NOTE: should throw up a notice for user @@ -95,11 +101,11 @@ const ProjectSaverHOC = function (WrappedComponent) { this.props.onShowCreatingAlert(); return this.storeProject(null) .then(response => { - this.props.onShowCreateSuccessAlert(); this.props.onCreatedProject(response.id.toString(), this.props.loadingState); + this.props.onShowCreateSuccessAlert(); }) .catch(err => { - this.props.onShowAlert('savingError'); + this.props.onShowAlert('creatingError'); this.props.onProjectError(err); }); } @@ -111,11 +117,11 @@ const ProjectSaverHOC = function (WrappedComponent) { title: this.props.reduxProjectTitle }) .then(response => { - this.props.onShowCreateSuccessAlert(); this.props.onCreatedProject(response.id.toString(), this.props.loadingState); + this.props.onShowCreateSuccessAlert(); }) .catch(err => { - this.props.onShowAlert('savingError'); + this.props.onShowAlert('creatingError'); this.props.onProjectError(err); }); } @@ -127,11 +133,11 @@ const ProjectSaverHOC = function (WrappedComponent) { title: this.props.reduxProjectTitle }) .then(response => { - this.props.onShowCreateSuccessAlert(); this.props.onCreatedProject(response.id.toString(), this.props.loadingState); + this.props.onShowCreateSuccessAlert(); }) .catch(err => { - this.props.onShowAlert('savingError'); + this.props.onShowAlert('creatingError'); this.props.onProjectError(err); }); } @@ -170,8 +176,8 @@ const ProjectSaverHOC = function (WrappedComponent) { ); }) .catch(err => { - // @todo do something here log.error(err); + throw err; // pass the error up the chain }); } render () { @@ -188,7 +194,6 @@ const ProjectSaverHOC = function (WrappedComponent) { onAutoUpdateProject, onCreatedProject, onCreateProject, - onManualUpdateProject, onProjectError, onShowAlert, onShowCreateSuccessAlert, @@ -224,7 +229,6 @@ const ProjectSaverHOC = function (WrappedComponent) { onAutoUpdateProject: PropTypes.func, onCreateProject: PropTypes.func, onCreatedProject: PropTypes.func, - onManualUpdateProject: PropTypes.func, onProjectError: PropTypes.func, onShowAlert: PropTypes.func, onShowCreateSuccessAlert: PropTypes.func, @@ -256,7 +260,6 @@ const ProjectSaverHOC = function (WrappedComponent) { onAutoUpdateProject: () => dispatch(autoUpdateProject()), onCreatedProject: (projectId, loadingState) => dispatch(doneCreatingProject(projectId, loadingState)), onCreateProject: () => dispatch(createProject()), - onManualUpdateProject: () => dispatch(manualUpdateProject()), onProjectError: error => dispatch(projectError(error)), onShowAlert: alertType => dispatch(showStandardAlert(alertType)), onShowCreateSuccessAlert: () => showAlertWithTimeout(dispatch, 'createSuccess'),