Skip to content
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

Merged
merged 9 commits into from
Sep 14, 2017
Merged

pkp/pkp-lib#2433 editor recommendation #2749

merged 9 commits into from
Sep 14, 2017

Conversation

bozana
Copy link
Collaborator

@bozana bozana commented Aug 28, 2017

s. #2433

Copy link
Contributor

@NateWr NateWr left a 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
Copy link
Contributor

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
Copy link
Contributor

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;
Copy link
Contributor

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());


Copy link
Contributor

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;
Copy link
Contributor

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.

Copy link
Collaborator Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -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>
Copy link
Contributor

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.

@@ -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>
Copy link
Contributor

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.

@@ -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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make Recommendation

<!-- 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>
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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">
Copy link
Contributor

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.

Copy link
Contributor

@NateWr NateWr left a 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
Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, good catch! :-)

@bozana
Copy link
Collaborator Author

bozana commented Sep 12, 2017

@NateWr, could you please take a look at the new commit "reload editor decision div" above -- it also generally provides the refreshOn for the load_url_in_div. Thanks to your global even feature! THANKS!!!

@@ -40,6 +41,7 @@
.each(function() {
$.pkp.classes.Handler.getHandler($(this)).reload();
});
pkp.eventBus.$emit('decisionActionUpdated');
Copy link
Contributor

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?

Copy link
Collaborator Author

@bozana bozana Sep 12, 2017

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?

Copy link
Contributor

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.

Copy link
Collaborator Author

@bozana bozana Sep 12, 2017

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... :-\

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

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...

@bozana
Copy link
Collaborator Author

bozana commented Sep 12, 2017

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!!! :-
I think we still need the refreshOn feature because if the change is coming from a page handler and there is no another/specific JS handler associated with the div, there is no possibility to upload it, correct?

@NateWr
Copy link
Contributor

NateWr commented Sep 12, 2017

The code looks good. I haven't spun it up and tested, but I presume it's working alright.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants