diff --git a/packages/component-faraday-selectors/src/index.js b/packages/component-faraday-selectors/src/index.js index 6508a91a4921237406bd5b9e386e167f1e608977..82d6b27cecc05dff19ac1f018acf05305e125fde 100644 --- a/packages/component-faraday-selectors/src/index.js +++ b/packages/component-faraday-selectors/src/index.js @@ -7,7 +7,11 @@ export const isHEToManuscript = (state, collectionId) => { return get(collection, 'handlingEditor.id') === currentUserId } -const canMakeRecommendationStatuses = ['reviewCompleted', 'heAssigned'] +const canMakeRecommendationStatuses = [ + 'reviewCompleted', + 'heAssigned', + 'underReview', +] export const canMakeRecommendation = (state, collection, fragment = {}) => { if (fragment.id !== last(collection.fragments)) return false const isHE = isHEToManuscript(state, collection.id) diff --git a/packages/component-manuscript/src/components/SideBarActions.js b/packages/component-manuscript/src/components/SideBarActions.js index dbfc3d7cd8c6bcbd6f7ce6a70176913185514c9a..4ab282febce17b1393ae399c75a1153df3fa64cb 100644 --- a/packages/component-manuscript/src/components/SideBarActions.js +++ b/packages/component-manuscript/src/components/SideBarActions.js @@ -40,6 +40,7 @@ const SideBarActions = ({ collectionId={project.id} fragmentId={version.id} modalKey={`decide-${version.id}`} + status={project.status} /> )} diff --git a/packages/components-faraday/src/components/Dashboard/DashboardCard.js b/packages/components-faraday/src/components/Dashboard/DashboardCard.js index 044a3a21e91903f72a444097b665d116eac4aff2..d0b8f03d47f45aa1f8a155754152933b970757a5 100644 --- a/packages/components-faraday/src/components/Dashboard/DashboardCard.js +++ b/packages/components-faraday/src/components/Dashboard/DashboardCard.js @@ -74,7 +74,6 @@ const DashboardCard = ({ collectionId={project.id} fragmentId={version.id} modalKey={`recommend-${version.id}`} - status={project.status} /> )} <ZipFiles diff --git a/packages/components-faraday/src/components/MakeRecommendation/RecommendWizard.js b/packages/components-faraday/src/components/MakeRecommendation/RecommendWizard.js index fb7452baf0ba87d8e6d3edb530511df05a9a4bfa..6ad740fde0799055cbc4a8684935b0e37e8b2511 100644 --- a/packages/components-faraday/src/components/MakeRecommendation/RecommendWizard.js +++ b/packages/components-faraday/src/components/MakeRecommendation/RecommendWizard.js @@ -9,7 +9,10 @@ import { getFormValues, reset as resetForm } from 'redux-form' import { FormItems } from '../UIComponents' import { StepOne, StepTwo, utils } from './' -import { createRecommendation } from '../../redux/recommendations' +import { + createRecommendation, + selectReviewRecommendations, +} from '../../redux/recommendations' const RecommendWizard = ({ step, @@ -40,8 +43,9 @@ const RecommendWizard = ({ export default compose( connect( - state => ({ + (state, { fragmentId }) => ({ decision: get(getFormValues('recommendation')(state), 'decision'), + reviews: selectReviewRecommendations(state, fragmentId), }), { resetForm, diff --git a/packages/components-faraday/src/components/MakeRecommendation/StepOne.js b/packages/components-faraday/src/components/MakeRecommendation/StepOne.js index b6723f9ff0a70dd03fb30668d2e8db606247cd66..1cb644c274d3bf7732c58e245090397fa33f2da6 100644 --- a/packages/components-faraday/src/components/MakeRecommendation/StepOne.js +++ b/packages/components-faraday/src/components/MakeRecommendation/StepOne.js @@ -1,5 +1,6 @@ import React from 'react' import { reduxForm } from 'redux-form' +import { isEmpty } from 'lodash' import { RadioGroup, ValidatedField, Button } from '@pubsweet/ui' import { utils } from './' @@ -7,7 +8,7 @@ import { FormItems } from '../UIComponents' const { Row, Title, RowItem, RootContainer, CustomRadioGroup } = FormItems -const StepOne = ({ hideModal, disabled, onSubmit, status }) => ( +const StepOne = ({ hideModal, disabled, onSubmit, reviews }) => ( <RootContainer> <Title>Recommendation for Next Phase</Title> <Row> @@ -21,7 +22,7 @@ const StepOne = ({ hideModal, disabled, onSubmit, status }) => ( <RadioGroup name="decision" options={ - status === 'reviewCompleted' + !isEmpty(reviews) ? utils.recommendationOptions : utils.recommendationOptions.slice(1) }