-
Notifications
You must be signed in to change notification settings - Fork 452
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#10480 Add stage assignment related data to submission schema #10523
Conversation
This still requires to figure out if adding this data to individual submissions or only to lists and add to the schema description |
b29c3c0
to
9ba4db5
Compare
a9b8d1b
to
aeb7f4b
Compare
41ed351
to
56b7164
Compare
1019e7e
to
d399019
Compare
@@ -939,7 +939,7 @@ protected function mapDashboardViews(Collection $types, Context $context, User $ | |||
case DashboardView::TYPE_REVIEWS_SUBMITTED: | |||
$collector = Repo::submission()->getCollector() | |||
->filterByContextIds([$context->getId()]) | |||
->filterByAwaitingReviews(true) | |||
->filterByReviewsSubmitted(true) | |||
->filterByStatus([PKPSubmission::STATUS_QUEUED]); | |||
return new DashboardView( |
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.
Is this fix for #10765 (comment) ? :-)
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, I've made it a long time ago)
@@ -694,9 +834,12 @@ protected function getUserGroup(int $userGroupId): ?UserGroup | |||
protected function getStageAssignmentsBySubmissions(Enumerable $submissions, array $roleIds = []): LazyCollection | |||
{ | |||
$submissionIds = $submissions->map(fn (Submission $submission) => $submission->getId())->toArray(); | |||
return StageAssignment::withSubmissionIds($submissionIds) | |||
->withRoleIds($roleIds) | |||
$stageAssignments = StageAssignment::with(['userGroup.userUserGroups', 'userGroup.userGroupStages']) |
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.
Seems that this loads stageAssignment.userGroup.userUserGroups - but it includes all the users having that groupId, not just the one thats only in stageAssignment. I see you filter by stageAssignment.userId in php, which is fine. Just bit worried that this can be long list if there is lots of users in the system. And its in every stageAssignemt - so I suspect that can get quite big and memory intensive?
classes/submission/maps/Schema.php
Outdated
$stage['availableEditorialDecisions'] = array_map(fn (DecisionType $decisionType) => ['id' => $decisionType->getDecision(), 'label' => $decisionType->getLabel()], $availableEditorialDecisions); | ||
// Set recommendations for the deciding editor | ||
if ($isCurrentUserDecidingEditor) { | ||
$stages[$decision->getData('stageId')]['recommendations'][] = $recommendationData; |
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 might have not explain this one clearly. Deciding editors needs to see last recommendation. But if there is multiple recommend only editors - he needs to see last from each of them. Which I suspect is not considered.
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.
Will do!
foreach ($stageIds as $stageId) { | ||
$stages[$stageId]['currentUserAssignedRoles'] = $globalRoles; | ||
if ($hasRecommendingEditors) { | ||
$isCurrentUserDecidingEditor = $stages[$stageId]['isCurrentUserDecidingEditor'] = true; |
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.
There is logic below, to set $stages[$stageId]['isCurrentUserDecidingEditor'] based on the $isCurrentUserDecidingEditor and $hasRecommendingEditors. So maybe not necessary here. But thats very minor observation.
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'm assigning the same value for $isCurrentUserDecidingEditor
and $stages[$stageId]['isCurrentUserDecidingEditor']
just for convenience for later re-use.
d399019
to
9533b68
Compare
9533b68
to
d53a276
Compare
No description provided.