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#10480 Add stage assignment related data to submission schema #10523

Merged
merged 12 commits into from
Jan 24, 2025

Conversation

Vitaliy-1
Copy link
Collaborator

No description provided.

@Vitaliy-1
Copy link
Collaborator Author

This still requires to figure out if adding this data to individual submissions or only to lists and add to the schema description

@Vitaliy-1 Vitaliy-1 force-pushed the i10480_submission_schema branch from b29c3c0 to 9ba4db5 Compare October 17, 2024 14:22
@Vitaliy-1 Vitaliy-1 force-pushed the i10480_submission_schema branch from a9b8d1b to aeb7f4b Compare January 2, 2025 12:38
@Vitaliy-1 Vitaliy-1 force-pushed the i10480_submission_schema branch 4 times, most recently from 41ed351 to 56b7164 Compare January 9, 2025 20:13
@Vitaliy-1 Vitaliy-1 force-pushed the i10480_submission_schema branch 6 times, most recently from 1019e7e to d399019 Compare January 19, 2025 22:11
@@ -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(
Copy link
Contributor

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) ? :-)

Copy link
Collaborator Author

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'])
Copy link
Contributor

@jardakotesovec jardakotesovec Jan 20, 2025

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?

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

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.

Copy link
Collaborator Author

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

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.

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'm assigning the same value for $isCurrentUserDecidingEditor and $stages[$stageId]['isCurrentUserDecidingEditor'] just for convenience for later re-use.

@Vitaliy-1 Vitaliy-1 force-pushed the i10480_submission_schema branch from d399019 to 9533b68 Compare January 23, 2025 17:28
@Vitaliy-1 Vitaliy-1 force-pushed the i10480_submission_schema branch from 9533b68 to d53a276 Compare January 24, 2025 15:33
@Vitaliy-1 Vitaliy-1 merged commit 79273ea into pkp:main Jan 24, 2025
1 check passed
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