From 64a442b8f34bb8276fae8ae6a16daffa298c0167 Mon Sep 17 00:00:00 2001
From: Alexandru Munteanu <alexandru.munteanu@thinslices.com>
Date: Mon, 15 Jan 2018 15:11:24 +0200
Subject: [PATCH] improve wizard setup

---
 .../src/components/ButtonGroup.js             |  46 ---
 .../src/components/ButtonGroup.local.scss     |  55 ----
 .../component-wizard/src/components/Wizard.js | 103 ++++---
 .../src/components/Wizard.local.scss          |  14 +
 .../component-wizard/src/components/index.js  |   1 -
 .../_build/config/client-config.json          |   2 +-
 .../CURRENT                                   |   2 +-
 .../LOG                                       |  10 +-
 .../LOG.old                                   |  10 +-
 .../xpub-faraday/api/db/development/CURRENT   |   2 +-
 packages/xpub-faraday/api/db/development/LOG  |  10 +-
 .../xpub-faraday/api/db/development/LOG.old   |  19 +-
 .../app/config/journal/submit-wizard.js       | 271 ++++++++----------
 packages/xpub-faraday/config/default.js       |   2 +-
 14 files changed, 228 insertions(+), 319 deletions(-)
 delete mode 100644 packages/component-wizard/src/components/ButtonGroup.js
 delete mode 100644 packages/component-wizard/src/components/ButtonGroup.local.scss

diff --git a/packages/component-wizard/src/components/ButtonGroup.js b/packages/component-wizard/src/components/ButtonGroup.js
deleted file mode 100644
index e9f306007..000000000
--- a/packages/component-wizard/src/components/ButtonGroup.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import React from 'react'
-import { compose, withHandlers } from 'recompose'
-import { Button } from '@pubsweet/ui'
-
-import classes from './ButtonGroup.local.scss'
-
-const BUTTON_ACTIONS = {
-  back: 'back',
-  cancel: 'cancel',
-  next: 'next',
-  finish: 'finish',
-}
-
-const ButtonGroup = ({ buttons, handleOnClick, disabled }) =>
-  buttons && buttons.length > 0 ? (
-    <div className={classes.container}>
-      {buttons.map(btn => (
-        <Button
-          key={btn.label}
-          onClick={handleOnClick(btn.action)}
-          primary={btn.action !== 'back' && btn.action !== 'cancel'}
-        >
-          {btn.label}
-        </Button>
-      ))}
-    </div>
-  ) : null
-
-export default compose(
-  withHandlers({
-    handleOnClick: ({ onNext, onBack, onCancel, onFinish }) => btnAction => {
-      switch (btnAction) {
-        case BUTTON_ACTIONS.back:
-          return onBack
-        case BUTTON_ACTIONS.next:
-          return onNext
-        case BUTTON_ACTIONS.cancel:
-          return onCancel
-        case BUTTON_ACTIONS.finish:
-          return onFinish
-        default:
-          return null
-      }
-    },
-  }),
-)(ButtonGroup)
diff --git a/packages/component-wizard/src/components/ButtonGroup.local.scss b/packages/component-wizard/src/components/ButtonGroup.local.scss
deleted file mode 100644
index c84b6f2ee..000000000
--- a/packages/component-wizard/src/components/ButtonGroup.local.scss
+++ /dev/null
@@ -1,55 +0,0 @@
-.container {
-  align-self: center;
-  display: flex;
-  justify-content: space-around;
-  margin: 20px 0;
-  width: 400px;
-}
-
-.button {
-  align-items: center;
-  border: 2px solid #444;
-  color: #444;
-  cursor: pointer;
-  display: flex;
-  font-size: 14px;
-  font-weight: 400;
-  height: 32px;
-  justify-content: center;
-  min-width: 120px;
-  text-transform: uppercase;
-
-  &:hover {
-    border-color: #666;
-    color: #666;
-  }
-
-  &:active,
-  &:focus {
-    outline: none;
-  }
-
-  &.next {
-    background-color: #444;
-    color: #eee;
-
-    &:hover {
-      background-color: #666;
-    }
-  }
-
-  &.finish {
-    background-color: #888;
-    color: firebrick;
-  }
-
-  &.disabled {
-    border-color: #999;
-    color: #999;
-
-    &:hover {
-      border-color: #999;
-      color: #999;
-    }
-  }
-}
diff --git a/packages/component-wizard/src/components/Wizard.js b/packages/component-wizard/src/components/Wizard.js
index 2348e5396..a5655d471 100644
--- a/packages/component-wizard/src/components/Wizard.js
+++ b/packages/component-wizard/src/components/Wizard.js
@@ -1,13 +1,19 @@
 import React from 'react'
