Skip to content
Snippets Groups Projects
Commit 7733b310 authored by Alf Eaton's avatar Alf Eaton
Browse files

Use all props in ConnectPage

parent 271a0498
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ const ConnectPage = requirements => WrappedComponent => {
complete: false
})
const requests = requirements(this.props.params).map(this.props.dispatch)
const requests = requirements(this.props).map(this.props.dispatch)
Promise.all(requests).then(() => {
this.setState({
......
......@@ -3,7 +3,7 @@ import { connect } from 'react-redux'
import { orderBy } from 'lodash'
import actions from 'pubsweet-client/src/actions'
import { selectCurrentUser } from 'xpub-selectors'
import { ConnectPage, withJournal} from 'pubsweet-component-xpub-app/src/components'
import { ConnectPage } from 'pubsweet-component-xpub-app/src/components'
import { uploadManuscript } from '../redux/manuscriptConversion'
import { addUserToTeam } from '../redux/teams'
import Dashboard from './Dashboard'
......@@ -11,11 +11,10 @@ import Dashboard from './Dashboard'
const newestFirst = items => orderBy(items, ['created'], ['desc'])
export default compose(
ConnectPage(params => [
ConnectPage(() => [
actions.getCollections(),
actions.getTeams(),
]),
withJournal,
connect(
state => ({
collections: state.collections,
......
......@@ -6,7 +6,7 @@ import { selectCurrentUser, selectCollection, selectFragment } from 'xpub-select
import Manuscript from './Manuscript'
export default compose(
ConnectPage(params => [
ConnectPage(({ params }) => [
actions.getCollection({ id: params.project }),
actions.getFragment({ id: params.project }, { id: params.version })
]),
......
......@@ -7,9 +7,9 @@ import { push } from 'react-router-redux'
import { reduxForm, SubmissionError } from 'redux-form'
import actions from 'pubsweet-client/src/actions'
import token from 'pubsweet-client/src/helpers/token'
import { withJournal, ConnectPage } from 'pubsweet-component-xpub-app/src/components'
import { ConnectPage } from 'pubsweet-component-xpub-app/src/components'
import { selectCollection, selectFragment } from 'xpub-selectors'
import Review from './Review'
import ReviewLayout from './ReviewLayout'
const onSubmit = (values, dispatch, props) => {
console.log('submit', values)
......@@ -57,12 +57,11 @@ const uploadFile = file => dispatch => {
}
export default compose(
ConnectPage(params => [
ConnectPage(({ params }) => [
actions.getCollection({ id: params.project }),
actions.getFragment({ id: params.project }, { id: params.version }),
actions.getFragment({ id: params.project }, { id: params.review }),
]),
withJournal,
connect(
(state, ownProps) => ({
project: selectCollection(state, ownProps.params.project),
......
......@@ -7,7 +7,7 @@ import { push } from 'react-router-redux'
import { reduxForm, SubmissionError } from 'redux-form'
import actions from 'pubsweet-client/src/actions'
import token from 'pubsweet-client/src/helpers/token'
import { withJournal, ConnectPage } from 'pubsweet-component-xpub-app/src/components'
import { ConnectPage } from 'pubsweet-component-xpub-app/src/components'
import { selectCollection, selectFragment } from 'xpub-selectors'
import Submit from './Submit'
......@@ -62,11 +62,10 @@ const uploadFile = file => dispatch => {
}
export default compose(
ConnectPage(params => [
ConnectPage(({ params }) => [
actions.getCollection({ id: params.project }),
actions.getFragment({ id: params.project }, { id: params.version })
]),
withJournal,
connect(
(state, ownProps) => ({
project: selectCollection(state, ownProps.params.project),
......
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