Skip to content
Snippets Groups Projects
Commit 4250cd1b authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

Merge branch 'develop' of https://gitlab.coko.foundation/xpub/xpub-faraday into develop

parents 0966ed70 6c40d7da
No related branches found
No related tags found
1 merge request!34Sprint 17 features
const config = require('config') const config = require('config')
const { chain, get } = require('lodash') const { chain, get, isEmpty } = require('lodash')
const { const {
User, User,
...@@ -58,9 +58,13 @@ module.exports = { ...@@ -58,9 +58,13 @@ module.exports = {
comments = eicComments comments = eicComments
} }
const hasPeerReview = (collection = {}) =>
!isEmpty(collection.handlingEditor)
if ( if (
(isEditorInChief || newRecommendation.recommendationType === 'review') && (isEditorInChief || newRecommendation.recommendationType === 'review') &&
collection.status !== 'rejected' hasPeerReview(collection)
) { ) {
// the request came from either the Editor in Chief or a reviewer, so the HE needs to be notified // the request came from either the Editor in Chief or a reviewer, so the HE needs to be notified
sendHandlingEditorEmail({ sendHandlingEditorEmail({
...@@ -81,17 +85,19 @@ module.exports = { ...@@ -81,17 +85,19 @@ module.exports = {
newRecommendation.recommendationType !== 'review' && newRecommendation.recommendationType !== 'review' &&
newRecommendation.recommendation !== 'return-to-handling-editor' newRecommendation.recommendation !== 'return-to-handling-editor'
) { ) {
sendAuthorsEmail({ if (isEditorInChief || collection.status === 'revisionRequested') {
email, sendAuthorsEmail({
baseUrl, email,
titleText, baseUrl,
parsedFragment, titleText,
fragmentAuthors, parsedFragment,
isEditorInChief, fragmentAuthors,
subjectBaseText, isEditorInChief,
newRecommendation, subjectBaseText,
}) newRecommendation,
if (collection.status !== 'rejected') { })
}
if (hasPeerReview(collection)) {
sendReviewersEmail({ sendReviewersEmail({
email, email,
baseUrl, baseUrl,
......
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