Skip to content
Snippets Groups Projects
Commit 792c0f57 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

feat(submit-revision): add confirmation modal

parent 9e998751
No related branches found
No related tags found
1 merge request!14Sprint #15
...@@ -15,6 +15,10 @@ import { ...@@ -15,6 +15,10 @@ import {
getFormValues, getFormValues,
change as changeForm, change as changeForm,
} from 'redux-form' } from 'redux-form'
import {
withModal,
ConfirmationModal,
} from 'pubsweet-component-modal/src/components'
import { AuthorList, Files } from 'pubsweet-components-faraday/src/components' import { AuthorList, Files } from 'pubsweet-components-faraday/src/components'
import { submitRevision } from 'pubsweet-component-wizard/src/redux/conversion' import { submitRevision } from 'pubsweet-component-wizard/src/redux/conversion'
import AutosaveIndicator from 'pubsweet-component-wizard/src/components/AutosaveIndicator' import AutosaveIndicator from 'pubsweet-component-wizard/src/components/AutosaveIndicator'
...@@ -141,6 +145,9 @@ export default compose( ...@@ -141,6 +145,9 @@ export default compose(
version, version,
}), }),
), ),
withModal(props => ({
modalComponent: ConfirmationModal,
})),
connect( connect(
state => ({ state => ({
fileFetching: getRequestStatus(state), fileFetching: getRequestStatus(state),
......
...@@ -160,11 +160,11 @@ export const onReviewSubmit = ( ...@@ -160,11 +160,11 @@ export const onReviewSubmit = (
values, values,
dispatch, dispatch,
{ {
isSubmitting,
showModal,
hideModal,
project, project,
version, version,
showModal,
hideModal,
isSubmitting,
updateRecommendation, updateRecommendation,
}, },
) => { ) => {
...@@ -203,9 +203,17 @@ export const onRevisionChange = debounce(_onRevisionChange, 1000, { ...@@ -203,9 +203,17 @@ export const onRevisionChange = debounce(_onRevisionChange, 1000, {
export const onRevisionSubmit = ( export const onRevisionSubmit = (
values, values,
dispatch, dispatch,
{ submitRevision, version, project }, { submitRevision, version, project, showModal, hideModal },
) => { ) => {
// submitRevision(project.id, version.id) // submitRevision(project.id, version.id)
showModal({
title: 'Ready to submit your revision?',
subtitle: `Once submitted, the submission can't be modified.`,
onConfirm: () => {
hideModal()
},
onCancel: hideModal,
})
} }
// revision validators // revision validators
......
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