Skip to content

Commit c5f1fb4

Browse files
pkp/pkp-lib#10674 Add scenarios when the review assignment is declined and moved to copyediting&production stage (covered in pkp/pkp-lib#10970)
1 parent a463c45 commit c5f1fb4

File tree

5 files changed

+86
-19
lines changed

5 files changed

+86
-19
lines changed

src/composables/useSubmission.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ const InProgressReviewAssignmentStatuses = [
6666
pkp.const.REVIEW_ASSIGNMENT_STATUS_ACCEPTED,
6767
pkp.const.REVIEW_ASSIGNMENT_STATUS_REVIEW_OVERDUE,
6868
];
69-
const CompletedReviewAssignmentStatuses = [
69+
70+
// Submitted reviews
71+
export const CompletedReviewAssignmentStatuses = [
7072
pkp.const.REVIEW_ASSIGNMENT_STATUS_RECEIVED,
7173
pkp.const.REVIEW_ASSIGNMENT_STATUS_COMPLETE,
7274
pkp.const.REVIEW_ASSIGNMENT_STATUS_THANKED,
73-
pkp.const.REVIEW_ASSIGNMENT_STATUS_CANCELLED,
74-
pkp.const.REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND,
75+
pkp.const.REVIEW_ASSIGNMENT_STATUS_VIEWED,
7576
];
7677

7778
const IgnoredReviewAssignmentStatuses = [

src/pages/dashboard/DashboardPage.stories.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,11 @@ export const ReviewAssignmentStatusesReviewer = {
243243
<li><b>8.REVIEW_ASSIGNMENT_STATUS_THANKED</b> - reviewer has been thanked </li>
244244
<li><b>9.REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND</b> - request resent to reviewer after they declined</li>
245245
<li><b>10.REVIEW_ASSIGNMENT_STATUS_VIEWED</b> -editor viewed the review, but not confirm</li>
246-
<li><b>11.REVIEW_ASSIGNMENT_STATUS_CANCELLED</b> - reviewer cancelled review request // should not be displayed </li>
247-
</ul>
246+
<li><b>11.REVIEW_ASSIGNMENT_STATUS_ACCEPTED + copy/prod stage</b> - submission moved to the copyediting/production stage, considered as incomplete</li>
247+
<li><b>12.REVIEW_ASSIGNMENT_STATUS_DECLINED + copy/prod stage</b> - submission moved to the copyediting/production stage, still indicate declined</li>
248+
<li><b>13.REVIEW_ASSIGNMENT_STATUS_CANCELLED</b> - reviewer cancelled review request / should not be displayed </li>
249+
250+
</ul>
248251
249252
<DashboardPage v-bind="args" />`,
250253
}),

src/pages/dashboard/components/DashboardTable/DashboardCellReviewAssignmentActions.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<TableCell>
33
<PkpButton
4+
v-if="actionLabel"
45
class="-ms-3"
56
:aria-describedby="'submission-title-' + item.id"
67
:is-link="true"
@@ -18,6 +19,8 @@
1819
import {defineProps, computed} from 'vue';
1920
import PkpButton from '@/components/Button/Button.vue';
2021
import TableCell from '@/components/Table/TableCell.vue';
22+
import {CompletedReviewAssignmentStatuses} from '@/composables/useSubmission.js';
23+
2124
import {useDashboardPageStore} from '@/pages/dashboard/dashboardPageStore.js';
2225
import {useLocalize} from '@/composables/useLocalize';
2326
@@ -28,6 +31,19 @@ const props = defineProps({
2831
});
2932
3033
const actionLabel = computed(() => {
34+
// Submission progress to copyediting/production stage
35+
if (
36+
[
37+
pkp.const.WORKFLOW_STAGE_ID_EDITING,
38+
pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
39+
].includes(props.item.stageId)
40+
) {
41+
// It the review assignment is incomplete, show no action
42+
// for complete sceario it will fallback to the 'View' below
43+
if (!CompletedReviewAssignmentStatuses.includes(props.item.status)) {
44+
return null;
45+
}
46+
}
3147
switch (props.item.status) {
3248
case pkp.const.REVIEW_ASSIGNMENT_STATUS_AWAITING_RESPONSE:
3349
case pkp.const.REVIEW_ASSIGNMENT_STATUS_RESPONSE_OVERDUE:

src/pages/dashboard/composables/useDashboardConfigEditorialActivity.js

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import {useSubmission} from '@/composables/useSubmission.js';
1+
import {
2+
useSubmission,
3+
CompletedReviewAssignmentStatuses,
4+
} from '@/composables/useSubmission.js';
25
import {useLocalize} from '@/composables/useLocalize';
36
import {useDate} from '@/composables/useDate';
47
import {Actions as ParticipantManagerActions} from '@/managers/ParticipantManager/useParticipantManagerActions';
@@ -383,34 +386,61 @@ export function useDashboardConfigEditorialActivity() {
383386
}
384387

385388
function getEditorialActivityForMyReviewAssignments(reviewAssignment) {
389+
console.log(
390+
'getEditorialActivityForMyReviewAssignments',
391+
reviewAssignment.status,
392+
);
393+
394+
// When declined always show the same status regardless of the stage
386395
if (
387-
[
388-
pkp.const.REVIEW_ASSIGNMENT_STATUS_AWAITING_RESPONSE,
389-
pkp.const.REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND,
390-
].includes(reviewAssignment.status)
396+
reviewAssignment.status === pkp.const.REVIEW_ASSIGNMENT_STATUS_DECLINED
391397
) {
392-
const date = reviewAssignment.dateResponseDue;
398+
// indeed when declined, the dateConfirmed gets set regardless if its accepted or declined
399+
const date = reviewAssignment.dateConfirmed;
400+
393401
return [
394402
{
395403
component: 'DashboardCellReviewAssignmentActivityAlert',
396404
props: {
397-
alert: t('dashboard.reviewAssignment.acceptOrDeclineRequestDate', {
405+
alert: t('dashboard.reviewAssignment.declined', {
398406
date: formatShortDate(date),
399407
}),
400408
},
401409
},
402410
];
411+
}
412+
// if the submission moved to editorial / production stage
413+
else if (
414+
[
415+
pkp.const.WORKFLOW_STAGE_ID_EDITING,
416+
pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
417+
].includes(reviewAssignment.stageId)
418+
) {
419+
// It the review assignment is incomplete
420+
if (
421+
!CompletedReviewAssignmentStatuses.includes(reviewAssignment.status)
422+
) {
423+
return [
424+
{
425+
component: 'DashboardCellReviewAssignmentActivityAlert',
426+
props: {
427+
alert: t(`submissions.incomplete`),
428+
},
429+
},
430+
];
431+
}
403432
} else if (
404-
reviewAssignment.status === pkp.const.REVIEW_ASSIGNMENT_STATUS_DECLINED
433+
[
434+
pkp.const.REVIEW_ASSIGNMENT_STATUS_AWAITING_RESPONSE,
435+
pkp.const.REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND,
436+
].includes(reviewAssignment.status)
405437
) {
406-
// indeed when declined, the dateConfirmed gets set regardless if its accepted or declined
407-
const date = reviewAssignment.dateConfirmed;
408-
438+
const date = reviewAssignment.dateResponseDue;
409439
return [
410440
{
411441
component: 'DashboardCellReviewAssignmentActivityAlert',
412442
props: {
413-
alert: t('dashboard.reviewAssignment.declined', {
443+
alert: t('dashboard.reviewAssignment.acceptOrDeclineRequestDate', {
414444
date: formatShortDate(date),
415445
}),
416446
},
@@ -439,7 +469,9 @@ export function useDashboardConfigEditorialActivity() {
439469
{
440470
component: 'DashboardCellReviewAssignmentActivityAlert',
441471
props: {
442-
alert: t('dashboard.reviewAssignment.completeReviewByDate', {date}),
472+
alert: t('dashboard.reviewAssignment.completeReviewByDate', {
473+
date,
474+
}),
443475
},
444476
},
445477
];
@@ -463,7 +495,7 @@ export function useDashboardConfigEditorialActivity() {
463495
pkp.const.REVIEW_ASSIGNMENT_STATUS_VIEWED,
464496
pkp.const.REVIEW_ASSIGNMENT_STATUS_COMPLETE,
465497
pkp.const.REVIEW_ASSIGNMENT_STATUS_THANKED,
466-
].includes(reviewAssignment.statusId)
498+
].includes(reviewAssignment.status)
467499
) {
468500
const date = reviewAssignment.dateCompleted;
469501

src/pages/dashboard/mocks/reviewAssignmentScenariosMock.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {getReviewAssignmentFullMock} from './reviewAssignmentsMock';
22
export const ReviewAssignmentEditorialActivityScenario = [
3+
// Review stage
34
//REVIEW_ASSIGNMENT_STATUS_AWAITING_RESPONSE // request has been sent but reviewer has not responded
45
getReviewAssignmentFullMock({
56
submissionId: 1,
@@ -50,4 +51,18 @@ export const ReviewAssignmentEditorialActivityScenario = [
5051
submissionId: 10,
5152
statusId: pkp.const.REVIEW_ASSIGNMENT_STATUS_VIEWED,
5253
}),
54+
// When moved to copyediting / production stage
55+
// When the review was not completed (submitted)
56+
getReviewAssignmentFullMock({
57+
submissionId: 11,
58+
statusId: pkp.const.REVIEW_ASSIGNMENT_STATUS_ACCEPTED,
59+
stageId: pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
60+
}),
61+
// When moved to copyediting / production stage
62+
// When the review was declined - same indication for declined regardless of the stage
63+
getReviewAssignmentFullMock({
64+
submissionId: 12,
65+
statusId: pkp.const.REVIEW_ASSIGNMENT_STATUS_DECLINED,
66+
stageId: pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
67+
}),
5368
];

0 commit comments

Comments
 (0)