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

docs(ContextualBoxes/ManuscriptDetails/submissionRevisionfolders): Wrote...

docs(ContextualBoxes/ManuscriptDetails/submissionRevisionfolders): Wrote documentation for files ins
parent 8eddd668
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!191Hin 1116 documentation
Showing
with 209 additions and 67 deletions
......@@ -67,7 +67,7 @@ AuthorReply.propTypes = {
/** Previews the file from the server then updates the form. */
onPreview: PropTypes.func,
/** Reply File. */
replyFile: PropTypes.object, //eslint-disable-line
replyFile: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
}
AuthorReply.defaultProps = {
replyContent: undefined,
......
......@@ -10,6 +10,7 @@ import {
Text,
indexReviewers,
} from '../'
import { FragmentsOnCompositeTypes } from 'graphql'
const SubmittedReportsNumberForAuthorReviews = ({ reports }) => (
<Row fitContent justify="flex-end">
......
......@@ -108,7 +108,6 @@ const HERecommendation = ({
/>
</ItemOverrideAlert>
</Row>
{get(formValues, 'recommendation') === 'minor' ||
get(formValues, 'recommendation') === 'major' ? (
<Row mt={2}>
......@@ -148,7 +147,6 @@ const HERecommendation = ({
</ResponsiveItem>
</ResponsiveRow>
)}
<Row justify="flex-end" mt={2}>
<Button
data-test-id="button-editorial-recommendation-submit"
......
......@@ -2,10 +2,37 @@ HE recommendation.
```js
const formValues = {
recommendation: 'minor-revision',
recommendation: 'minor',
}
const options = [
{
value: 'publish',
label: 'Publish',
message: 'Recommend Manuscript for Publishing',
button: 'Submit Recommendation',
},
{
value: 'reject',
label: 'Reject',
message: 'Recommend Manuscript for Rejection',
button: 'Submit Recommendation',
},
{
value: 'minor',
label: 'Request Minor Revision',
message: 'Request Minor Revision',
button: 'Request Revision',
},
{
value: 'major',
label: 'Request Major Revision',
message: 'Request Major Revision',
button: 'Request Revision',
},
]
;<HERecommendation
formValues={formValues}
options={options}
modalKey="heRecommendation"
onRecommendationSubmit={(values, props) => {
props.setFetching(true)
......
......@@ -2,33 +2,65 @@ Manuscript header without a HE assigned.
```js
const authors = [
{
{
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ecbafc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'michael.felps@gmail.com',
firstName: 'Michael',
lastName: 'Felps',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ecsdfc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'barrack.obama@gmail.com',
firstName: 'Barrack',
lastName: 'Obama',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ec56fc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'barrack.obama@gmail1.com',
firstName: 'Barrack 1',
lastName: 'Obama',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-144cbafc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'barrack.obama@gmail2.com',
firstName: 'Barrack 2',
lastName: 'Obama',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ec33fc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
]
......@@ -93,33 +125,65 @@ Manuscript header with a pending HE invitation.
```js
const authors = [
{
{
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ecbafc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'michael.felps@gmail.com',
firstName: 'Michael',
lastName: 'Felps',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ecsdfc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'barrack.obama@gmail.com',
firstName: 'Barrack',
lastName: 'Obama',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ec56fc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'barrack.obama@gmail1.com',
firstName: 'Barrack 1',
lastName: 'Obama',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-144cbafc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'barrack.obama@gmail2.com',
firstName: 'Barrack 2',
lastName: 'Obama',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ec33fc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
]
......@@ -205,32 +269,64 @@ Manuscript header with a pending HE invitation.
```js
const authors = [
{
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ecbafc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'michael.felps@gmail.com',
firstName: 'Michael',
lastName: 'Felps',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ecsdfc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'barrack.obama@gmail.com',
firstName: 'Barrack',
lastName: 'Obama',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ec56fc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'barrack.obama@gmail1.com',
firstName: 'Barrack 1',
lastName: 'Obama',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-144cbafc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
{
email: 'barrack.obama@gmail2.com',
firstName: 'Barrack 2',
lastName: 'Obama',
affiliation: 'TSD',
affiliationNumber: 1,
country: 'AX',
id: '5001955e-cc18-42d4-b0ca-15ec33fc48fe',
email: 'john.doe@gmail.com',
firstName: 'John',
lastName: 'Doe',
isSubmitting: true,
isCorresponding: true,
title: 'mr',
},
]
......@@ -267,7 +363,11 @@ const fragment = {
},
}
const currentUser = {}
const currentUser = {
permissions: {
canAssignHE: false,
},
}
const journal = {
manuscriptTypes: [
......
Manuscript version component
```js
const history = {
push: v => console.log('go to version -> ', v)
};
const fragment={};
const collection={
fragments: ['1','2'],
};
push: v => console.log('go to version -> ', v),
}
<ManuscriptVersion
const fragment = {}
const collection = {
fragments: ['1', '2'],
}
const versions = [
{ label: 'Version 1', value: '10d28459-6f8e-4f6c-a57e-65979e5f8d2' },
{ label: 'Version 2', value: '10d28459-6f8e-4f6c-a57e-65979e5f854' },
]
;<ManuscriptVersion
collection={collection}
history={history}
fragment={fragment}
/>
versions={versions}
/>
```
......@@ -5,10 +5,9 @@ const formValues = {
decision: 'accept',
}
;<RemoteOpener>
{({ toggle, expanded }) => (
{({ toggle }) => (
<ResponseToInvitation
commentsOn="decline"
expanded={expanded}
label="Do you agree to be the handling editor for this manuscript?"
formValues={formValues}
onResponse={(values, { setFetching }) => {
......@@ -26,9 +25,8 @@ A Reviewer response to an invitation.
```js
<RemoteOpener>
{({ toggle, expanded }) => (
{({ toggle }) => (
<ResponseToInvitation
expanded={expanded}
label="Do you agree to review this manuscript?"
onResponse={(values, { setFetching }) => {
console.log('on response: ', values)
......
......@@ -24,8 +24,8 @@ class ControlledAccordion extends React.Component {
const shouldScroll = !prevProps.expanded && this.props.expanded
if (this.props.scrollIntoView && shouldScroll) {
const appBarHeight = 70 // TODO -- take height from constants
const appBarMargin = 16 // TODO -- take margin from constants
const appBarHeight = 70
const appBarMargin = 16
this.scroller.scrollTop =
this._accordion.offsetTop - appBarHeight - appBarMargin
}
......
......@@ -14,8 +14,6 @@ const Wrapper = compose(
reduxForm({
form: 'styleguide',
}),
)(( props ) => (
<ManuscriptFiles {...props} />
))
)(props => <ManuscriptFiles {...props} />)
;<Wrapper />
```
\ No newline at end of file
```
```js
const { reduxForm, getFormValues, change } = require('redux-form')
const { compose } = require('recompose')
const { connect } = require('react-redux')
const allowedFileExtensions = ['pdf', 'doc', 'docx']
const onUpload = (f) => {console.log('Upload', f)}
const onUpload = file => console.log('Upload', file)
<ResponseToReviewer onUpload={onUpload} allowedFileExtensions={allowedFileExtensions}/>
const Wrapper = compose(
connect(state => ({
formValues: getFormValues('Response to reviewer')(state),
})),
reduxForm({
form: 'Response to reviewer',
}),
)(props => (
<ResponseToReviewer
onUpload={onUpload}
allowedFileExtensions={allowedFileExtensions}
/>
))
;<Wrapper />
```
......@@ -113,7 +113,7 @@ SubmitRevision.propTypes = {
/** An async call that returns the securized S3 file url. */
getSignedUrl: PropTypes.func,
/** Value containing the revision's file for the reviewer's response. */
responseFile: PropTypes.func,
responseFile: PropTypes.object, //eslint-disable-line
/** Downloads the file from the server. */
downloadFile: PropTypes.func,
/** Uploads the file then updates the form. */
......@@ -138,7 +138,7 @@ SubmitRevision.defaultProps = {
hasFormError: false,
deleteAuthor: () => {},
getSignedUrl: () => {},
responseFile: () => {},
responseFile: {},
downloadFile: () => {},
addResponseFile: () => {},
deleteResponseFile: () => {},
......
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