diff --git a/packages/component-manuscript/src/components/ManuscriptDetails.js b/packages/component-manuscript/src/components/ManuscriptDetails.js index 5c8545b657c15853562e220dfe4b00babe969607..6fb65899934fa971827742936b9fe26a3ba93b65 100644 --- a/packages/component-manuscript/src/components/ManuscriptDetails.js +++ b/packages/component-manuscript/src/components/ManuscriptDetails.js @@ -7,6 +7,7 @@ import { Authors, Files } from './' import { Expandable } from '../molecules/' const ManuscriptDetails = ({ + startExpanded, fragment: { files = {}, authors = [], @@ -15,7 +16,7 @@ const ManuscriptDetails = ({ }, }) => ( <Root> - <Expandable label="Details" startExpanded> + <Expandable label="Details" startExpanded={startExpanded}> {!!abstract && ( <Expandable label="ABSTRACT" startExpanded> <Text dangerouslySetInnerHTML={{ __html: abstract }} /> diff --git a/packages/component-manuscript/src/components/ManuscriptLayout.js b/packages/component-manuscript/src/components/ManuscriptLayout.js index ea3c21e2a366384e16ffbf697a8ac4828992f064..318822b55f342766aef036cc697548d2c17aca9c 100644 --- a/packages/component-manuscript/src/components/ManuscriptLayout.js +++ b/packages/component-manuscript/src/components/ManuscriptLayout.js @@ -52,7 +52,13 @@ const ManuscriptLayout = ({ project={project} version={version} /> - <ManuscriptDetails fragment={version} /> + <ManuscriptDetails + fragment={version} + startExpanded={isEmpty(version.revision)} + /> + {version.revision && ( + <SubmitRevision project={project} version={version} /> + )} <ReviewsAndReports project={project} version={version} /> {editorialRecommendations.length > 0 && ( <EditorialComments @@ -61,9 +67,6 @@ const ManuscriptLayout = ({ recommendations={editorialRecommendations} /> )} - {version.revision && ( - <SubmitRevision project={project} version={version} /> - )} </Container> <SideBar flex={1}> <SideBarActions project={project} version={version} /> diff --git a/packages/component-manuscript/src/components/SubmitRevision.js b/packages/component-manuscript/src/components/SubmitRevision.js index a25bb1539a11e616b98aa5ce40c79a191205139a..0baa62663023112b0a07bfd5177593ae420dc40d 100644 --- a/packages/component-manuscript/src/components/SubmitRevision.js +++ b/packages/component-manuscript/src/components/SubmitRevision.js @@ -16,6 +16,7 @@ import HTML5Backend from 'react-dnd-html5-backend' import { ValidatedField, Button } from '@pubsweet/ui' import { AbstractEditor, TitleEditor } from 'xpub-edit' import { AuthorList, Files } from 'pubsweet-components-faraday/src/components' +import { submitRevision } from 'pubsweet-component-wizard/src/redux/conversion' import AutosaveIndicator from 'pubsweet-component-wizard/src/components/AutosaveIndicator' import { toClass, @@ -31,7 +32,6 @@ import { import { uploadFile, deleteFile, - getSignedUrl, getRequestStatus, } from 'pubsweet-components-faraday/src/redux/files' @@ -79,7 +79,10 @@ const SubmitRevision = ({ <Title>Reply text*</Title> <Row> <FullWidth className="full-width"> - <ValidatedField component={TextAreaField} name="response" /> + <ValidatedField + component={TextAreaField} + name="commentsToReviewers" + /> </FullWidth> </Row> <Row left> @@ -94,7 +97,7 @@ const SubmitRevision = ({ ))} </Row> <FilePicker - allowedFileExtensions={['pdf', 'doc', 'docx', 'png']} + allowedFileExtensions={['pdf', 'doc', 'docx']} onUpload={addFile} > <ActionText left={12}>Upload file</ActionText> @@ -140,8 +143,7 @@ export default compose( changeForm, uploadFile, deleteFile, - getSignedUrl, - getRequestStatus, + submitRevision, }, ), withHandlers({ @@ -183,14 +185,16 @@ export default compose( }, authors: get(version, 'revision.authors'), files: get(version, 'revision.files') || [], - response: get(version, 'revision.response'), + commentsToReviewers: get(version, 'revision.commentsToReviewers'), }, responseFiles: get(formValues, 'files.responseToReviewers') || [], })), reduxForm({ form: 'revision', onChange: debounce(onChange, 1000, { maxWait: 5000 }), - onSubmit: () => {}, + onSubmit: (values, dispatch, { submitRevision, version, project }) => { + // submitRevision(project.id, version.id) + }, }), DragDropContext(HTML5Backend), toClass, diff --git a/packages/component-wizard/src/redux/conversion.js b/packages/component-wizard/src/redux/conversion.js index b88ae87c8175ffbbfbcba7d92ff1286932821795..6b2086aa12da55ebc21ea706140d467163a540bb 100644 --- a/packages/component-wizard/src/redux/conversion.js +++ b/packages/component-wizard/src/redux/conversion.js @@ -87,8 +87,8 @@ export const createRevision = ( const { id, submitted, - recommendations, invitations, + recommendations, ...prev } = previousVersion return dispatch(