+import PropTypes from 'prop-types'
 import classnames from 'classnames'
+import { reduxForm } from 'redux-form'
 import { withJournal } from 'xpub-journal'
-import { reduxForm, Field } from 'redux-form'
-import { compose, withHandlers, withState } from 'recompose'
-import { ValidatedField } from '@pubsweet/ui'
-import { required } from 'xpub-validators'
+import { ValidatedField, Button } from '@pubsweet/ui'
+import {
+  compose,
+  withHandlers,
+  withState,
+  getContext,
+  withContext,
+} from 'recompose'
 
 import classes from './Wizard.local.scss'
-import { Steps, SortableList, ButtonGroup } from './'
+import { Steps, SortableList } from './'
 
 const { Step } = Steps
 
@@ -24,15 +30,6 @@ const validate = values => {
   return errors
 }
 
-const renderField = ({ renderComponent: Comp, input, ...rest }) => (
-  <ValidatedField
-    component={() => <Comp {...input} {...rest} />}
-    name={rest.fieldId}
-    required
-    validate={[required]}
-  />
-)
-
 const WizardStep = ({
   children: stepChildren,
   title,
@@ -40,23 +37,34 @@ const WizardStep = ({
   nextStep,
   prevStep,
   handleSubmit,
+  isFinal,
+  isFirst,
+  goBack,
   ...rest
 }) => (
   <div className={classnames(classes.step)}>
-    <form onSubmit={handleSubmit}>
+    <form className={classnames(classes.form)} onSubmit={handleSubmit}>
       <h3>{title}</h3>
       {stepChildren &&
-        stepChildren.map((child, index) => (
-          <Field
-            component={renderField}
-            key={child.fieldId}
-            name={child.fieldId}
-            {...child}
-          />
-        ))}
-      <button type="submit">Next</button>
+        stepChildren.map(
+          ({ fieldId, validate, renderComponent: Comp, ...rest }, index) => (
+            <ValidatedField
+              component={input => <Comp {...rest} {...input} />}
+              key={fieldId}
+              name={fieldId}
+              validate={validate}
+            />
+          ),
+        )}
+      <div className={classnames(classes.buttons)}>
+        <Button onClick={isFirst ? goBack : prevStep}>
+          {isFirst ? 'Cancel' : 'Back'}
+        </Button>
+        <Button primary type="submit">
+          {isFinal ? 'Finish' : 'Next'}
+        </Button>
+      </div>
     </form>
-    <ButtonGroup buttons={buttons} onBack={prevStep} onNext={nextStep} />
   </div>
 )
 
@@ -72,10 +80,15 @@ const FormStep = compose(
       }
     },
   }),
+  getContext({
+    goBack: PropTypes.func,
+    isFinal: PropTypes.bool,
+    isFirst: PropTypes.bool,
+  }),
 )(WizardStep)
 
 const Wizard = ({
-  journal: { wizard },
+  journal: { wizard: { showProgress, steps } },
   getSteps,
   step,
   nextStep,
@@ -83,17 +96,14 @@ const Wizard = ({
   ...rest
 }) => (
   <div className={classnames(classes.container)}>
-    <Steps currentStep={step}>
-      {getSteps().map((step, index) => (
-        <Step index={index} key={step} title={step} />
-      ))}
-    </Steps>
-    <FormStep
-      {...wizard[step]}
-      isFinal={step === wizard.length - 1}
-      nextStep={nextStep}
-      prevStep={prevStep}
-    />
+    {showProgress && (
+      <Steps currentStep={step}>
+        {getSteps().map((step, index) => (
+          <Step index={index} key={step} title={step} />
+        ))}
+      </Steps>
+    )}
+    <FormStep {...steps[step]} nextStep={nextStep} prevStep={prevStep} />
   </div>
 )
 
@@ -107,11 +117,24 @@ export default compose(
     },
   }),
   withHandlers({
-    getSteps: ({ journal: { wizard } }) => () => wizard.map(w => w.label),
-    nextStep: ({ changeStep, journal: { wizard } }) => () => {
-      changeStep(step => (step === wizard.length - 1 ? step : step + 1))
+    getSteps: ({ journal: { wizard: { steps } } }) => () =>
+      steps.map(w => w.label),
+    nextStep: ({ changeStep, journal: { wizard: { steps } } }) => () => {
+      changeStep(step => (step === steps.length - 1 ? step : step + 1))
     },
     prevStep: ({ changeStep }) => () =>
       changeStep(step => (step <= 0 ? step : step - 1)),
   }),
+  withContext(
+    {
+      goBack: PropTypes.func,
+      isFinal: PropTypes.bool,
+      isFirst: PropTypes.bool,
+    },
+    ({ history: { goBack }, step, journal: { wizard: { steps } } }) => ({
+      goBack,
+      isFinal: step === steps.length - 1,
+      isFirst: step === 0,
+    }),
+  ),
 )(Wizard)
