Skip to content
Snippets Groups Projects
Commit dafeb160 authored by Sinzeanu Demetriad's avatar Sinzeanu Demetriad
Browse files

Merge branch 'HIN-1116-documentation' of...

Merge branch 'HIN-1116-documentation' of gitlab.coko.foundation:xpub/xpub-faraday into HIN-1116-documentation
parents 7a20fb9f 53c5b257
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!191Hin 1116 documentation
......@@ -14,29 +14,68 @@ The `withSubmitRevision` HOC contains the logic for submitting a manuscript vers
`submitRevision` namespace contains the following fields:
Name|Type|Description
---|---|---
. initialValues|`{...fragment}`| Object containing the initial state of the fragment
. addFile|`({ file: object, type: string, fragment: object }) => any`|Uploads the file to the server
journal|`???`|???
. collection|`object`|Object containing the selected collection
. fragment|`object`|Object containing the selected fragment
. canSubmit|`bool`|Value representing if the form doesn't have errors and can be submitted
. addAuthor|`({ author, collectionId: string, fragmentId: string }) => any`|An async call to add an author to the manuscript
changeForm|`function`|Des Cri Pti On!
. deleteFile|`({ fileId: string, type: string }) => any`|Removes the file from the server
. currentUser|`object`|Object containing the currently logged user
onAuthorEdit|`function`|Des Cri Pti On!
. deleteAuthor|`({ authorId, fragmentId, collectionId }) => any`|An async call to remove an existing author from the manuscript
. getSignedUrl|`(id: string) => Promise({signedURL: string})`|An async call that returns the securized S3 file url
hasFormError|`function`|Des Cri Pti On!
formErrors|`function`|Des Cri Pti On!
addResponseFile|`file => any`|Uploads the file and adds it on the form
deleteResponseFile|`file => any`|Deletes the file from the server and removes it from the form
collection|`object`|Object containing the selected collection
fragment|`object`|Object containing the selected fragment
journal|`object`|Deprecated object containing manuscript types
currentUser|`object`|Object containing the currently logged user
initialValues|`{...fragment}`| Object containing the initial state of the fragment
isEditingAuthor|`bool`|Value representing if the current user is the editing author
. onChange|`(reduxFormValues, dispatch, { collection, fragment }) => any`|Used to autosave new fragment when fields change
. onSubmit|`(reduxFormValues, dispatch, { history, fragment, collection, showModal, setFetching, canSubmit })`|Handles the submission of a new manuscript version
. validate|`({ editAuthors: , files: array, responseToReviewers: object }) => errors: object`|Checks the form for required fields and returns the errors
. responseFile|`file`|Value containing the revision's file for the reviewer's response
canSubmit|`bool`|Value representing if the form doesn't have errors and can be submitted
hasFormError|`bool`|Value representing if the form has any errors
formErrors|`bool`|Value representing if the form has any errors
responseFile|`file`|Value containing the revision's file for the reviewer's response
addAuthor|`({ author, collectionId: string, fragmentId: string }) => any`|An async call to add an author to the manuscript
deleteAuthor|`({ authorId, fragmentId, collectionId }) => any`|An async call to remove an existing author from the manuscript
onAuthorEdit|`index => authorEditIndex: number`|Chages the form to allow editing of the selected author and returns his index
addFile|`({ file: object, type: string, fragment: object }) => any`|Uploads the file to the server
deleteFile|`({ fileId: string, type: string }) => any`|Removes the file from the server
getSignedUrl|`(id: string) => Promise({signedURL: string})`|An async call that returns the securized S3 file url
addResponseFile|`file => any`|Uploads the file then updates the form
deleteResponseFile|`file => any`|Deletes the file from the server then updates the form
onChange|`(reduxFormValues, dispatch, { collection, fragment }) => any`|Used to autosave new fragment when fields change
validate|`({ editAuthors: , files: array, responseToReviewers: object }) => errors: object`|Checks the form for required fields and returns the errors
onSubmit|`(reduxFormValues, dispatch, { history, fragment, collection, showModal, setFetching, canSubmit })`|Handles the submission of a new manuscript version
```javascript
const ManuscriptLayout = ({submitRevision}) =>(
<SubmitRevision {...submitRevision} />
)
const SubmitRevision = ({...}) => (
<Root>
<DetailsAndAuthors
addAuthor={addAuthor}
changeForm={changeForm}
collection={collection}
deleteAuthor={deleteAuthor}
formErrors={formErrors}
fragment={fragment}
isAuthorEdit={isEditingAuthor}
manuscriptTypes={journal.manuscriptTypes}
onAuthorEdit={onAuthorEdit}
/>
<ManuscriptFiles
changeForm={changeForm}
collection={collection}
deleteFile={deleteFile}
downloadFile={downloadFile}
formErrors={formErrors}
formName="revision"
fragment={fragment}
getSignedUrl={getSignedUrl}
previewFile={previewFile}
token={currentUser.token}
uploadFile={addFile}
/>
<ResponseToReviewer
file={responseFile}
getSignedUrl={getSignedUrl}
isFetching={isFetching}
onDelete={deleteResponseFile}
onUpload={addResponseFile}
token={currentUser.token}
/>
</Root>
```
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