From 8a08ea9837db7b5e9d614583d9db07099dc200ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Thu, 19 Sep 2024 17:23:06 +0200 Subject: [PATCH] Author workflow configuration --- public/globals.js | 2 +- src/components/TableNext/Table.vue | 8 +- src/composables/useReviewAssignment.js | 61 -- src/composables/useSubmission.js | 65 +- src/managers/FileManager/FileManager.vue | 42 +- .../FileManager/useFileManagerActions.js | 12 +- .../FileManager/useFileManagerConfig.js | 11 + .../ReviewerManager/ReviewerManager.vue | 40 +- .../ReviewerManagerCellActions.vue | 2 + .../ReviewerManagerCellPrimaryActions.vue | 2 + .../ReviewerManager/reviewerManagerStore.js | 34 +- .../useReviewerManagerActions.js | 53 +- src/pages/dashboard/DashboardPage.vue | 5 + .../SubmissionSummaryModal.vue | 2 + .../composables/useEditorPublicationConfig.js | 256 ------ .../composables/useEditorWorkflowConfig.js | 401 --------- .../composables/useSummaryConfig.js | 747 ----------------- .../composables/useWorkflowAuthorConfig.js | 405 +++++++++ .../composables/useWorkflowEditorialConfig.js | 775 ++++++++++++++++++ ...eNav.js => useWorkflowNavigationConfig.js} | 254 ++++-- .../primaryItems/PublicationForm.vue | 14 +- .../WorkflowNotificationDisplay.vue | 87 ++ .../submissionSummaryStore.js | 126 +-- .../CellReviewAssignmentActions.vue | 3 +- .../CellSubmissionActivityReviewsOpen.vue | 7 +- .../CellSubmissionActivityReviewsUpdate.vue | 4 +- .../composables/useReviewActivityLogic.js | 4 +- .../composables/useWorkflowActions.js | 28 - src/pages/dashboard/dashboardPageStore.js | 13 +- 29 files changed, 1730 insertions(+), 1733 deletions(-) delete mode 100644 src/composables/useReviewAssignment.js delete mode 100644 src/pages/dashboard/SubmissionSummaryModal/composables/useEditorPublicationConfig.js delete mode 100644 src/pages/dashboard/SubmissionSummaryModal/composables/useEditorWorkflowConfig.js delete mode 100644 src/pages/dashboard/SubmissionSummaryModal/composables/useSummaryConfig.js create mode 100644 src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowAuthorConfig.js create mode 100644 src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowEditorialConfig.js rename src/pages/dashboard/SubmissionSummaryModal/composables/{useSummarySideNav.js => useWorkflowNavigationConfig.js} (53%) create mode 100644 src/pages/dashboard/SubmissionSummaryModal/primaryItems/WorkflowNotificationDisplay.vue diff --git a/public/globals.js b/public/globals.js index 33b2d4263..158293a54 100644 --- a/public/globals.js +++ b/public/globals.js @@ -340,7 +340,7 @@ window.pkp = { 'dashboard.summary.reviewers': 'Reviewers', 'dashboard.summary.revisionsUploaded': 'Revisions Submitted', 'dashboard.summary.revisionsUploadedDescription': - 'These files have been submitted by the author after visions were requested', + 'These files have been submitted by the author after revisions were requested', 'dashboard.summary.sendSubmissionForReview': 'Send submission for review', 'dashboard.summary.sendToProduction': 'Send to Production', 'dashboard.summary.viewActivityLog': 'View activity log', diff --git a/src/components/TableNext/Table.vue b/src/components/TableNext/Table.vue index 4872efe54..da14b207d 100644 --- a/src/components/TableNext/Table.vue +++ b/src/components/TableNext/Table.vue @@ -12,11 +12,15 @@ > -
+
-
+
diff --git a/src/composables/useReviewAssignment.js b/src/composables/useReviewAssignment.js deleted file mode 100644 index 3674aee44..000000000 --- a/src/composables/useReviewAssignment.js +++ /dev/null @@ -1,61 +0,0 @@ -const InProgressReviewAssignmentStatuses = [ - pkp.const.REVIEW_ASSIGNMENT_STATUS_ACCEPTED, - pkp.const.REVIEW_ASSIGNMENT_STATUS_REVIEW_OVERDUE, -]; -const CompletedReviewAssignmentStatuses = [ - pkp.const.REVIEW_ASSIGNMENT_STATUS_RECEIVED, - pkp.const.REVIEW_ASSIGNMENT_STATUS_COMPLETE, - pkp.const.REVIEW_ASSIGNMENT_STATUS_THANKED, - pkp.const.REVIEW_ASSIGNMENT_STATUS_CANCELLED, - pkp.const.REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND, -]; - -const IgnoredReviewAssignmentStatuses = [ - pkp.const.REVIEW_ASSIGNMENT_STATUS_DECLINED, - pkp.const.REVIEW_ASSIGNMENT_STATUS_CANCELLED, -]; - -export function useReviewAssignment() { - function getActiveReviewAssignments(reviewAssignments) { - return reviewAssignments.filter( - (reviewAssignment) => - !IgnoredReviewAssignmentStatuses.includes(reviewAssignment.statusId), - ); - } - - function getCompletedReviewAssignments(reviewAssignments = []) { - return getActiveReviewAssignments(reviewAssignments).filter( - (reviewAssignment) => - CompletedReviewAssignmentStatuses.includes(reviewAssignment.statusId), - ); - } - - function getOpenReviewAssignments(reviewAssignments = []) { - return reviewAssignments.filter( - (reviewAssignment) => - reviewAssignment.reviewMethod === - pkp.const.SUBMISSION_REVIEW_METHOD_OPEN, - ); - } - - function getReviewMethodIcons(reviewAssignment) { - switch (reviewAssignment.reviewMethod) { - case pkp.const.SUBMISSION_REVIEW_METHOD_ANONYMOUS: - return ['OpenReview', 'AnonymousReview']; - case pkp.const.SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS: - return ['AnonymousReview', 'AnonymousReview']; - case pkp.const.SUBMISSION_REVIEW_METHOD_OPEN: - return ['OpenReview', 'OpenReview']; - } - - return ['OpenReview', 'OpenReview']; - } - - return { - getActiveReviewAssignments, - getCompletedReviewAssignments, - getOpenReviewAssignments, - getReviewMethodIcons, - InProgressReviewAssignmentStatuses, - }; -} diff --git a/src/composables/useSubmission.js b/src/composables/useSubmission.js index 9bcdafc8d..eb5169887 100644 --- a/src/composables/useSubmission.js +++ b/src/composables/useSubmission.js @@ -26,6 +26,23 @@ export const ExtendedStagesLabels = { declined: tk('submissions.declined'), }; +const InProgressReviewAssignmentStatuses = [ + pkp.const.REVIEW_ASSIGNMENT_STATUS_ACCEPTED, + pkp.const.REVIEW_ASSIGNMENT_STATUS_REVIEW_OVERDUE, +]; +const CompletedReviewAssignmentStatuses = [ + pkp.const.REVIEW_ASSIGNMENT_STATUS_RECEIVED, + pkp.const.REVIEW_ASSIGNMENT_STATUS_COMPLETE, + pkp.const.REVIEW_ASSIGNMENT_STATUS_THANKED, + pkp.const.REVIEW_ASSIGNMENT_STATUS_CANCELLED, + pkp.const.REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND, +]; + +const IgnoredReviewAssignmentStatuses = [ + pkp.const.REVIEW_ASSIGNMENT_STATUS_DECLINED, + pkp.const.REVIEW_ASSIGNMENT_STATUS_CANCELLED, +]; + export function useSubmission() { function getActiveStage(submission) { return submission.stages.find((stage) => stage.isActiveStage); @@ -39,8 +56,8 @@ export function useSubmission() { return submissions.find((submission) => submission.id === submissionId); } - function getReviewAssignmentsForRound(submission, roundId) { - return submission.reviewAssignments.filter( + function getReviewAssignmentsForRound(reviewAssignments, roundId) { + return reviewAssignments.filter( (reviewAssignment) => reviewAssignment.roundId === roundId, ); } @@ -150,6 +167,44 @@ export function useSubmission() { return submission.stageId < stageId; } + function getActiveReviewAssignments(reviewAssignments) { + return reviewAssignments.filter( + (reviewAssignment) => + !IgnoredReviewAssignmentStatuses.includes(reviewAssignment.statusId), + ); + } + + function getCompletedReviewAssignments(reviewAssignments = []) { + return getActiveReviewAssignments(reviewAssignments).filter( + (reviewAssignment) => + CompletedReviewAssignmentStatuses.includes(reviewAssignment.statusId), + ); + } + + function getOpenReviewAssignmentsForRound(reviewAssignments, reviewRoundId) { + return getReviewAssignmentsForRound( + reviewAssignments, + reviewRoundId, + ).filter( + (reviewAssignment) => + reviewAssignment.reviewMethod === + pkp.const.SUBMISSION_REVIEW_METHOD_OPEN, + ); + } + + function getReviewMethodIcons(reviewAssignment) { + switch (reviewAssignment.reviewMethod) { + case pkp.const.SUBMISSION_REVIEW_METHOD_ANONYMOUS: + return ['OpenReview', 'AnonymousReview']; + case pkp.const.SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS: + return ['AnonymousReview', 'AnonymousReview']; + case pkp.const.SUBMISSION_REVIEW_METHOD_OPEN: + return ['OpenReview', 'OpenReview']; + } + + return ['OpenReview', 'OpenReview']; + } + return { getSubmissionById, getActiveStage, @@ -165,6 +220,12 @@ export function useSubmission() { getFileStageFromWorkflowStage, hasNotSubmissionStartedStage, hasSubmissionPassedStage, + // review assignments getReviewAssignmentsForRound, + getActiveReviewAssignments, + getCompletedReviewAssignments, + getOpenReviewAssignmentsForRound, + getReviewMethodIcons, + InProgressReviewAssignmentStatuses, }; } diff --git a/src/managers/FileManager/FileManager.vue b/src/managers/FileManager/FileManager.vue index 187dc947a..cc90fb455 100644 --- a/src/managers/FileManager/FileManager.vue +++ b/src/managers/FileManager/FileManager.vue @@ -1,30 +1,32 @@