Skip to content
Snippets Groups Projects
Commit fa2453c3 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

feat(submit-revision): add submit revision function

git push
parent 9b72dfa5
No related branches found
No related tags found
1 merge request!14Sprint #15
......@@ -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 }} />
......
......@@ -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} />
......
......@@ -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,
......
......@@ -87,8 +87,8 @@ export const createRevision = (
const {
id,
submitted,
recommendations,
invitations,
recommendations,
...prev
} = previousVersion
return dispatch(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment