-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkp/pkp-lib#2433 editor recommendation #2749
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* Show the editor recommendation form | ||
* @param $args array | ||
* @param $request PKPRequest | ||
* @return string Serialized JSON object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the @return
is actually a JSONMessage
object. It doesn't get converted to a string until later.
* Show the editor recommendation form | ||
* @param $args array | ||
* @param $request PKPRequest | ||
* @return string Serialized JSON object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same @return
question as above.
foreach ($editorsStageAssignments as $editorsStageAssignment) { | ||
if (!$editorsStageAssignment->getRecommendOnly()) { | ||
$editorFullName = $userDao->getUserFullName($editorsStageAssignment->getUserId()); | ||
$editorsStr .= ($i == 0) ? $editorFullName : ', ' . $editorFullName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to say that the separator ,
should be translatable like the authors string, but it looks like the authors string separator isn't translatable either. So I guess it's alright as-is. We don't seem to get complaints. :)
$editDecisionDao = DAORegistry::getDAO('EditDecisionDAO'); | ||
$editorRecommendations = $editDecisionDao->getEditorDecisions($submission->getId(), $this->getStageId(), null, $user->getId()); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra empty line.
if (!$editorsStageAssignment->getRecommendOnly()) { | ||
$editor = $userDao->getById($editorsStageAssignment->getUserId()); | ||
$editorFullName = $editor->getFullName(); | ||
$editorsStr .= ($i == 0) ? $editorFullName : ', ' . $editorFullName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to extract the $editorsStr
compilation into a method on the form, so it's easier to keep the presentation consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I was wrong here -- here I do not need the editorStr -- so I will leave the loops as they are... ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
locale/en_US/manager.xml
Outdated
@@ -429,6 +429,7 @@ | |||
<message key="settings.roles.roleOptions">Role Options</message> | |||
<message key="settings.roles.showTitles">Show role title in contributor list</message> | |||
<message key="settings.roles.permitSelfRegistration">Allow user self-registration</message> | |||
<message key="settings.roles.recommendOnly">This role can not make a review decission, only a recommendation.</message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This role is only allowed to recommend a review decision and will require an authorised editor to record a final decision.
locale/en_US/submission.xml
Outdated
@@ -520,6 +520,9 @@ | |||
<message key="editor.submission.roundStatus.reviewsReady">New reviews have been submitted.</message> | |||
<message key="editor.submission.roundStatus.reviewsCompleted">All reviews are in and a decision is needed.</message> | |||
<message key="editor.submission.roundStatus.reviewOverdue">A review is overdue.</message> | |||
<message key="editor.submission.roundStatus.pendingRecommendations">Awaiting recommendations from editors.</message> | |||
<message key="editor.submission.roundStatus.recommendationsReady">New recommendations have been submitted.</message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New editorial recommendations have been submitted.
locale/en_US/submission.xml
Outdated
@@ -547,6 +550,11 @@ | |||
<message key="editor.submission.decision.approveProofs">Approve Proofs</message> | |||
<message key="editor.submission.decision.disapproveProofsDescription">This file proof will no longer be publicly available for download or purchase. Do you want to disapprove it?</message> | |||
<message key="editor.submission.decision.noDecisionsAvailable">Assign an editor to enable the editorial decisions for this stage.</message> | |||
<!-- editor recommendations --> | |||
<message key="editor.submission.recommend">Recommend</message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make Recommendation
locale/en_US/submission.xml
Outdated
<!-- editor recommendations --> | ||
<message key="editor.submission.recommend">Recommend</message> | ||
<message key="editor.submission.recommendation">Recommendation</message> | ||
<message key="editor.submission.recommendation.description">Make a recommendation for the editors</message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend an editorial decision be made for this submission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you maybe mean: Recommend an editorial decision for this submission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's better. :)
{if !empty($editorRecommendations)} | ||
{fbvFormSection label="editor.submission.recordedRecommendations"} | ||
{foreach from=$editorRecommendations item=editorRecommendation} | ||
<div class="pkp_controllers_informationCenter_itemLastEvent"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove the class name since it isn't used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one comment on code review. I'll walk through it as a user now.
if (!this.activeStage.currentUserCanRecommendOnly) { | ||
switch (this.activeStage.statusId) { | ||
case pkp.const.REVIEW_ROUND_STATUS_RECOMMENDATIONS_READY | ||
case pkp.const.REVIEW_ROUND_STATUS_RECOMMENDATIONS_COMPLETED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the :
at the end of the case
statements. This is breaking your builds at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, good catch! :-)
ca48fc8
to
a5b4f8d
Compare
@NateWr, could you please take a look at the new commit "reload editor decision div" above -- it also generally provides the |
@@ -40,6 +41,7 @@ | |||
.each(function() { | |||
$.pkp.classes.Handler.getHandler($(this)).reload(); | |||
}); | |||
pkp.eventBus.$emit('decisionActionUpdated'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure: here you're updating the decision div whenever a participant is added or removed. Is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is probably a very rare case, thus maybe also not needed: if one assigns himself/herself as a recommendOnly editor, he/she should see the "Make Recommendatin" button and the same if he/she removes himself/herself... Also if one assigns himself/herself as decision making editor, he/she should see the existing recommendations... -- I can also leave it so that such a user has to reload the page?
Or maybe also to check somehow if the user is on the review page and only then to reload it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No that sounds good. Best to just reload it to keep the data fresh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... the #reviewDecisionsDiv-13 is reloaded in the line above but what that is... I have #reviewDecisionsDiv-9... Hmmm... And I see there seem to be a ways to reload those divs... as in the line above... I think I will have to test this once again... Sorry... :-\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And does this mean that this reload in the line above is bound to all 'dataChanged' events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this is not necessary here... I will change it...
Sorry @NateWr, that trigger of global event was not needed because that div should be reloaded in the earlier line, just that the div id was wrong. I fixed it, so could you please take another look at the same commit? Sorry, sorry, sorry!!! :- |
The code looks good. I haven't spun it up and tested, but I presume it's working alright. |
s. #2433