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,
<H2>2. Manuscript & Author Details</H2>
<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
const ConflictsTooltip = () => (
<TooltipText>
When an author, editor, or reviewer has a financial/personal interest or
belief that could affect 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: #586971;
font-family: "'Myriad Pro'";
font-size: 14px;
`
const MoreInfoLink = styled.a`
color: #586971;
margin-left: 4px;