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

fix(reviewer-reports): only staff and he can see the reviewer reports breakdown

parent 985fb11a
No related branches found
No related tags found
1 merge request!58Sprint #20 - Goal - Reviewers submit report
...@@ -25,6 +25,7 @@ const ManuscriptCard = ({ ...@@ -25,6 +25,7 @@ const ManuscriptCard = ({
onDelete, onDelete,
canDelete, canDelete,
onCardClick, onCardClick,
canSeeReviewersReports,
fragment = {}, fragment = {},
manuscriptType = {}, manuscriptType = {},
collection: { visibleStatus = 'Draft', handlingEditor, customId, id: collId }, collection: { visibleStatus = 'Draft', handlingEditor, customId, id: collId },
...@@ -76,7 +77,7 @@ const ManuscriptCard = ({ ...@@ -76,7 +77,7 @@ const ManuscriptCard = ({
<Text ml={1} mr={3} whiteSpace="nowrap"> <Text ml={1} mr={3} whiteSpace="nowrap">
{get(handlingEditor, 'name', 'Unassigned')} {get(handlingEditor, 'name', 'Unassigned')}
</Text> </Text>
{handlingEditor && ( {canSeeReviewersReports && (
<Fragment> <Fragment>
<Label mr={1}>Reviewers Reports</Label> <Label mr={1}>Reviewers Reports</Label>
<ReviewerBreakdown fragment={fragment} label="Reviewer Reports" /> <ReviewerBreakdown fragment={fragment} label="Reviewer Reports" />
......
import React from 'react' import React from 'react'
import { H3 } from '@pubsweet/ui' import { H3 } from '@pubsweet/ui'
import { get, has } from 'lodash' import { get, has } from 'lodash'
import { connect } from 'react-redux'
import styled from 'styled-components' import styled from 'styled-components'
import { th } from '@pubsweet/ui-toolkit' import { th } from '@pubsweet/ui-toolkit'
import { withRouter } from 'react-router-dom' import { withRouter } from 'react-router-dom'
import { ManuscriptCard, Row } from 'pubsweet-component-faraday-ui'
import { compose, setDisplayName, withHandlers } from 'recompose' import { compose, setDisplayName, withHandlers } from 'recompose'
import { ManuscriptCard, Row } from 'pubsweet-component-faraday-ui'
import { canSeeReviewersReports } from 'pubsweet-component-faraday-selectors'
import withVersion from './withVersion' import withVersion from './withVersion'
const DashboardItem = withVersion(ManuscriptCard) const DashboardItem = compose(
withVersion,
connect((state, { collection }) => ({
canSeeReviewersReports: canSeeReviewersReports(
state,
get(collection, 'id', ''),
),
})),
)(ManuscriptCard)
const DashboardItems = ({ onClick, list, deleteProject }) => ( const DashboardItems = ({
list,
onClick,
deleteProject,
canSeeReviewersReports,
}) => (
<Root> <Root>
{!list.length ? ( {!list.length ? (
<Row justify="center" mt={4}> <Row justify="center" mt={4}>
......
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