Skip to content
Snippets Groups Projects
Commit 8e643d43 authored by Iosif Boanca's avatar Iosif Boanca
Browse files

fix(HE should see decision box):

parent 28b3149a
No related branches found
No related tags found
3 merge requests!160Update staging with master features,!150Develop,!139Hin 1054
...@@ -361,13 +361,32 @@ export const getInvitationsWithReviewersForFragment = (state, fragmentId) => ...@@ -361,13 +361,32 @@ export const getInvitationsWithReviewersForFragment = (state, fragmentId) =>
export const canMakeHERecommendation = (state, { collection, statuses }) => { export const canMakeHERecommendation = (state, { collection, statuses }) => {
const validHE = isHEToManuscript(state, get(collection, 'id', '')) const validHE = isHEToManuscript(state, get(collection, 'id', ''))
if (!validHE) return false
const statusImportance = get( const statusImportance = get(
statuses, statuses,
`${get(collection, 'status', 'draft')}.importance`, `${get(collection, 'status', 'draft')}.importance`,
1, 1,
) )
return statusImportance > 1 && statusImportance < 9 && validHE if (!(statusImportance > 1 && statusImportance < 9)) return false
if (collection.fragments.length !== 1) {
const previousFragmentId =
collection.fragments[collection.fragments.length - 2]
const previousRecommendationType = chain(state)
.get(`fragments.${previousFragmentId}.recommendations`, [])
.find(
recommendation =>
recommendation.recommendationType === 'editorRecommendation',
)
.get('recommendation', '')
.value()
if (previousRecommendationType === 'minor') {
return true
}
}
} }
export const getFragmentAuthorResponse = (state, fragmentId) => export const getFragmentAuthorResponse = (state, fragmentId) =>
......
...@@ -220,8 +220,7 @@ const ManuscriptLayout = ({ ...@@ -220,8 +220,7 @@ const ManuscriptLayout = ({
)} )}
{isLatestVersion && {isLatestVersion &&
get(currentUser, 'permissions.canMakeHERecommendation', false) && get(currentUser, 'permissions.canMakeHERecommendation', false) && (
reviewerRecommendations.length > 0 && (
<HERecommendation <HERecommendation
formValues={get(formValues, 'editorialRecommendation', {})} formValues={get(formValues, 'editorialRecommendation', {})}
hasReviewerReports={reviewerRecommendations.length > 0} hasReviewerReports={reviewerRecommendations.length > 0}
......
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