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

auhtor can see reports

parent 29798c86
No related branches found
No related tags found
1 merge request!96Hin 1006
...@@ -14,6 +14,7 @@ export const currentUserIs = ({ currentUser: { user } }, role) => { ...@@ -14,6 +14,7 @@ export const currentUserIs = ({ currentUser: { user } }, role) => {
const isAdmin = get(user, 'admin') const isAdmin = get(user, 'admin')
const isEic = get(user, 'editorInChief') const isEic = get(user, 'editorInChief')
const isHe = get(user, 'handlingEditor') const isHe = get(user, 'handlingEditor')
switch (role) { switch (role) {
case 'isHE': case 'isHE':
return isHe return isHe
...@@ -63,18 +64,19 @@ export const canViewReviewersDetails = (state, collection = {}) => { ...@@ -63,18 +64,19 @@ export const canViewReviewersDetails = (state, collection = {}) => {
const authorCannotViewReportsDetails = ['rejected', 'revisionRequested'] const authorCannotViewReportsDetails = ['rejected', 'revisionRequested']
export const authorCanViewReportsDetails = (state, collection = {}) => { export const authorCanViewReportsDetails = (
state,
collection = {},
fragmentId,
) => {
if ( if (
authorCannotViewReportsDetails.includes(get(collection, 'status', 'draft')) authorCannotViewReportsDetails.includes(get(collection, 'status', false)) &&
currentUserIsAuthor(state, fragmentId)
) { ) {
return authorCanViewReports(state, collection.id) return true
} }
return false
}
export const authorCanViewReports = (state, collectionId) => { return false
const isAuthor = currentUserIs(state, 'author')
return isAuthor
} }
const canHeViewEditorialCommentsStatuses = [ const canHeViewEditorialCommentsStatuses = [
......
...@@ -186,6 +186,7 @@ const ManuscriptLayout = ({ ...@@ -186,6 +186,7 @@ const ManuscriptLayout = ({
toggle={toggleReviewerDetails} toggle={toggleReviewerDetails}
/> />
)} )}
{/* aici e treaba*/}
{get(currentUser, 'permissions.authorCanViewReportsDetails', false) && ( {get(currentUser, 'permissions.authorCanViewReportsDetails', false) && (
<AuthorReviews <AuthorReviews
currentUser={currentUser} currentUser={currentUser}
......
...@@ -182,6 +182,7 @@ export default compose( ...@@ -182,6 +182,7 @@ export default compose(
authorCanViewReportsDetails: authorCanViewReportsDetails( authorCanViewReportsDetails: authorCanViewReportsDetails(
state, state,
collection, collection,
fragment.id,
), ),
canOverrideTechChecks: canOverrideTechnicalChecks(state, collection), canOverrideTechChecks: canOverrideTechnicalChecks(state, collection),
}, },
......
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