Skip to content
Snippets Groups Projects
StepTwo.js 4.02 KiB
Newer Older
import React, { Fragment } from 'react'
import { get } from 'lodash'
import { Field } from 'redux-form'
import { required } from 'xpub-validators'
import {
} from 'pubsweet-component-faraday-ui'
import { H2, Menu, TextField, ValidatedField } from '@pubsweet/ui'

import { Empty } from './'

const StepTwo = ({
  version,
  project,
  authorsError,
    <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.
      <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>
          component={input => (
            <Menu
              options={manuscriptTypes}
              {...input}
              placeholder="Please select"
            />
          )}
          name="metadata.type"
          validate={[required]}
        />
      <Item data-test-id="submission-abstract" vertical>
        <Label required>ABSTRACT</Label>
          name="metadata.abstract"
          validate={[required]}
        />
    <Field component={Empty} name="authors" />
    <WizardAuthors
      addAuthor={addAuthor}
      authors={get(version, 'authors', [])}
      changeForm={changeForm}
      error={authorsError}
      project={project}
      version={version}
    />

    <RadioWithComments
      commentsFieldName="conflicts.message"
      commentsLabel="Conflict of interest details"
      commentsOn="yes"
      formValues={formValues}
      radioFieldName="conflicts.hasConflicts"
      radioLabel="Do any authors have conflicts of interest to declare?"
      required
      tooltipContent={ConflictsTooltip}
    />
    <RadioWithComments
      commentsFieldName="conflicts.dataAvailabilityMessage"
      commentsLabel="Data availability statement"
      commentsOn="no"
      formValues={formValues}
      radioFieldName="conflicts.hasDataAvailability"
      radioLabel="Have you included a data availability statement in your manuscript?"
      required
      tooltipContent={DataAvailabilityTooltip}
    />
    <RadioWithComments
      commentsFieldName="conflicts.fundingMessage"
      commentsLabel="Funding statement"
      commentsOn="no"
      formValues={formValues}
      radioFieldName="conflicts.hasFunding"
      radioLabel="Have you provided a funding statement in your manuscript?"
      required
      tooltipContent={FundingTooltip}
    />
  </Fragment>
)

export default StepTwo

const ConflictsTooltip = () => (
    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.{' '}
    <ActionLink to="https://www.hindawi.com/editors/coi/">More info</ActionLink>
  </Text>
const DataAvailabilityTooltip = () => (
  <Text>
    Statement about where data supporting the results reported in a published
    article can be found, including, where applicable, hyperlinks to publicly
    archived datasets analysed or generated during the study.
  </Text>
)
const FundingTooltip = () => (
  <Text>
    Statement about how the research and publication of an article is funded,
    naming each financially supporting body followed by any associated grant
    numbers in square brackets.
  </Text>
)