Newer
Older
import React, { Fragment } from 'react'
import { get } from 'lodash'
import { Field } from 'redux-form'
import { Tooltip } from 'react-tippy'
import styled from 'styled-components'
import { required } from 'xpub-validators'
import {
Row,
Text,
Item,
Label,
IconButton,
WizardAuthors,
} from 'pubsweet-component-faraday-ui'
import { H2, Menu, YesOrNo, TextField, ValidatedField } from '@pubsweet/ui'
import { Empty } from './'
const StepTwo = ({
version,
project,
addAuthor,
changeForm,
<CustomH2>2. Manuscript & Author Details</CustomH2>
<Row mb={2}>
<Text align="center" secondary>
Please provide the details of all the authors of this manuscript, in the
order that they appear on the manuscript. Your details have been
prefilled as the submitting author.
</Text>
</Row>
<Row mb={1}>
<Item data-test-id="submission-title" flex={3} mr={1} vertical>
<Label required>MANUSCRIPT TITLE</Label>
<ValidatedField
component={TextField}
name="metadata.title"
validate={[required]}
/>
<Item data-test-id="submission-type" vertical>
<Label required>MANUSCRIPT TYPE</Label>
<ValidatedField
component={input => <Menu options={manuscriptTypes} {...input} />}
name="metadata.type"
validate={[required]}
/>
<Row mb={1}>
<Item data-test-id="submission-abstract" vertical>
<Label required>ABSTRACT</Label>
component={TextField}
name="metadata.abstract"
validate={[required]}
/>
<Field component={Empty} name="authors" />
<WizardAuthors
addAuthor={addAuthor}
authors={get(version, 'authors', [])}
changeForm={changeForm}
project={project}
version={version}
/>
<Row alignItems="center" justify="flex-start">
<Item>
<Label required>Is there a potential conflict of interest?</Label>
<Tooltip
arrow
data-test="submission-tooltip"
html={<ConflictsTooltip />}
interactive
position="bottom"
trigger="click"
>
<IconButton icon="help-circle" primary />
</Tooltip>
<Row alignItems="center" justify="flex-start" mb={1}>
<Field
component={({ input }) => <YesOrNo {...input} />}
name="conflicts.hasConflicts"
/>
<Row alignItems="center" justify="flex-start">
<Item data-test="submission-conflicts-text" vertical>
<Label required>Conflict of interest details</Label>
component={TextField}
name="conflicts.message"
validate={[required]}
/>
</Row>
)}
</Fragment>
)
export default StepTwo
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
const ConflictsTooltip = () => (
<TooltipText>
When an author, editor, or reviewer has a financial/personal interest or
belief that could affest his/her objectivity, or inappropriately influence
his/her actions, a potential conflict of interest exists.
<MoreInfoLink
href="https://www.hindawi.com/editors/coi/"
rel="noopener noreferrer"
target="_blank"
>
More info
</MoreInfoLink>
</TooltipText>
)
// #region styled-components
const TooltipText = styled.span`
color: #d8d8d8;
font-family: 'Noto Serif';
font-size: 14px;
`
const MoreInfoLink = styled.a`
color: #d8d8d8;
margin-left: 3px;
`
const CustomH2 = styled(H2)`
margin: 0;
`