Skip to content
Snippets Groups Projects
Commit 912e1d06 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

Add ConfirmationPage

parent ad3a4570
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ Configuration file must be under config `journal` (make use of `withJournal`) an
| backText | Text to show on Back button - Go back 1 step | false | 'Back' | `string` |
| nextText | Text to show on Back button - Go forward 1 step | false | 'Next' | `string` |
| cancelText | Text to show on Cancel button - Go to `/` | false | 'Back' | `string` |
| submissionRedirect | Path to redirect user after submitting the form | false | `/` | `string` |
| submissionRedirect | Path to redirect user after submitting the form. Passes as state `project` as project.id and `version` as version.id | false | `/` | `string` |
| confirmationModal | If present, component will be rendered as a modal before submitting the form. Accepts `toggleConfirming` to close the modal and must have 2 buttons for submit and close modal (see below) | false | none | `React Component` |
| formSectionKeys | Redux form data model. Keys to be saved on the form. | true | [] | `array` |
| dispatchFunctions | Functions to be dispatched in case a component needs a dispatched function (f.i. `uploadFile`) | true | none | `array` |
......
......@@ -65,7 +65,7 @@ const submitManuscript = (
),
)
.then(() => {
history.push(redirectPath)
history.push(redirectPath, { project: project.id, version: version.id })
})
.catch(error => {
if (error.validationErrors) {
......
import React from 'react'
import { compose } from 'recompose'
import { connect } from 'react-redux'
import { get, isEmpty } from 'lodash'
import { withJournal } from 'xpub-journal'
import { getFragmentAuthors } from 'pubsweet-components-faraday/src/redux/authors'
const ConfirmationPage = ({ journal, authors = [], location: { state } }) => {
const email = get(authors.find(a => a.isCorresponding), 'email')
return (
<div style={{ width: '70vw', margin: '0 auto' }}>
{isEmpty(state) ? (
<h2>Thank you for you submission</h2>
) : (
<div>
<h2>Thank You for Submitting Your Manuscript</h2>
<p>
Your manuscript has been successfully submitted to{' '}
{journal.metadata.name}.
</p>
<p>
An acknowledgement email will be sent to{' '}
<a href={`mailto:${email}`}>{email}</a> when our system has finished
processing the submission. At that point, you will be able to track
the status of your submission. Please note, this may take a few
minutes.
</p>
<p>
Click{' '}
<a
href={`/projects/${state.project}/versions/${
state.version
}/manuscript`}
>
{' '}
here{' '}
</a>{' '}
to return to your account in the Manuscript Tracking System.
</p>
</div>
)}
</div>
)
}
export default compose(
withJournal,
connect((state, { location: { state: locationState } }) => ({
authors: getFragmentAuthors(state, get(locationState, 'version')),
})),
)(ConfirmationPage)
......@@ -12,8 +12,8 @@ import {
import DashboardPage from 'pubsweet-component-xpub-dashboard/src/components/DashboardPage'
import WizardPage from 'pubsweet-component-wizard/src/components/WizardPage'
const ConfirmationPage = () => <h1>Confirmation page</h1>
import ManuscriptPage from 'pubsweet-component-xpub-manuscript/src/components/ManuscriptPage'
import ConfirmationPage from 'pubsweet-components-faraday/src/components/UIComponents/ConfirmationPage'
const Routes = () => (
<App>
......@@ -31,6 +31,11 @@ const Routes = () => (
exact
path="/projects/:project/versions/:version/submit"
/>
<PrivateRoute
component={ManuscriptPage}
exact
path="/projects/:project/versions/:version/manuscript"
/>
</App>
)
......
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