From 778d6623898431151b49c96eaf546f1deda68f09 Mon Sep 17 00:00:00 2001 From: Alexandru Munteanu <alexandru.munt@gmail.com> Date: Wed, 18 Apr 2018 11:08:13 +0300 Subject: [PATCH] fix(status-update): remove manuscript status updates from frontend --- .../src/components/WizardFormStep.js | 8 -------- .../src/components/Dashboard/AssignHEModal.js | 18 ++++++----------- .../Dashboard/EditorInChiefActions.js | 17 +++++----------- .../Dashboard/HandlingEditorActions.js | 20 ++++--------------- 4 files changed, 15 insertions(+), 48 deletions(-) diff --git a/packages/component-wizard/src/components/WizardFormStep.js b/packages/component-wizard/src/components/WizardFormStep.js index b50d4d3e4..2a9f4dd9f 100644 --- a/packages/component-wizard/src/components/WizardFormStep.js +++ b/packages/component-wizard/src/components/WizardFormStep.js @@ -45,14 +45,6 @@ const submitManuscript = ( ...values, }), ) - .then(() => - dispatch( - actions.updateCollection({ - id: project.id, - status: 'submitted', - }), - ), - ) .then(() => { history.push(redirectPath, { project: project.id, version: version.id }) }) diff --git a/packages/components-faraday/src/components/Dashboard/AssignHEModal.js b/packages/components-faraday/src/components/Dashboard/AssignHEModal.js index 592a67253..37ab14727 100644 --- a/packages/components-faraday/src/components/Dashboard/AssignHEModal.js +++ b/packages/components-faraday/src/components/Dashboard/AssignHEModal.js @@ -35,22 +35,16 @@ class AssignHEModal extends React.Component { showModal, hideModal, setModalError, - updateCollection, getCollections, } = this.props assignHandlingEditor(email, collectionId).then( () => { - updateCollection({ - id: collectionId, - status: 'he-invited', - }).then(() => { - getCollections() - hideModal() - showModal({ - type: 'confirmation', - title: 'Assignation Sent', - cancelText: 'OK', - }) + getCollections() + hideModal() + showModal({ + type: 'confirmation', + title: 'Assignation Sent', + cancelText: 'OK', }) }, e => { diff --git a/packages/components-faraday/src/components/Dashboard/EditorInChiefActions.js b/packages/components-faraday/src/components/Dashboard/EditorInChiefActions.js index d9bdde64a..74d43be79 100644 --- a/packages/components-faraday/src/components/Dashboard/EditorInChiefActions.js +++ b/packages/components-faraday/src/components/Dashboard/EditorInChiefActions.js @@ -65,7 +65,6 @@ export default compose( connect(null, { revokeHandlingEditor, assignHandlingEditor, - updateCollection: actions.updateCollection, getCollections: actions.getCollections, }), withTheme, @@ -85,7 +84,6 @@ export default compose( getHandlingEditor, hideModal, setModalError, - updateCollection, getCollections, }) => actionType => { const editor = get(project, 'handlingEditor') @@ -112,16 +110,11 @@ export default compose( confirmText: 'Revoke invite', onConfirm: () => revokeHandlingEditor(invitation.id, project.id).then(() => { - updateCollection({ - id: project.id, - status: 'submitted', - }).then(() => { - getCollections() - hideModal() - showModal({ - type: 'success', - title: 'Handling Editor Assignation Revoked', - }) + getCollections() + hideModal() + showModal({ + type: 'success', + title: 'Handling Editor Assignation Revoked', }) }, handleError(setModalError)), } diff --git a/packages/components-faraday/src/components/Dashboard/HandlingEditorActions.js b/packages/components-faraday/src/components/Dashboard/HandlingEditorActions.js index da92ff4ec..64885e96a 100644 --- a/packages/components-faraday/src/components/Dashboard/HandlingEditorActions.js +++ b/packages/components-faraday/src/components/Dashboard/HandlingEditorActions.js @@ -55,7 +55,6 @@ const HandlingEditorActions = ({ showHEModal }) => ( export default compose( connect(null, { getCollections: actions.getCollections, - updateCollection: actions.updateCollection, }), withModal({ modalKey: 'he-action', @@ -68,7 +67,6 @@ export default compose( hideModal, project, getCollections, - updateCollection, setModalError, }) => modalType => { const invitation = project.invitations.find( @@ -80,13 +78,8 @@ export default compose( subtitle: `Clicking "Agree" will assign you as Handling Editor for this Manuscript.`, onConfirm: () => { handlingEditorDecision(invitation.id, project.id, true).then(() => { - updateCollection({ - id: project.id, - status: 'under-review', - }).then(() => { - getCollections() - hideModal() - }) + getCollections() + hideModal() }, handleError(setModalError)) }, } @@ -97,13 +90,8 @@ export default compose( onConfirm: reason => () => { handlingEditorDecision(invitation.id, project.id, false, reason).then( () => { - updateCollection({ - id: project.id, - status: 'submitted', - }).then(() => { - getCollections() - hideModal() - }) + getCollections() + hideModal() }, handleError(setModalError), ) -- GitLab