diff --git a/packages/component-wizard/src/components/Wizard.local.scss b/packages/component-wizard/src/components/Wizard.local.scss
index 0b8cbc74c..f108dfb46 100644
--- a/packages/component-wizard/src/components/Wizard.local.scss
+++ b/packages/component-wizard/src/components/Wizard.local.scss
@@ -15,3 +15,17 @@
   padding: 0 20px;
   width: 700px;
 }
+
+.form {
+  display: flex;
+  flex-direction: column;
+}
+
+.buttons {
+  align-items: center;
+  align-self: center;
+  display: flex;
+  justify-content: space-around;
+  margin: 15px 0;
+  width: 400px;
+}
diff --git a/packages/component-wizard/src/components/index.js b/packages/component-wizard/src/components/index.js
index b7c6a170e..e51f2b7f2 100644
--- a/packages/component-wizard/src/components/index.js
+++ b/packages/component-wizard/src/components/index.js
@@ -1,5 +1,4 @@
 export { default as Steps } from './Steps'
 export { default as Wizard } from './Wizard'
 export { default as Dropdown } from './Dropdown'
-export { default as ButtonGroup } from './ButtonGroup'
 export { default as SortableList } from './SortableList'
diff --git a/packages/xpub-faraday/_build/config/client-config.json b/packages/xpub-faraday/_build/config/client-config.json
index f745f9ab7..5ff1882d2 100644
--- a/packages/xpub-faraday/_build/config/client-config.json
+++ b/packages/xpub-faraday/_build/config/client-config.json
@@ -2,7 +2,7 @@
   "pubsweet-client": {
     "API_ENDPOINT": "/api",
     "login-redirect": "/",
-    "redux-log": true
+    "redux-log": false
   },
   "authsome": {
     "mode": "/Users/alexandrumunt/Projects/Hindawi/xpub/packages/xpub-faraday/config/authsome.js",
diff --git a/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/CURRENT b/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/CURRENT
index 875cf2335..3051f81a6 100644
--- a/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/CURRENT
+++ b/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/CURRENT
@@ -1 +1 @@
-MANIFEST-000007
+MANIFEST-000010
diff --git a/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/LOG b/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/LOG
index 241afc923..3633bdd40 100644
--- a/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/LOG
+++ b/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/LOG
@@ -1,5 +1,5 @@
-2018/01/12-10:37:25.695488 700004273000 Recovering log #6
-2018/01/12-10:37:25.697023 700004273000 Level-0 table #8: started
-2018/01/12-10:37:25.697468 700004273000 Level-0 table #8: 692 bytes OK
-2018/01/12-10:37:25.698638 700004273000 Delete type=0 #6
-2018/01/12-10:37:25.699530 700004273000 Delete type=3 #4
+2018/01/15-11:16:04.172115 700008d13000 Recovering log #9
+2018/01/15-11:16:04.172334 700008d13000 Level-0 table #11: started
+2018/01/15-11:16:04.172677 700008d13000 Level-0 table #11: 237 bytes OK
+2018/01/15-11:16:04.173405 700008d13000 Delete type=3 #7
+2018/01/15-11:16:04.173527 700008d13000 Delete type=0 #9
diff --git a/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/LOG.old b/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/LOG.old
index 08df6d5d0..241afc923 100644
--- a/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/LOG.old
+++ b/packages/xpub-faraday/api/db/development-mrview-fe0ff9878713e4fffce6b37f75b19960/LOG.old
@@ -1,5 +1,5 @@
-2018/01/09-16:57:47.142452 70000509e000 Recovering log #3
-2018/01/09-16:57:47.142855 70000509e000 Level-0 table #5: started
-2018/01/09-16:57:47.143583 70000509e000 Level-0 table #5: 339 bytes OK
-2018/01/09-16:57:47.144913 70000509e000 Delete type=0 #3
-2018/01/09-16:57:47.145131 70000509e000 Delete type=3 #2
+2018/01/12-10:37:25.695488 700004273000 Recovering log #6
+2018/01/12-10:37:25.697023 700004273000 Level-0 table #8: started
+2018/01/12-10:37:25.697468 700004273000 Level-0 table #8: 692 bytes OK
+2018/01/12-10:37:25.698638 700004273000 Delete type=0 #6
+2018/01/12-10:37:25.699530 700004273000 Delete type=3 #4
diff --git a/packages/xpub-faraday/api/db/development/CURRENT b/packages/xpub-faraday/api/db/development/CURRENT
index f405c4b59..b0fe36ef8 100644
--- a/packages/xpub-faraday/api/db/development/CURRENT
+++ b/packages/xpub-faraday/api/db/development/CURRENT
@@ -1 +1 @@
-MANIFEST-000162
+MANIFEST-000169
diff --git a/packages/xpub-faraday/api/db/development/LOG b/packages/xpub-faraday/api/db/development/LOG
index 3bd35ff65..d05f2fd71 100644
--- a/packages/xpub-faraday/api/db/development/LOG
+++ b/packages/xpub-faraday/api/db/development/LOG
@@ -1,5 +1,5 @@
-2018/01/12-14:35:19.911319 70001307d000 Recovering log #161
-2018/01/12-14:35:19.912463 70001307d000 Level-0 table #163: started
-2018/01/12-14:35:19.912996 70001307d000 Level-0 table #163: 237 bytes OK
-2018/01/12-14:35:19.913780 70001307d000 Delete type=3 #159
-2018/01/12-14:35:19.913972 70001307d000 Delete type=0 #161
+2018/01/15-11:43:30.224354 70000fc12000 Recovering log #167
+2018/01/15-11:43:30.225277 70000fc12000 Level-0 table #170: started
+2018/01/15-11:43:30.225698 70000fc12000 Level-0 table #170: 237 bytes OK
+2018/01/15-11:43:30.226457 70000fc12000 Delete type=0 #167
+2018/01/15-11:43:30.226694 70000fc12000 Delete type=3 #165
diff --git a/packages/xpub-faraday/api/db/development/LOG.old b/packages/xpub-faraday/api/db/development/LOG.old
index dfc75080e..22d3e7005 100644
--- a/packages/xpub-faraday/api/db/development/LOG.old
+++ b/packages/xpub-faraday/api/db/development/LOG.old
@@ -1,5 +1,14 @@
-2018/01/12-14:32:13.255236 70000e0f3000 Recovering log #158
-2018/01/12-14:32:13.256323 70000e0f3000 Level-0 table #160: started
-2018/01/12-14:32:13.256930 70000e0f3000 Level-0 table #160: 237 bytes OK
-2018/01/12-14:32:13.258255 70000e0f3000 Delete type=0 #158
-2018/01/12-14:32:13.258600 70000e0f3000 Delete type=3 #156
+2018/01/15-11:15:26.115293 700008d13000 Recovering log #164
+2018/01/15-11:15:26.116155 700008d13000 Level-0 table #166: started
+2018/01/15-11:15:26.116639 700008d13000 Level-0 table #166: 237 bytes OK
+2018/01/15-11:15:26.117729 700008d13000 Delete type=0 #164
+2018/01/15-11:15:26.117926 700008d13000 Delete type=3 #162
+2018/01/15-11:15:26.118145 700009599000 Compacting 4@0 + 1@1 files
+2018/01/15-11:15:26.119425 700009599000 Generated table #168@0: 11 keys, 1463 bytes
+2018/01/15-11:15:26.119451 700009599000 Compacted 4@0 + 1@1 files => 1463 bytes
+2018/01/15-11:15:26.119586 700009599000 compacted to: files[ 0 1 0 0 0 0 0 ]
+2018/01/15-11:15:26.119707 700009599000 Delete type=2 #160
+2018/01/15-11:15:26.119877 700009599000 Delete type=2 #163
+2018/01/15-11:15:26.120014 700009599000 Delete type=2 #166
+2018/01/15-11:15:26.120143 700009599000 Delete type=2 #155
+2018/01/15-11:15:26.120392 700009599000 Delete type=2 #157
diff --git a/packages/xpub-faraday/app/config/journal/submit-wizard.js b/packages/xpub-faraday/app/config/journal/submit-wizard.js
index 03e86b7ec..ec2b0ff86 100644
--- a/packages/xpub-faraday/app/config/journal/submit-wizard.js
+++ b/packages/xpub-faraday/app/config/journal/submit-wizard.js
@@ -8,9 +8,11 @@ import {
   Supplementary,
 } from '@pubsweet/ui'
 import uploadFile from 'xpub-upload'
+import { required, minChars } from 'xpub-validators'
 
 import { articleSections, articleTypes, declarations } from './'
 
+const min3Chars = minChars(3)
 const yesNoWithLabel = ({ label, ...rest }) => (
   <div>
     <label>{label}</label>
@@ -18,156 +20,119 @@ const yesNoWithLabel = ({ label, ...rest }) => (
   </div>
 )
 
-const wizard = [
-  {
-    label: 'Journal details',
-    title: 'Jounal & Field Selection',
-    children: [
-      {
-        fieldId: 'journal',
-        renderComponent: Menu,
-        label: 'Journal',
-        options: articleTypes,
-        required: true,
-      },
-      {
-        fieldId: 'subject',
-        renderComponent: Menu,
-        label: 'Subject area',
-        options: articleSections,
-      },
-      {
-        fieldId: 'specialIssue',
-        renderComponent: Menu,
-        label: 'Special issue',
-        options: [
-          { label: 'Special 2.1', value: 'dd21' },
-          { label: 'Special 2.2', value: 'dd22' },
-        ],
-      },
-    ],
-    buttons: [
-      {
-        label: 'Cancel',
-        action: 'cancel',
-      },
-      {
-        label: 'Next step',
-        action: 'next',
-      },
-    ],
-  },
-  {
-    label: 'Pre-submission checklist',
-    title: 'Pre-submission Checklist',
-    subtitle:
-      'Before moving forward make sure you have all the needed details prepared by reviewing and checking off the items on this list.',
-    children: [
-      {
-        fieldId: 'declarations',
-        renderComponent: CheckboxGroup,
-        options: declarations.options,
-      },
-    ],
-    buttons: [
-      {
-        label: 'Back',
-        action: 'back',
-      },
-      {
-        label: 'Next step',
-        action: 'next',
-      },
-    ],
-  },
-  {
-    label: 'Manuscript & Authors Details',
-    title: 'Manuscript & Authors Details',
-    subtitle:
-      'Please provide the details of all the authors of this manuscript....',
-    children: [
-      {
-        fieldId: 'step3-1',
-        renderComponent: TitleEditor,
-        placeholder: 'Manuscript title',
-        title: 'Manuscript title',
-      },
-      {
-        fieldId: 'step3-2',
-        renderComponent: Menu,
-        label: 'Manuscript type',
-        options: [
-          { label: 'Type 1', value: 'type1' },
-          { label: 'Type 2', value: 'type2' },
-        ],
-      },
-      {
-        fieldId: 'step3-3',
-        renderComponent: AbstractEditor,
-        title: 'Abstract',
-        placeholder: 'Write an abstract',
-      },
-      // {
-      //   fieldId: 'authors',
-      //   renderComponent: 'sortable-list',
-      //   label: 'Authors details',
-      // },
-      {
-        fieldId: 'step3-4',
-        renderComponent: yesNoWithLabel,
-        label: 'Is there a potential conflict of interest?',
-      },
-      {
-        fieldId: 'step3-5',
-        renderComponent: TextField,
-        label: 'Conflict of interest details',
-      },
-    ],
-    buttons: [
-      {
-        label: 'Back',
-        action: 'back',
-      },
-      {
-        label: 'Next step',
-        action: 'next',
-      },
-    ],
-  },
-  {
-    label: 'Files upload',
-    title: 'Manuscript Files Upload',
-    children: [
-      {
-        fieldId: 'mainManuscripts',
-        label: 'Main Manuscript',
-        renderComponent: Supplementary,
-        uploadFile,
-      },
-      {
-        fieldId: 'supplementalFiles',
-        label: 'Supplemental Files',
-        renderComponent: Supplementary,
-        uploadFile,
-      },
-      {
-        fieldId: 'coverLetter',
-        label: 'Cover Letter',
-        renderComponent: Supplementary,
-        uploadFile,
-      },
-    ],
-    buttons: [
-      {
-        label: 'Back',
-        action: 'back',
-      },
-      {
-        label: 'Finish',
-        action: 'finish',
-      },
-    ],
-  },
-]
-
-export default wizard
+export default {
+  showProgress: false,
+  steps: [
+    {
+      label: 'Journal details',
+      title: 'Jounal & Field Selection',
+      children: [
+        {
+          fieldId: 'journal',
+          renderComponent: Menu,
+          label: 'Journal',
+          options: articleTypes,
+          validate: [required],
+        },
+        {
+          fieldId: 'subject',
+          renderComponent: Menu,
+          label: 'Subject area',
+          options: articleSections,
+        },
+        {
+          fieldId: 'specialIssue',
+          renderComponent: Menu,
+          label: 'Special issue',
+          options: [
+            { label: 'Special 2.1', value: 'dd21' },
+            { label: 'Special 2.2', value: 'dd22' },
+          ],
+          validate: [required],
+        },
+      ],
+    },
+    {
+      label: 'Pre-submission checklist',
+      title: 'Pre-submission Checklist',
+      subtitle:
+        'Before moving forward make sure you have all the needed details prepared by reviewing and checking off the items on this list.',
+      children: [
+        {
+          fieldId: 'declarations',
+          renderComponent: CheckboxGroup,
+          options: declarations.options,
+        },
+      ],
+    },
+    {
+      label: 'Manuscript & Authors Details',
+      title: 'Manuscript & Authors Details',
+      subtitle:
+        'Please provide the details of all the authors of this manuscript....',
+      children: [
+        {
+          fieldId: 'step3-1',
+          renderComponent: TitleEditor,
+          placeholder: 'Manuscript title',
+          title: 'Manuscript title',
+        },
+        {
+          fieldId: 'step3-2',
+          renderComponent: Menu,
+          label: 'Manuscript type',
+          options: [
+            { label: 'Type 1', value: 'type1' },
+            { label: 'Type 2', value: 'type2' },
+          ],
+        },
+        {
+          fieldId: 'step3-3',
+          renderComponent: AbstractEditor,
+          title: 'Abstract',
+          placeholder: 'Write an abstract',
+        },
+        // {
+        //   fieldId: 'authors',
+        //   renderComponent: 'sortable-list',
+        //   label: 'Authors details',
+        // },
+        {
+          fieldId: 'step3-4',
+          renderComponent: yesNoWithLabel,
+          label: 'Is there a potential conflict of interest?',
+        },
+        {
+          fieldId: 'step3-5',
+          renderComponent: TextField,
+          label: 'Conflict of interest details',
+          validate: [required, min3Chars],
+        },
+      ],
+    },
+    {
+      label: 'Files upload',
+      title: 'Manuscript Files Upload',
+      children: [
+        {
+          fieldId: 'mainManuscripts',
+          label: 'Main Manuscript',
+          renderComponent: Supplementary,
+          uploadFile,
+        },
+        {
+          fieldId: 'supplementalFiles',
+          label: 'Supplemental Files',
+          renderComponent: Supplementary,
+          uploadFile,
+        },
+        {
+          fieldId: 'coverLetter',
+          label: 'Cover Letter',
+          renderComponent: Supplementary,
+          uploadFile,
+        },
+      ],
+    },
+  ],
+}
diff --git a/packages/xpub-faraday/config/default.js b/packages/xpub-faraday/config/default.js
index ac142cf19..36f785c36 100644
--- a/packages/xpub-faraday/config/default.js
+++ b/packages/xpub-faraday/config/default.js
@@ -24,7 +24,7 @@ module.exports = {
   'pubsweet-client': {
     API_ENDPOINT: '/api',
     'login-redirect': '/',
-    'redux-log': true,
+    'redux-log': false,
     theme: process.env.PUBSWEET_THEME,
   },
   'mail-transport': {
-- 
GitLab