+
+
-
+
-
+
diff --git a/src/pages/dashboard/SubmissionSummaryModal/actionItems/ActionButton.vue b/src/pages/dashboard/SubmissionSummaryModal/actionItems/ActionButton.vue
index 34f60bc1b..aaf7e5732 100644
--- a/src/pages/dashboard/SubmissionSummaryModal/actionItems/ActionButton.vue
+++ b/src/pages/dashboard/SubmissionSummaryModal/actionItems/ActionButton.vue
@@ -3,7 +3,7 @@
:is-primary="isPrimary"
:is-secondary="isSecondary"
:is-warnable="isWarnable"
- @click="() => handleAction(action, {})"
+ @click="() => store[action](actionArgs)"
>
{{ label }}
@@ -11,15 +11,16 @@
diff --git a/src/pages/dashboard/SubmissionSummaryModal/actionItems/WorkflowPaymentDropdown.vue b/src/pages/dashboard/SubmissionSummaryModal/actionItems/WorkflowPaymentDropdown.vue
new file mode 100644
index 000000000..277ac6a3b
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/actionItems/WorkflowPaymentDropdown.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
diff --git a/src/pages/dashboard/SubmissionSummaryModal/actionItems/WorkflowRecommendationControls.vue b/src/pages/dashboard/SubmissionSummaryModal/actionItems/WorkflowRecommendationControls.vue
new file mode 100644
index 000000000..0a623ff60
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/actionItems/WorkflowRecommendationControls.vue
@@ -0,0 +1,87 @@
+
+
+
+
+ {{ t('editor.submission.recommendation') }}
+
+
+
+
+ {{ currentRecommendation.label }}
+
+
+
+ {{ t('editor.submission.workflowDecision.changeDecision') }}
+
+
+
+
+
+
handleAction(actionItem.action)"
+ >
+ {{ actionItem.label }}
+
+
+
+
diff --git a/src/pages/dashboard/SubmissionSummaryModal/composables/useSummaryConfig.js b/src/pages/dashboard/SubmissionSummaryModal/composables/useSummaryConfig.js
deleted file mode 100644
index 0e80ab8fa..000000000
--- a/src/pages/dashboard/SubmissionSummaryModal/composables/useSummaryConfig.js
+++ /dev/null
@@ -1,743 +0,0 @@
-import {useSubmission} from '@/composables/useSubmission.js';
-import {useLocalize} from '@/composables/useLocalize';
-import {useDate} from '@/composables/useDate';
-import {useReviewAssignment} from '@/composables/useReviewAssignment';
-const DashboardPageTypes = {
- EDITORIAL_DASHBOARD: 'editorialDashboard',
- MY_REVIEW_ASSIGNMENTS: 'myReviewAssignments',
- MY_SUBMISSIONS: 'mySubmissions',
-};
-
-const {getActiveStage, getCurrentReviewRound} = useSubmission();
-const {InProgressReviewAssignmentStatuses} = useReviewAssignment();
-const {calculateDaysBetweenDates, formatShortDate} = useDate();
-
-const {localizeSubmission, t} = useLocalize();
-
-export function useSummaryConfig() {
- function filterItemsBasedOnContext(
- items,
- dashboardPage,
- submission,
- reviewAssignment = null,
- ) {
- const activeStage = getActiveStage(submission);
- const activeReviewRound = getCurrentReviewRound(submission);
- return items
- .filter((item) => {
- if (item?.filters?.dashboardPage) {
- return item?.filters?.dashboardPage.includes(dashboardPage);
- }
-
- return true;
- })
- .filter((item) => {
- if (item?.filters?.activeStageId) {
- return item?.filters?.activeStageId.includes(activeStage.id);
- }
-
- return true;
- })
- .filter((item) => {
- if (item?.filters?.productionStageSubmissionStatusId) {
- return (
- activeStage.id === pkp.const.WORKFLOW_STAGE_ID_PRODUCTION &&
- item?.filters?.productionStageSubmissionStatusId.includes(
- submission.status,
- )
- );
- }
-
- return true;
- })
- .filter((item) => {
- if (item?.filters?.activeRoundStatusId) {
- return item?.filters?.activeRoundStatusId.includes(
- activeReviewRound.statusId,
- );
- }
-
- return true;
- })
- .filter((item) => {
- if (item?.filters?.reviewAssignmentStatusId && reviewAssignment) {
- return item?.filters?.reviewAssignmentStatusId.includes(
- reviewAssignment.statusId,
- );
- }
- return true;
- })
- .map((item) => {
- return item;
- });
- }
-
- function getPrimaryItems(submission, currentPublication) {
- const activeReviewRound = getCurrentReviewRound(submission);
-
- return [
- {
- component: 'LastActivity',
- props: {},
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
- {
- component: 'PrimaryBasicMetadata',
- props: {
- heading: t('common.subtitle'),
- body: localizeSubmission(
- currentPublication.subtitle,
- currentPublication.locale,
- ),
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION],
- productionStageSubmissionStatusId: [
- pkp.const.STATUS_SCHEDULED,
- pkp.const.STATUS_PUBLISHED,
- ],
- },
- },
- {
- component: 'PrimaryBasicMetadata',
- props: {
- heading: t('metadata.property.displayName.doi'),
- body: currentPublication?.doiObject?.doi,
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION],
- productionStageSubmissionStatusId: [
- pkp.const.STATUS_SCHEDULED,
- pkp.const.STATUS_PUBLISHED,
- ],
- },
- },
-
- {
- component: 'ContributorManager',
- props: {
- title: t('publication.contributors'),
- submissionId: submission.id,
- publicationId: currentPublication?.id,
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION],
- productionStageSubmissionStatusId: [
- pkp.const.STATUS_SCHEDULED,
- pkp.const.STATUS_PUBLISHED,
- ],
- },
- },
- {
- component: 'FileManager',
- props: {
- configName: 'SUBMISSION_FILES',
- submission: submission,
- submissionStageId: submission.stageId,
- },
- filters: {
- dashboardPage: [
- DashboardPageTypes.EDITORIAL_DASHBOARD,
- DashboardPageTypes.MY_SUBMISSIONS,
- ],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_SUBMISSION],
- },
- },
-
- {
- component: 'DiscussionManager',
- props: {submissionId: submission.id, stageId: submission.stageId},
- filters: {
- dashboardPage: [
- DashboardPageTypes.EDITORIAL_DASHBOARD,
- DashboardPageTypes.MY_SUBMISSIONS,
- ],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_SUBMISSION],
- },
- },
-
- {
- component: 'FileManager',
- props: {
- configName: 'WORKFLOW_REVIEW_REVISIONS',
- submission: submission,
- submissionStageId: submission.stageId,
- reviewRoundId: activeReviewRound?.id,
- },
- filters: {
- dashboardPage: [
- DashboardPageTypes.EDITORIAL_DASHBOARD,
- DashboardPageTypes.MY_SUBMISSIONS,
- ],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- },
- },
- {
- component: 'FileManager',
- props: {
- configName: 'EDITOR_REVIEW_FILES',
- submission: submission,
- submissionStageId: submission.stageId,
- reviewRoundId: activeReviewRound?.id,
- },
- filters: {
- dashboardPage: [
- DashboardPageTypes.EDITORIAL_DASHBOARD,
- // TODO disabled for now as API is not authorising
- //DashboardPageTypes.MY_REVIEW_ASSIGNMENTS,
- ],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- },
- },
- {
- component: 'FileManager',
- props: {
- configName: 'COPYEDITED_FILES',
- submission: submission,
- submissionStageId: submission.stageId,
- },
- filters: {
- dashboardPage: [
- DashboardPageTypes.EDITORIAL_DASHBOARD,
- DashboardPageTypes.MY_SUBMISSIONS,
- ],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EDITING],
- },
- },
- {
- component: 'FileManager',
- props: {
- configName: 'FINAL_DRAFT_FILES',
- submission: submission,
- submissionStageId: submission.stageId,
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EDITING],
- },
- },
- {
- component: 'FileManager',
- props: {
- configName: 'PRODUCTION_READY_FILES',
- submission: submission,
- submissionStageId: submission.stageId,
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION],
- productionStageSubmissionStatusId: [pkp.const.STATUS_QUEUED],
- },
- },
- {
- component: 'FileManager',
- props: {
- namespace: 'galleys',
- submissionId: submission.id,
- submissionStageId: submission.stageId,
-
- fileStages: [pkp.const.SUBMISSION_FILE_PROOF],
- title: t('dashboard.summary.galleys'),
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION],
- productionStageSubmissionStatusId: [
- pkp.const.STATUS_SCHEDULED,
- pkp.const.STATUS_PUBLISHED,
- ],
- },
- },
-
- {
- component: 'ReviewerManager',
- props: {
- submission: submission,
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- },
- },
- {
- component: 'ReviewerManager',
- props: {
- submission: submission,
- redactedForAuthors: true,
- },
- filters: {
- dashboardPage: [DashboardPageTypes.MY_SUBMISSIONS],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- },
- },
- ];
- }
-
- function getActionItems(submission, currentPublication) {
- return [
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.uploadRevisions'),
- isSecondary: true,
- action: 'uploadRevisions',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.MY_SUBMISSIONS],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- activeRoundStatusId: [
- pkp.const.REVIEW_ROUND_STATUS_REVISIONS_REQUESTED,
- pkp.const.REVIEW_ROUND_STATUS_RESUBMIT_FOR_REVIEW,
- // Keep it available also after submitted (following logic from workflow page)
- pkp.const.REVIEW_ROUND_STATUS_REVISIONS_SUBMITTED,
- pkp.const.REVIEW_ROUND_STATUS_RESUBMIT_FOR_REVIEW_SUBMITTED,
- ],
- },
- },
- //
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.sendSubmissionForReview'),
- isPrimary: true,
- action: 'decisionExternalReview',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_SUBMISSION],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.acceptAndSkipReview'),
- isSecondary: true,
- action: 'decisionSkipExternalReview',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_SUBMISSION],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.declineSubmission'),
- isWarnable: true,
- action: 'decisionInitialDecline',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_SUBMISSION],
- },
- },
-
- //
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.requestRevisions'),
- isSecondary: true,
- action: 'requestRevisions',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.acceptSubmission'),
- action: 'decisionAccept',
- isPrimary: true,
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.cancelReviewRound'),
- isWarnable: true,
- action: 'decisionCancelReviewRound',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.declineSubmission'),
- isWarnable: true,
- action: 'decisionDecline',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.acceptReview'),
- isPrimary: true,
- action: 'openReviewForm',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.MY_REVIEW_ASSIGNMENTS],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- reviewAssignmentStatusId: [
- pkp.const.REVIEW_ASSIGNMENT_STATUS_AWAITING_RESPONSE,
- pkp.const.REVIEW_ASSIGNMENT_STATUS_RESPONSE_OVERDUE,
- pkp.const.REVIEW_ASSIGNMENT_STATUS_REVIEW_OVERDUE,
- pkp.const.REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND,
- ],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.accessReviewForm'),
- isPrimary: true,
- action: 'openReviewForm',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.MY_REVIEW_ASSIGNMENTS],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- reviewAssignmentStatusId: [
- pkp.const.REVIEW_ASSIGNMENT_STATUS_ACCEPTED,
- ],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.uploadFile'),
- isSecondary: true,
- action: 'uploadReviewerFile',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.MY_REVIEW_ASSIGNMENTS],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- reviewAssignmentStatusId: [...InProgressReviewAssignmentStatuses],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.decline'),
- isSecondary: true,
- action: 'declineReviewAssignment',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.MY_REVIEW_ASSIGNMENTS],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- reviewAssignmentStatusId: [
- pkp.const.REVIEW_ASSIGNMENT_STATUS_AWAITING_RESPONSE,
- // TODO: can be declined after resend?
- pkp.const.REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND,
- ],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.sendToProduction'),
- isPrimary: true,
- action: 'decisionSendToProduction',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EDITING],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.scheduleForProduction'),
- isPrimary: true,
- action: 'scheduleForPublication',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION],
- productionStageSubmissionStatusId: [pkp.const.STATUS_QUEUED],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.preview'),
- isSecondary: true,
- action: 'previewPublication',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION],
- productionStageSubmissionStatusId: [pkp.const.STATUS_SCHEDULED],
- },
- },
- {
- component: 'ActionButton',
- props: {
- label: t('dashboard.summary.unschedule'),
- isWarnable: true,
- action: 'unschedulePublication',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION],
- productionStageSubmissionStatusId: [pkp.const.STATUS_SCHEDULED],
- },
- },
- ];
- }
- function getMetaItems(submission, currentPublication) {
- return [
- {
- component: 'EditorsAssigned',
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
- {
- component: 'BasicMetadata',
- props: {
- heading: t('dashboard.summary.submittedOn'),
- body: formatShortDate(submission.dateSubmitted),
- },
- filters: {
- dashboardPage: [DashboardPageTypes.MY_SUBMISSIONS],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
- {
- component: 'BasicMetadata',
- props: {
- heading: t('dashboard.summary.daysSinceSubmission'),
- body: calculateDaysBetweenDates(submission.dateSubmitted, new Date()),
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
- {
- component: 'BasicMetadata',
- props: {
- heading: t('dashboard.summary.daysInSubmission'),
- body: '(todo)',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_SUBMISSION],
- },
- },
- {
- component: 'BasicMetadata',
- props: {
- heading: t('dashboard.summary.daysInReview'),
- body: '(todo)',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW],
- },
- },
- {
- component: 'BasicMetadata',
- props: {
- heading: t('dashboard.summary.daysInCopyediting'),
- body: '(todo)',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_EDITING],
- },
- },
- {
- component: 'BasicMetadata',
- props: {
- heading: t('dashboard.summary.daysInProduction'),
- body: '(todo)',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION],
- productionStageSubmissionStatusId: [pkp.const.STATUS_QUEUED],
- },
- },
-
- {
- component: 'BasicMetadata',
- props: {
- heading: t('dashboard.summary.journalName'),
- body: '(todo)',
- },
- filters: {
- dashboardPage: [DashboardPageTypes.MY_SUBMISSIONS],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
- {
- component: 'IssueAssigned',
- props: {isReadonly: false},
- filters: {
- dashboardPage: [DashboardPageTypes.EDITORIAL_DASHBOARD],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
- {
- component: 'IssueAssigned',
- props: {isReadOnly: true},
- filters: {
- dashboardPage: [DashboardPageTypes.MY_SUBMISSIONS],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
-
- {
- component: 'BasicMetadata',
- props: {
- heading: t('common.type'),
- body: '(todo)',
- },
- filters: {
- dashboardPage: [
- DashboardPageTypes.EDITORIAL_DASHBOARD,
- DashboardPageTypes.MY_SUBMISSIONS,
- ],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
-
- {
- component: 'BasicMetadata',
- props: {
- heading: t('common.abstract'),
- body: localizeSubmission(
- currentPublication?.abstract,
- currentPublication?.locale,
- ),
- },
- filters: {
- dashboardPage: [
- DashboardPageTypes.EDITORIAL_DASHBOARD,
- DashboardPageTypes.MY_SUBMISSIONS,
- DashboardPageTypes.MY_REVIEW_ASSIGNMENTS,
- ],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
- {
- component: 'BasicMetadata',
- props: {
- heading: t('common.keywords'),
- body:
- currentPublication?.keywords &&
- localizeSubmission(
- currentPublication?.keywords,
- currentPublication?.locale,
- ).join(', '),
- },
- filters: {
- dashboardPage: [
- DashboardPageTypes.EDITORIAL_DASHBOARD,
- DashboardPageTypes.MY_SUBMISSIONS,
- DashboardPageTypes.MY_REVIEW_ASSIGNMENTS,
- ],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
- {
- component: 'BasicMetadata',
- props: {
- heading: t('dashboard.summary.submissionLanguage'),
- body: `${currentPublication?.locale} (todo show language name not locale)`,
- },
- filters: {
- dashboardPage: [
- DashboardPageTypes.EDITORIAL_DASHBOARD,
- DashboardPageTypes.MY_SUBMISSIONS,
- DashboardPageTypes.MY_REVIEW_ASSIGNMENTS,
- ],
- activeStageId: [
- pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
- pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
- pkp.const.WORKFLOW_STAGE_ID_EDITING,
- pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
- ],
- },
- },
- ];
- }
-
- return {
- filterItemsBasedOnContext,
- getPrimaryItems,
- getActionItems,
- getMetaItems,
- };
-}
diff --git a/src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowAuthorConfig.js b/src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowAuthorConfig.js
new file mode 100644
index 000000000..379eaaed9
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowAuthorConfig.js
@@ -0,0 +1,405 @@
+import {useLocalize} from '@/composables/useLocalize';
+import {Actions} from '../../composables/useWorkflowActions';
+import {useSubmission} from '@/composables/useSubmission';
+
+const {hasSubmissionPassedStage, getOpenReviewAssignmentsForRound} =
+ useSubmission();
+
+const {t} = useLocalize();
+
+function getHeaderItems({
+ submission,
+ selectedPublication,
+ publicationSettings,
+}) {
+ if (!submission) {
+ return [];
+ }
+ const {t} = useLocalize();
+ const actions = [];
+
+ actions.push({
+ component: 'ActionButton',
+ props: {
+ label: t('editor.submissionLibrary'),
+ action: Actions.WORKFLOW_VIEW_LIBRARY,
+ },
+ });
+
+ return actions;
+}
+
+export const WorkflowConfig = {
+ common: {
+ getSecondaryItems: ({submission, selectedReviewRound, selectedStageId}) => {
+ const items = [];
+ return items;
+ },
+ getActionsItems: ({submission, selectedReviewRound, selectedStageId}) => {
+ const items = [];
+ return items;
+ },
+ },
+ [pkp.const.WORKFLOW_STAGE_ID_SUBMISSION]: {
+ getPrimaryItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+
+ if (
+ hasSubmissionPassedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
+ )
+ ) {
+ items.push({component: 'SubmissionStatus', props: {submission}});
+ }
+
+ items.push({
+ component: 'FileManager',
+ props: {
+ configName: 'SUBMISSION_FILES',
+ submission: submission,
+ submissionStageId: submission.stageId,
+ },
+ });
+
+ items.push({
+ component: 'DiscussionManager',
+ props: {submissionId: submission.id, stageId: selectedStageId},
+ });
+
+ return items;
+ },
+ },
+
+ [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW]: {
+ getPrimaryItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+ if (!selectedReviewRound) {
+ return [
+ {
+ component: 'PrimaryBasicMetadata',
+ props: {body: t('editor.review.notInitiated')},
+ },
+ ];
+ }
+ const {getCurrentReviewRound} = useSubmission();
+
+ const currentReviewRound = getCurrentReviewRound(
+ submission,
+ selectedStageId,
+ );
+
+ if (selectedReviewRound.round < currentReviewRound.round) {
+ items.push({
+ component: 'PrimaryBasicMetadata',
+ props: {
+ body: t(
+ 'editor.submission.workflowDecision.submission.reviewRound',
+ ),
+ },
+ });
+ }
+
+ if (selectedReviewRound.id === currentReviewRound.id) {
+ items.push({
+ component: 'ReviewRoundStatus',
+ props: {reviewRound: selectedReviewRound},
+ });
+ }
+
+ if (
+ getOpenReviewAssignmentsForRound(
+ submission.reviewAssignments,
+ selectedReviewRound.id,
+ ).length
+ ) {
+ items.push({
+ component: 'ReviewerManager',
+ props: {
+ submission: submission,
+ reviewRoundId: selectedReviewRound?.id,
+ redactedForAuthors: true,
+ },
+ });
+ }
+ items.push({
+ component: 'FileManager',
+ props: {
+ configName: 'WORKFLOW_REVIEW_REVISIONS',
+ submission: submission,
+ submissionStageId: submission.stageId,
+ reviewRoundId: selectedReviewRound?.id,
+ },
+ });
+
+ items.push({
+ component: 'DiscussionManager',
+ props: {
+ submissionId: submission.id,
+ stageId: selectedStageId,
+ },
+ });
+
+ return items;
+ },
+ },
+ [pkp.const.WORKFLOW_STAGE_ID_EDITING]: {
+ getPrimaryItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+
+ if (
+ hasSubmissionPassedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_EDITING,
+ )
+ ) {
+ items.push({
+ component: 'PrimaryBasicMetadata',
+ props: {
+ body: t('editor.submission.workflowDecision.submission.production'),
+ },
+ });
+ }
+
+ items.push({
+ component: 'DiscussionManager',
+ props: {
+ submissionId: submission.id,
+ stageId: selectedStageId,
+ },
+ });
+
+ items.push({
+ component: 'FileManager',
+ props: {
+ configName: 'COPYEDITED_FILES',
+ submission: submission,
+ submissionStageId: submission.stageId,
+ },
+ });
+
+ return items;
+ },
+ },
+ [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION]: {
+ getPrimaryItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+ if (submission.status === pkp.const.STATUS_PUBLISHED) {
+ items.push({
+ component: 'PrimaryBasicMetadata',
+ props: {
+ body: t('editor.submission.workflowDecision.submission.published'),
+ },
+ });
+ }
+
+ items.push({
+ component: 'WorkflowNotificationDisplay',
+ props: {submission: submission},
+ });
+
+ items.push({
+ component: 'DiscussionManager',
+ props: {
+ submissionId: submission.id,
+ stageId: selectedStageId,
+ },
+ });
+
+ return items;
+ },
+ },
+};
+
+export const PublicationConfig = {
+ common: {
+ getPrimaryItems: ({
+ submission,
+ selectedPublicationId,
+ selectedPublication,
+ }) => {
+ const items = [];
+ if (selectedPublication.status === pkp.const.STATUS_PUBLISHED) {
+ items.push({
+ component: 'PublicationEditDisabled',
+ props: {},
+ });
+ }
+ return items;
+ },
+ getPublicationControlsLeft: ({
+ submission,
+ selectedPublicationId,
+ selectedPublication,
+ }) => {
+ const items = [];
+
+ items.push({
+ component: 'PublicationVersionControl',
+ props: {
+ submission,
+ selectedPublicationId: selectedPublicationId,
+ },
+ });
+
+ return items;
+ },
+ getPublicationControlsRight: ({
+ submission,
+ selectedPublicationId,
+ selectedPublication,
+ }) => {
+ const items = [];
+ return items;
+ },
+ },
+ titleAbstract: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationForm',
+ props: {
+ formName: 'titleAbstract',
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+ contributors: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'ContributorManager',
+ props: {
+ submission: submission,
+ publication: selectedPublication,
+ contributorForm: pageInitConfig.contributorForm,
+ },
+ },
+ ];
+ },
+ },
+ metadata: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationForm',
+ props: {
+ formName: 'metadata',
+ submission,
+ publication: selectedPublication,
+ noFieldsMessage: 'No metadata fields are currently enabled.',
+ },
+ },
+ ];
+ },
+ },
+ citations: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationForm',
+ props: {
+ formName: 'reference',
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+ galleys: {
+ getPrimaryItems: ({submission, selectedPublication}) => {
+ return [
+ {
+ component: 'GalleyManager',
+ props: {
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+};
+
+export function useWorkflowAuthorConfig() {
+ function _getItems(
+ getterFnName,
+ {
+ selectedMenuState,
+ submission,
+ pageInitConfig,
+ selectedPublication,
+ selectedPublicationId,
+ selectedReviewRound,
+ },
+ ) {
+ if (selectedMenuState.stageId) {
+ const itemsArgs = {
+ submission,
+ selectedPublication,
+ selectedPublicationId,
+ selectedStageId: selectedMenuState.stageId,
+ selectedReviewRound,
+ };
+ if (!submission) {
+ return [];
+ }
+ return [
+ ...(WorkflowConfig?.common?.[getterFnName]?.(itemsArgs) || []),
+ ...(WorkflowConfig[selectedMenuState.stageId]?.[getterFnName]?.(
+ itemsArgs,
+ ) || []),
+ ];
+ } else if (selectedMenuState.publicationMenu) {
+ const itemsArgs = {
+ submission,
+ pageInitConfig: pageInitConfig,
+ selectedPublication,
+ selectedPublicationId,
+ };
+ if (!submission || !selectedPublication) {
+ return [];
+ }
+
+ return [
+ ...(PublicationConfig?.common?.[getterFnName]?.(itemsArgs) || []),
+ ...(PublicationConfig[selectedMenuState.publicationMenu]?.[
+ getterFnName
+ ]?.(itemsArgs) || []),
+ ];
+ }
+ }
+
+ function getPrimaryItems(args) {
+ return _getItems('getPrimaryItems', args);
+ }
+
+ function getSecondaryItems(args) {
+ return _getItems('getSecondaryItems', args);
+ }
+
+ function getActionItems(args) {
+ return _getItems('getActionItems', args);
+ }
+
+ function getPublicationControlsLeft(args) {
+ return _getItems('getPublicationControlsLeft', args);
+ }
+
+ function getPublicationControlsRight(args) {
+ return _getItems('getPublicationControlsRight', args);
+ }
+
+ return {
+ getHeaderItems,
+ getPrimaryItems,
+ getSecondaryItems,
+ getActionItems,
+ getPublicationControlsLeft,
+ getPublicationControlsRight,
+ };
+}
diff --git a/src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowEditorialConfig.js b/src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowEditorialConfig.js
new file mode 100644
index 000000000..9a8321b88
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowEditorialConfig.js
@@ -0,0 +1,774 @@
+import {useLocalize} from '@/composables/useLocalize';
+import {Actions} from '../../composables/useWorkflowActions';
+import {useSubmission} from '@/composables/useSubmission';
+import {Actions as WorkflowActions} from '../../composables/useWorkflowActions';
+import {Actions as DecisionActions} from '../../composables/useWorkflowDecisions';
+
+const {hasSubmissionPassedStage, hasNotSubmissionStartedStage, getStageById} =
+ useSubmission();
+const {t} = useLocalize();
+
+function getHeaderItems({
+ submission,
+ selectedPublication,
+ publicationSettings,
+}) {
+ if (!submission) {
+ return [];
+ }
+ const {t} = useLocalize();
+ const actions = [];
+
+ if (publicationSettings.submissionPaymentsEnabled) {
+ actions.push({
+ component: 'WorkflowPaymentDropdown',
+ props: {submission, selectedPublication},
+ });
+ }
+
+ actions.push({
+ component: 'ActionButton',
+ props: {
+ label: t('editor.activityLog'),
+ action: Actions.WORKFLOW_VIEW_ACTIVITY_LOG,
+ },
+ });
+ actions.push({
+ component: 'ActionButton',
+ props: {
+ label: t('editor.submissionLibrary'),
+ action: Actions.WORKFLOW_VIEW_LIBRARY,
+ },
+ });
+
+ return actions;
+}
+
+export const WorkflowConfig = {
+ common: {
+ getSecondaryItems: ({submission, selectedReviewRound, selectedStageId}) => {
+ const items = [];
+ // When review stage has not started, show no items
+ if (selectedStageId === pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW) {
+ if (!selectedReviewRound) {
+ return [];
+ }
+ }
+
+ items.push({
+ component: 'ParticipantManager',
+ props: {
+ submission,
+ submissionStageId: submission.stageId,
+ },
+ });
+
+ return items;
+ },
+ },
+ [pkp.const.WORKFLOW_STAGE_ID_SUBMISSION]: {
+ getPrimaryItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+
+ if (
+ hasSubmissionPassedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
+ )
+ ) {
+ items.push({component: 'SubmissionStatus', props: {submission}});
+ }
+
+ items.push({
+ component: 'FileManager',
+ props: {
+ configName: 'SUBMISSION_FILES',
+ submission: submission,
+ submissionStageId: submission.stageId,
+ },
+ });
+
+ items.push({
+ component: 'DiscussionManager',
+ props: {submissionId: submission.id, stageId: selectedStageId},
+ });
+
+ return items;
+ },
+ getActionItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+ if (
+ hasSubmissionPassedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
+ )
+ ) {
+ return [];
+ }
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.sendSubmissionForReview'),
+ isPrimary: true,
+ action: DecisionActions.DECISION_EXTERNAL_REVIEW,
+ },
+ });
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.acceptAndSkipReview'),
+ isSecondary: true,
+ action: DecisionActions.DECISION_SKIP_EXTERNAL_REVIEW,
+ },
+ });
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.declineSubmission'),
+ isWarnable: true,
+ action: DecisionActions.DECISION_INITIAL_DECLINE,
+ },
+ });
+ return items;
+ },
+ },
+
+ [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW]: {
+ getPrimaryItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+ if (!selectedReviewRound) {
+ return [
+ {
+ component: 'PrimaryBasicMetadata',
+ props: {body: t('editor.review.notInitiated')},
+ },
+ ];
+ }
+ const {getCurrentReviewRound} = useSubmission();
+
+ const currentReviewRound = getCurrentReviewRound(
+ submission,
+ selectedStageId,
+ );
+
+ if (selectedReviewRound.round < currentReviewRound.round) {
+ items.push({
+ component: 'PrimaryBasicMetadata',
+ props: {
+ body: t(
+ 'editor.submission.workflowDecision.submission.reviewRound',
+ ),
+ },
+ });
+ }
+
+ if (selectedReviewRound.id === currentReviewRound.id) {
+ items.push({
+ component: 'ReviewRoundStatus',
+ props: {reviewRound: selectedReviewRound},
+ });
+ }
+
+ items.push({
+ component: 'FileManager',
+ props: {
+ configName: 'WORKFLOW_REVIEW_REVISIONS',
+ submission: submission,
+ submissionStageId: submission.stageId,
+ reviewRoundId: selectedReviewRound?.id,
+ },
+ });
+
+ items.push({
+ component: 'FileManager',
+ props: {
+ configName: 'EDITOR_REVIEW_FILES',
+ submission: submission,
+ submissionStageId: submission.stageId,
+ reviewRoundId: selectedReviewRound?.id,
+ },
+ });
+
+ items.push({
+ component: 'ReviewerManager',
+ props: {
+ submission: submission,
+ reviewRoundId: selectedReviewRound?.id,
+ },
+ });
+
+ items.push({
+ component: 'DiscussionManager',
+ props: {
+ submissionId: submission.id,
+ stageId: selectedStageId,
+ },
+ });
+
+ return items;
+ },
+ getActionItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+ const {getCurrentReviewRound} = useSubmission();
+
+ const currentReviewRound = getCurrentReviewRound(
+ submission,
+ selectedStageId,
+ );
+
+ // if review stage has not started show no items
+ if (
+ hasNotSubmissionStartedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ ) ||
+ hasSubmissionPassedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ ) ||
+ selectedReviewRound.round < currentReviewRound.round
+ ) {
+ return [];
+ }
+
+ const selectedStage = getStageById(submission, selectedStageId);
+
+ const isRecommendOnlyEditor = selectedStage.currentUserCanRecommendOnly;
+ if (isRecommendOnlyEditor) {
+ items.push({
+ component: 'WorkflowRecommendationControls',
+ props: {
+ stageId: pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ reviewRoundId: selectedReviewRound.id,
+ },
+ });
+ } else {
+ const actionArgs = {
+ stageId: pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ reviewRoundId: selectedReviewRound.id,
+ };
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.requestRevisions'),
+ isSecondary: true,
+ action: WorkflowActions.WORKFLOW_REQUEST_REVISION,
+ actionArgs,
+ },
+ });
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.acceptSubmission'),
+ action: DecisionActions.DECISION_ACCEPT,
+ isPrimary: true,
+ actionArgs,
+ },
+ });
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('editor.submission.createNewRound'),
+ action: DecisionActions.DECISION_NEW_EXTERNAL_ROUND,
+ actionArgs,
+ },
+ });
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.cancelReviewRound'),
+ isWarnable: true,
+ action: DecisionActions.DECISION_CANCEL_REVIEW_ROUND,
+ },
+ });
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.declineSubmission'),
+ isWarnable: true,
+ action: DecisionActions.DECISION_DECLINE_SUBMISSION,
+ },
+ });
+ }
+ return items;
+ },
+ },
+ [pkp.const.WORKFLOW_STAGE_ID_EDITING]: {
+ getPrimaryItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+
+ if (
+ hasSubmissionPassedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_EDITING,
+ )
+ ) {
+ items.push({
+ component: 'PrimaryBasicMetadata',
+ props: {
+ body: t('editor.submission.workflowDecision.submission.production'),
+ },
+ });
+ }
+
+ items.push({
+ component: 'FileManager',
+ props: {
+ configName: 'FINAL_DRAFT_FILES',
+ submission: submission,
+ submissionStageId: submission.stageId,
+ },
+ });
+
+ items.push({
+ component: 'DiscussionManager',
+ props: {
+ submissionId: submission.id,
+ stageId: selectedStageId,
+ },
+ });
+
+ items.push({
+ component: 'FileManager',
+ props: {
+ configName: 'COPYEDITED_FILES',
+ submission: submission,
+ submissionStageId: submission.stageId,
+ },
+ });
+
+ return items;
+ },
+ getActionItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+ if (
+ hasNotSubmissionStartedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_EDITING,
+ ) ||
+ hasSubmissionPassedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_EDITING,
+ )
+ ) {
+ return [];
+ }
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.sendToProduction'),
+ isPrimary: true,
+ action: DecisionActions.DECISION_SEND_TO_PRODUCTION,
+ },
+ });
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.cancelCopyEditing'),
+ isWarnable: true,
+ action: DecisionActions.DECISION_BACK_FROM_COPYEDITING,
+ },
+ });
+
+ return items;
+ },
+ },
+ [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION]: {
+ getPrimaryItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+ if (submission.status === pkp.const.STATUS_PUBLISHED) {
+ items.push({
+ component: 'PrimaryBasicMetadata',
+ props: {
+ body: t('editor.submission.workflowDecision.submission.published'),
+ },
+ });
+ }
+
+ items.push({
+ component: 'WorkflowNotificationDisplay',
+ props: {submission: submission},
+ });
+
+ items.push({
+ component: 'FileManager',
+ props: {
+ configName: 'PRODUCTION_READY_FILES',
+ submission: submission,
+ submissionStageId: submission.stageId,
+ },
+ });
+
+ items.push({
+ component: 'DiscussionManager',
+ props: {
+ submissionId: submission.id,
+ stageId: selectedStageId,
+ },
+ });
+
+ return items;
+ },
+ getActionItems: ({submission, selectedStageId, selectedReviewRound}) => {
+ const items = [];
+ if (
+ hasNotSubmissionStartedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
+ ) ||
+ hasSubmissionPassedStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
+ )
+ ) {
+ return [];
+ }
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('editor.submission.schedulePublication'),
+ isPrimary: true,
+ action: 'navigateToMenu',
+ actionArgs: {key: 'publication_titleAbstract'},
+ },
+ });
+
+ if (submission.status === pkp.const.STATUS_QUEUED) {
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.backToCopyediting'),
+ isWarnable: true,
+ action: DecisionActions.DECISION_BACK_FROM_PRODUCTION,
+ },
+ });
+ }
+
+ return items;
+ },
+ },
+};
+
+export const PublicationConfig = {
+ common: {
+ getPrimaryItems: ({
+ submission,
+ selectedPublicationId,
+ selectedPublication,
+ }) => {
+ const items = [];
+ if (selectedPublication.status === pkp.const.STATUS_PUBLISHED) {
+ items.push({
+ component: 'PublicationEditDisabled',
+ props: {},
+ });
+ }
+ return items;
+ },
+ getPublicationControlsLeft: ({
+ submission,
+ selectedPublicationId,
+ selectedPublication,
+ }) => {
+ const items = [];
+
+ items.push({
+ component: 'PublicationVersionControl',
+ props: {
+ submission,
+ selectedPublicationId: selectedPublicationId,
+ },
+ });
+
+ return items;
+ },
+ getPublicationControlsRight: ({
+ submission,
+ selectedPublicationId,
+ selectedPublication,
+ }) => {
+ const items = [];
+ const {t} = useLocalize();
+
+ if (selectedPublication.status === pkp.const.STATUS_QUEUED) {
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.preview'),
+ isSecondary: true,
+ action: Actions.WORKFLOW_PREVIEW_PUBLICATION,
+ },
+ });
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('editor.submission.schedulePublication'),
+ isSecondary: true,
+ action:
+ Actions.WORKFLOW_ASSIGN_TO_ISSUE_AND_SCHEDULE_FOR_PUBLICATION,
+ },
+ });
+ } else if (selectedPublication.status === pkp.const.STATUS_SCHEDULED) {
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('dashboard.summary.preview'),
+ isSecondary: true,
+ action: Actions.WORKFLOW_PREVIEW_PUBLICATION,
+ },
+ });
+
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('publication.unschedule'),
+ isWarnable: true,
+ action: Actions.WORKFLOW_UNSCHEDULE_PUBLICATION,
+ },
+ });
+ } else if (selectedPublication.status === pkp.const.STATUS_PUBLISHED) {
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('publication.unpublish'),
+ isWarnable: true,
+ action: Actions.WORKFLOW_UNPUBLISH_PUBLICATION,
+ },
+ });
+
+ const {getLatestPublication} = useSubmission();
+ const latestPublication = getLatestPublication(submission);
+
+ if (latestPublication.id === selectedPublication.id) {
+ items.push({
+ component: 'ActionButton',
+ props: {
+ label: t('publication.createVersion'),
+ isSecondary: true,
+ action: Actions.WORKFLOW_CREATE_NEW_VERSION,
+ },
+ });
+ }
+ }
+
+ return items;
+ },
+ },
+ titleAbstract: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationForm',
+ props: {
+ formName: 'titleAbstract',
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+ contributors: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'ContributorManager',
+ props: {
+ submission: submission,
+ publication: selectedPublication,
+ contributorForm: pageInitConfig.contributorForm,
+ },
+ },
+ ];
+ },
+ },
+ metadata: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationForm',
+ props: {
+ formName: 'metadata',
+ submission,
+ publication: selectedPublication,
+ noFieldsMessage: 'No metadata fields are currently enabled.',
+ },
+ },
+ ];
+ },
+ },
+ citations: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationForm',
+ props: {
+ formName: 'reference',
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+ identifiers: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationForm',
+ props: {
+ formName: 'identifier',
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+ jats: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationJats',
+ props: {
+ canEditPublication: true,
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+ galleys: {
+ getPrimaryItems: ({submission, selectedPublication}) => {
+ return [
+ {
+ component: 'GalleyManager',
+ props: {
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+ license: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationForm',
+ props: {
+ formName: 'permissionDisclosure',
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+ issue: {
+ getPrimaryItems: ({submission, selectedPublication, pageInitConfig}) => {
+ return [
+ {
+ component: 'PublicationForm',
+ props: {
+ formName: 'issue',
+ submission,
+ publication: selectedPublication,
+ },
+ },
+ ];
+ },
+ },
+};
+
+export function useWorkflowEditorialConfig() {
+ function _getItems(
+ getterFnName,
+ {
+ selectedMenuState,
+ submission,
+ pageInitConfig,
+ selectedPublication,
+ selectedPublicationId,
+ selectedReviewRound,
+ },
+ ) {
+ if (selectedMenuState.stageId) {
+ const itemsArgs = {
+ submission,
+ selectedPublication,
+ selectedPublicationId,
+ selectedStageId: selectedMenuState.stageId,
+ selectedReviewRound,
+ };
+ if (!submission) {
+ return [];
+ }
+ return [
+ ...(WorkflowConfig?.common?.[getterFnName]?.(itemsArgs) || []),
+ ...(WorkflowConfig[selectedMenuState.stageId]?.[getterFnName]?.(
+ itemsArgs,
+ ) || []),
+ ];
+ } else if (selectedMenuState.publicationMenu) {
+ const itemsArgs = {
+ submission,
+ pageInitConfig: pageInitConfig,
+ selectedPublication,
+ selectedPublicationId,
+ };
+ if (!submission || !selectedPublication) {
+ return [];
+ }
+
+ return [
+ ...(PublicationConfig?.common?.[getterFnName]?.(itemsArgs) || []),
+ ...(PublicationConfig[selectedMenuState.publicationMenu]?.[
+ getterFnName
+ ]?.(itemsArgs) || []),
+ ];
+ }
+ }
+
+ function getPrimaryItems(args) {
+ return _getItems('getPrimaryItems', args);
+ }
+
+ function getSecondaryItems(args) {
+ return _getItems('getSecondaryItems', args);
+ }
+
+ function getActionItems(args) {
+ return _getItems('getActionItems', args);
+ }
+
+ function getPublicationControlsLeft(args) {
+ return _getItems('getPublicationControlsLeft', args);
+ }
+
+ function getPublicationControlsRight(args) {
+ return _getItems('getPublicationControlsRight', args);
+ }
+
+ return {
+ getHeaderItems,
+ getPrimaryItems,
+ getSecondaryItems,
+ getActionItems,
+ getPublicationControlsLeft,
+ getPublicationControlsRight,
+ };
+}
diff --git a/src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowNavigationConfig.js b/src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowNavigationConfig.js
new file mode 100644
index 000000000..c3fbda9d3
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/composables/useWorkflowNavigationConfig.js
@@ -0,0 +1,340 @@
+import {useSubmission} from '@/composables/useSubmission';
+import {useLocalize} from '@/composables/useLocalize';
+import {DashboardPageTypes} from '@/pages/dashboard/dashboardPageStore';
+export function useWorkflowNavigationConfig(pageInitConfig) {
+ const {publicationSettings} = pageInitConfig;
+ const {t, tk} = useLocalize();
+
+ function getWorkflowTitle(stageId) {
+ const StageTitles = {
+ [pkp.const.WORKFLOW_STAGE_ID_SUBMISSION]: tk(
+ 'dashboard.stage.submission',
+ ),
+ [pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW]: tk(
+ 'dashboard.stage.review',
+ ),
+ [pkp.const.WORKFLOW_STAGE_ID_EDITING]: tk('dashboard.stage.copyediting'),
+ [pkp.const.WORKFLOW_STAGE_ID_PRODUCTION]: tk(
+ 'dashboard.stage.production',
+ ),
+ };
+
+ return `${t('semicolon', {label: t('manager.workflow')})} ${t(StageTitles[stageId])} `;
+ }
+
+ function getPublicationTitle(publicationMenuTitle) {
+ return `${t('semicolon', {label: t('submission.publication')})} ${publicationMenuTitle}`;
+ }
+
+ function getReviewItems(submission) {
+ const {getActiveStage, getCurrentReviewRound} = useSubmission();
+
+ const activeStage = getActiveStage(submission);
+
+ const activeReviewRound = getCurrentReviewRound(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ );
+
+ const reviewMenuItems = [];
+
+ const {getReviewRoundsForStage} = useSubmission();
+ const reviewRounds = getReviewRoundsForStage(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ );
+
+ reviewRounds.forEach((reviewRound, index) => {
+ reviewMenuItems.push({
+ key: `workflow_${pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW}_${reviewRound.id}`,
+ label: `Review Round ${index + 1}`,
+ colorStripe:
+ (activeStage.id === pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW &&
+ activeReviewRound.id) === reviewRound.id
+ ? 'border-stage-in-review'
+ : null,
+
+ action: 'selectStage',
+ actionArgs: {
+ reviewRoundId: reviewRound.id,
+ stageId: pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ title: getWorkflowTitle(pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW),
+ },
+ });
+ });
+
+ /*if (submission.stageId === pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW) {
+ reviewMenuItems.push({
+ label: 'New Review Round',
+ action: 'decisionNewExternalRound',
+ actionArgs: {
+ reviewRoundId: getCurrentReviewRound(
+ submission,
+ pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ ).id,
+ stageId: pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ },
+ });
+ }*/
+
+ return reviewMenuItems;
+ }
+
+ function getWorkflowItems(submission) {
+ const {getActiveStage} = useSubmission();
+
+ const activeStage = getActiveStage(submission);
+
+ const externalReviewItems = getReviewItems(submission);
+ return [
+ {
+ key: `workflow_${pkp.const.WORKFLOW_STAGE_ID_SUBMISSION}`,
+ label: 'Submission',
+ colorStripe:
+ activeStage.id === pkp.const.WORKFLOW_STAGE_ID_SUBMISSION
+ ? 'border-stage-desk-review'
+ : null,
+ action: 'selectStage',
+ actionArgs: {
+ stageId: pkp.const.WORKFLOW_STAGE_ID_SUBMISSION,
+ title: getWorkflowTitle(pkp.const.WORKFLOW_STAGE_ID_SUBMISSION),
+ },
+ },
+ {
+ key: `workflow_${pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW}`,
+ label: 'Review',
+ colorStripe:
+ activeStage.id === pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW
+ ? 'border-stage-in-review'
+ : null,
+
+ items: externalReviewItems,
+ action: !externalReviewItems.length ? 'selectStage' : undefined,
+ actionArgs: !externalReviewItems.length
+ ? {
+ stageId: pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ title: getWorkflowTitle(
+ pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ ),
+ }
+ : undefined,
+ },
+ {
+ key: `workflow_${pkp.const.WORKFLOW_STAGE_ID_EDITING}`,
+ label: 'Copyediting',
+ title: getWorkflowTitle(pkp.const.WORKFLOW_STAGE_ID_EDITING),
+ colorStripe:
+ activeStage.id === pkp.const.WORKFLOW_STAGE_ID_EDITING
+ ? 'border-stage-copyediting'
+ : null,
+ action: 'selectStage',
+ actionArgs: {
+ stageId: pkp.const.WORKFLOW_STAGE_ID_EDITING,
+ title: getWorkflowTitle(pkp.const.WORKFLOW_STAGE_ID_EDITING),
+ },
+ },
+ {
+ key: `workflow_${pkp.const.WORKFLOW_STAGE_ID_PRODUCTION}`,
+ label: 'Production',
+ title: getWorkflowTitle(pkp.const.WORKFLOW_STAGE_ID_PRODUCTION),
+ colorStripe:
+ activeStage.id === pkp.const.WORKFLOW_STAGE_ID_PRODUCTION &&
+ submission.status === pkp.const.STATUS_QUEUED
+ ? 'border-stage-copyediting'
+ : null,
+ action: 'selectStage',
+ actionArgs: {
+ stageId: pkp.const.WORKFLOW_STAGE_ID_PRODUCTION,
+ title: getWorkflowTitle(pkp.const.WORKFLOW_STAGE_ID_PRODUCTION),
+ },
+ },
+ ];
+ }
+
+ function getPublicationItemsAuthor(submission) {
+ const items = [];
+
+ items.push({
+ key: 'publication_titleAbstract',
+ label: t('publication.titleAbstract'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'titleAbstract',
+ title: getPublicationTitle(t('publication.titleAbstract')),
+ },
+ });
+
+ items.push({
+ key: 'publication_contributors',
+ label: t('publication.contributors'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'contributors',
+ title: getPublicationTitle(t('publication.contributors')),
+ },
+ });
+
+ items.push({
+ key: 'publication_metadata',
+ label: t('article.metadata'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'metadata',
+ title: getPublicationTitle(t('article.metadata')),
+ },
+ });
+
+ if (publicationSettings.supportsCitations) {
+ items.push({
+ key: 'citations',
+ label: t('submission.citations'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'citations',
+ title: getPublicationTitle(t('submission.citations')),
+ },
+ });
+ }
+
+ // TODO: REAL VALUE
+ const canAccessProductionStage = true;
+ if (canAccessProductionStage) {
+ items.push({
+ key: 'galleys',
+ label: t('submission.layout.galleys'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'galleys',
+ title: getPublicationTitle(t('submission.layout.galleys')),
+ },
+ });
+ }
+
+ return items;
+ }
+
+ function getPublicationItemsEditorial(submission) {
+ const items = [];
+
+ items.push({
+ key: 'publication_titleAbstract',
+ label: t('publication.titleAbstract'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'titleAbstract',
+ title: getPublicationTitle(t('publication.titleAbstract')),
+ },
+ });
+
+ items.push({
+ key: 'publication_contributors',
+ label: t('publication.contributors'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'contributors',
+ title: getPublicationTitle(t('publication.contributors')),
+ },
+ });
+
+ items.push({
+ key: 'publication_metadata',
+ label: t('article.metadata'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'metadata',
+ title: getPublicationTitle(t('article.metadata')),
+ },
+ });
+
+ if (publicationSettings.supportsCitations) {
+ items.push({
+ key: 'citations',
+ label: t('submission.citations'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'citations',
+ title: getPublicationTitle(t('submission.citations')),
+ },
+ });
+ }
+
+ if (publicationSettings.identifiersEnabled) {
+ items.push({
+ key: 'identifiers',
+ label: t('submission.identifiers'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'identifiers',
+ title: getPublicationTitle(t('submission.identifiers')),
+ },
+ });
+ }
+
+ items.push({
+ key: 'jats',
+ label: t('publication.jats'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'jats',
+ title: getPublicationTitle(t('publication.jats')),
+ },
+ });
+
+ items.push({
+ key: 'galleys',
+ label: t('submission.layout.galleys'),
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'galleys',
+ title: getPublicationTitle(t('submission.layout.galleys')),
+ },
+ });
+
+ items.push({
+ label: t('publication.publicationLicense'),
+ key: 'license',
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'license',
+ title: getPublicationTitle(t('publication.publicationLicense')),
+ },
+ });
+
+ items.push({
+ label: t('issue.issue'),
+ key: 'issue',
+ action: 'selectPublicationMenu',
+ actionArgs: {
+ publicationMenu: 'issue',
+ title: getPublicationTitle(t('issue.issue')),
+ },
+ });
+
+ return items;
+ }
+
+ function getMenuItems(submission) {
+ const menuItems = [
+ {
+ key: 'workflow',
+ label: 'Workflow',
+ icon: 'Dashboard',
+ items: getWorkflowItems(submission),
+ },
+ {
+ key: 'publication',
+ label: 'Publication',
+ icon: 'MySubmissions',
+ items:
+ pageInitConfig.dashboardPage ===
+ DashboardPageTypes.EDITORIAL_DASHBOARD
+ ? getPublicationItemsEditorial(submission)
+ : getPublicationItemsAuthor(submission),
+ },
+ ];
+
+ return menuItems;
+ }
+
+ return {getMenuItems};
+}
diff --git a/src/pages/dashboard/SubmissionSummaryModal/metaItems/EditorsAssigned.vue b/src/pages/dashboard/SubmissionSummaryModal/metaItems/EditorsAssigned.vue
deleted file mode 100644
index d82c592c5..000000000
--- a/src/pages/dashboard/SubmissionSummaryModal/metaItems/EditorsAssigned.vue
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
- {{ t('dashboard.summary.editorsAssigned') }}:
-
-
- -
-
-
-
-
-
-
{{ editor.fullName }}
-
- {{ editor.roleName }}
-
-
-
-
-
-
- summaryStore.handleAction('assignParticipant')"
- >
- Assign Editors
-
-
-
-
-
diff --git a/src/pages/dashboard/SubmissionSummaryModal/primaryItems/LastActivity.vue b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/LastActivity.vue
deleted file mode 100644
index b90c7333e..000000000
--- a/src/pages/dashboard/SubmissionSummaryModal/primaryItems/LastActivity.vue
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
summaryStore.handleAction('viewActivityLog', {})">
- {{ t('dashboard.summary.viewActivityLog') }}
-
-
-
-
-
diff --git a/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PrimaryBasicMetadata.vue b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PrimaryBasicMetadata.vue
index edc3a336c..a5c0b4bf9 100644
--- a/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PrimaryBasicMetadata.vue
+++ b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PrimaryBasicMetadata.vue
@@ -1,7 +1,7 @@
-
{{ heading }}
-
{{ body }}
+
{{ heading }}
+
{{ body }}
diff --git a/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PublicationForm.vue b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PublicationForm.vue
new file mode 100644
index 000000000..76a08dd13
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PublicationForm.vue
@@ -0,0 +1,56 @@
+
+
+ {{ noFieldsMessage }}
+
+
+
+
+
diff --git a/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PublicationJats.vue b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PublicationJats.vue
new file mode 100644
index 000000000..f7c5bab8c
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/PublicationJats.vue
@@ -0,0 +1,369 @@
+
+
+
+
+
+
+
+
+ {{ workingJatsProps['loadingContentError'] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/dashboard/SubmissionSummaryModal/primaryItems/ReviewRoundStatus.vue b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/ReviewRoundStatus.vue
new file mode 100644
index 000000000..79d44f948
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/ReviewRoundStatus.vue
@@ -0,0 +1,17 @@
+
+
+
+ {{ t('notification.type.roundStatusTitle', {round: reviewRound.round}) }}
+
+
{{ props.reviewRound.status }}
+
+
+
+
diff --git a/src/pages/dashboard/SubmissionSummaryModal/primaryItems/SubmissionStatus.vue b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/SubmissionStatus.vue
new file mode 100644
index 000000000..61fc8a2bf
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/SubmissionStatus.vue
@@ -0,0 +1,40 @@
+
+
+
{{ texts.heading }}
+
{{ texts.description }}
+
+
+
+
diff --git a/src/pages/dashboard/SubmissionSummaryModal/primaryItems/WorkflowNotificationDisplay.vue b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/WorkflowNotificationDisplay.vue
new file mode 100644
index 000000000..1a0098a4b
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/primaryItems/WorkflowNotificationDisplay.vue
@@ -0,0 +1,87 @@
+
+
+ {{ notification.text }}
+
+
+
diff --git a/src/pages/dashboard/SubmissionSummaryModal/publicationControls/PublicationVersionControl.vue b/src/pages/dashboard/SubmissionSummaryModal/publicationControls/PublicationVersionControl.vue
new file mode 100644
index 000000000..b77bb227e
--- /dev/null
+++ b/src/pages/dashboard/SubmissionSummaryModal/publicationControls/PublicationVersionControl.vue
@@ -0,0 +1,66 @@
+
+
+
+ {{ t('semicolon', {label: t('submission.versions')}) }}
+
+
+ {{ submission.publications.length }}
+
+
+
+
+
+
+
diff --git a/src/pages/dashboard/SubmissionSummaryModal/submissionSummaryStore.js b/src/pages/dashboard/SubmissionSummaryModal/submissionSummaryStore.js
index 8ba2981d7..dbe22fa7f 100644
--- a/src/pages/dashboard/SubmissionSummaryModal/submissionSummaryStore.js
+++ b/src/pages/dashboard/SubmissionSummaryModal/submissionSummaryStore.js
@@ -1,26 +1,34 @@
-import {computed, watch} from 'vue';
+import {computed, ref, watch} from 'vue';
import {defineComponentStore} from '@/utils/defineComponentStore';
-import {useSummaryConfig} from './composables/useSummaryConfig';
import {useFetch} from '@/composables/useFetch';
import {useUrl} from '@/composables/useUrl';
-import {useParticipant} from '@/composables/useParticipant';
-import {useHandleActions} from '../composables/useHandleActions';
-import {useLocalize} from '@/composables/useLocalize';
-import {useDataChanged} from '@/composables/useDataChanged';
+import {
+ useWorkflowActions,
+ Actions as WorkflowActions,
+} from '../composables/useWorkflowActions';
+
+import {
+ useWorkflowDecisions,
+ Actions as DecisionActions,
+} from '../composables/useWorkflowDecisions';
+
import {DashboardPageTypes} from '../dashboardPageStore';
+import {useWorkflowEditorialConfig} from './composables/useWorkflowEditorialConfig';
+import {useWorkflowAuthorConfig} from './composables/useWorkflowAuthorConfig';
+
+import {useDataChangedProvider} from '@/composables/useDataChangedProvider';
+import {useWorkflowNavigationConfig} from './composables/useWorkflowNavigationConfig';
+import {useSubmission} from '@/composables/useSubmission';
+import {useSideMenu} from '@/composables/useSideMenu';
+
export const useSubmissionSummaryStore = defineComponentStore(
'submissionSummary',
(props) => {
const dashboardPage = props.pageInitConfig.dashboardPage;
- const {localize} = useLocalize();
-
- /**
- * Data changes tracking
- */
- const {registerDataChangeCallback, triggerDataChange} = useDataChanged();
+ const {getReviewRound, getCurrentReviewRound} = useSubmission();
/**
* Fetch submission details
@@ -31,140 +39,246 @@ export const useSubmissionSummaryStore = defineComponentStore(
const {data: submission, fetch: fetchSubmission} =
useFetch(submissionApiUrl);
- const selectedReviewAssignment = computed(() => {
- return (
- submission.value?.reviewAssignments?.find(
- (reviewAssignment) =>
- reviewAssignment.id === props.reviewAssignmentId,
- ) || null
- );
- });
-
/** Fetch publications */
- const currentPublicationUrlRelative = computed(
+ const selectedPublicationId = ref(null);
+ function selectPublicationId(publicationId) {
+ if (selectedPublicationId.value !== publicationId) {
+ selectedPublicationId.value = publicationId;
+ selectedPublication.value = null;
+ fetchSelectedPublication();
+ }
+ }
+ const selectedPublicationUrlRelative = computed(
() =>
- `submissions/${encodeURIComponent(props.submissionId)}/publications/${submission.value?.currentPublicationId}`,
- );
- const {apiUrl: currentPublicationUrl} = useUrl(
- currentPublicationUrlRelative,
+ `submissions/${encodeURIComponent(props.submissionId)}/publications/${selectedPublicationId.value}`,
);
- const {data: currentPublication, fetch: fetchCurrentPublication} = useFetch(
- currentPublicationUrl,
+ const {apiUrl: selectedPublicationUrl} = useUrl(
+ selectedPublicationUrlRelative,
);
+ const {data: selectedPublication, fetch: fetchSelectedPublication} =
+ useFetch(selectedPublicationUrl);
- /** Current publication is fetched always when the new submission is fetched */
- watch(submission, () => {
- fetchCurrentPublication();
+ /**
+ * Data changes tracking
+ */
+ const {triggerDataChange} = useDataChangedProvider(() => {
+ return Promise.all([fetchSubmission(), fetchSelectedPublication()]);
});
- /** Fetch issue */
- const issueUrlRelative = computed(
- () => `issues/${currentPublication.value?.issueId}`,
- );
- const {apiUrl: issueUrl} = useUrl(issueUrlRelative);
- const {data: issue, fetch: fetchIssue} = useFetch(issueUrl);
+ /** Current publication is fetched always when the new submission is fetched */
+ watch(submission, (newSubmission, oldSubmission) => {
+ // Once the submission is fetched, select relevant stage in navigaton
+ if (!oldSubmission && newSubmission) {
+ selectedPublicationId.value =
+ newSubmission.publications[newSubmission.publications.length - 1].id;
+ fetchSelectedPublication();
- watch(currentPublication, () => {
- if (currentPublication.value?.issueId) {
- fetchIssue();
+ if (
+ newSubmission.stageId === pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW
+ ) {
+ setActiveItemKey(
+ `workflow_${newSubmission.stageId}_${
+ getCurrentReviewRound(
+ newSubmission,
+ pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
+ )?.id
+ }`,
+ );
+ } else if (
+ newSubmission.stageId === pkp.const.WORKFLOW_STAGE_ID_PRODUCTION &&
+ newSubmission.status !== pkp.const.STATUS_QUEUED
+ ) {
+ setActiveItemKey(`publication_titleAbstract`);
+ } else {
+ setActiveItemKey(`workflow_${newSubmission.stageId}`);
+ }
}
});
+ fetchSubmission();
+
/**
- * Fetch submission participants
+ * Handling navigation
*/
- const {apiUrl: participantApiUrl} = useUrl(
- `submissions/${encodeURIComponent(props.submissionId)}/participants`,
- );
- const {data: participants, fetch: fetchParticipants} =
- useFetch(participantApiUrl);
-
- function fetchAll() {
- fetchSubmission();
- // TOOD consider whether this might be better to fetch within components that needs it
- if (dashboardPage === DashboardPageTypes.EDITORIAL_DASHBOARD) {
- fetchParticipants();
+ const {getMenuItems} = useWorkflowNavigationConfig(props.pageInitConfig);
+ const menuItems = computed(() => {
+ if (!submission.value) {
+ return [];
}
- triggerDataChange();
- }
+ return getMenuItems(submission.value);
+ });
- fetchAll();
+ function navigateToMenu({key}) {
+ setActiveItemKey(key);
+ return;
+ }
const {
- getEditorRoleIds,
- hasParticipantAtLeastOneRole,
- getFirstGroupWithFollowingRoles,
- } = useParticipant();
-
- /** TODO: Might be moved directly to the component? */
- const associatedEditors = computed(() => {
- if (!participants.value) {
- return [];
- }
+ sideMenuProps,
+ setExpandedKeys,
+ setActiveItemKey,
+ selectedItem: selectedMenuItem,
+ } = useSideMenu(menuItems);
- return participants.value
- .filter((participant) =>
- hasParticipantAtLeastOneRole(participant, getEditorRoleIds()),
- )
- .map((participant) => ({
- id: participant.id,
- fullName: participant.fullName,
- roleName: localize(
- getFirstGroupWithFollowingRoles(participant, getEditorRoleIds())
- .name,
- ),
- }));
+ const selectedMenuState = computed(() => {
+ return selectedMenuItem.value?.actionArgs || {};
});
- /**
- * Handle user actions
- *
- */
- const {handleSubmissionAction} = useHandleActions(props.pageInitConfig);
+ setExpandedKeys([
+ 'workflow',
+ 'publication',
+ `workflow_${pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW}`,
+ ]);
- function handleAction(actionName, _actionArgs) {
- const actionArgs = {..._actionArgs};
- if (selectedReviewAssignment.value) {
- actionArgs.reviewAssignmentId = selectedReviewAssignment.value.id;
+ const selectedReviewRound = computed(() => {
+ if (!selectedMenuState.value.reviewRoundId) {
+ return null;
}
- handleSubmissionAction(
+ const reviewRound = getReviewRound(
submission.value,
- actionName,
- actionArgs,
- async () => {
- fetchAll();
- },
+ selectedMenuState.value.reviewRoundId,
);
+ return reviewRound;
+ });
+
+ /**
+ * Expose workflow actions
+ *
+ */
+ const _workflowActionsFns = useWorkflowActions(props.pageInitConfig);
+ const workflowActions = Object.values(WorkflowActions).reduce(
+ (acc, actionName) => {
+ acc[actionName] = (noArgs, finishedCallback = null) =>
+ _workflowActionsFns[actionName](
+ {
+ submission: submission.value,
+ selectedPublication: selectedPublication.value,
+ reviewRoundId: selectedReviewRound.value?.id,
+ },
+ (finishedData) => {
+ triggerDataChange();
+ if (finishedCallback) {
+ finishedCallback(finishedData);
+ }
+ },
+ );
+ return acc;
+ },
+ {},
+ );
+
+ /**
+ * Expose decision functions
+ *
+ * */
+ const _workflowDecisionsFns = useWorkflowDecisions();
+ const decisionActions = Object.values(DecisionActions).reduce(
+ (acc, actionName) => {
+ acc[actionName] = (noArgs) =>
+ _workflowDecisionsFns[actionName]({
+ submission: submission.value,
+ selectedPublication: selectedPublication.value,
+ reviewRoundId: selectedReviewRound.value?.id,
+ });
+ return acc;
+ },
+ {},
+ );
+
+ /**
+ * Items
+ *
+ * */
+
+ const _workflowEditorialConfigFns =
+ dashboardPage === DashboardPageTypes.EDITORIAL_DASHBOARD
+ ? useWorkflowEditorialConfig()
+ : useWorkflowAuthorConfig();
+
+ const stageTitle = computed(() => {
+ return selectedMenuState.value?.title || '';
+ });
+
+ function _getItemsArgs() {
+ return {
+ selectedMenuState: selectedMenuState.value,
+ submission: submission.value,
+ pageInitConfig: props.pageInitConfig,
+ selectedPublication: selectedPublication.value,
+ selectedPublicationId: selectedPublicationId.value,
+ selectedReviewRound: selectedReviewRound.value,
+ };
}
- /** Primary Items */
- const {
- getPrimaryItems,
- getActionItems,
- getMetaItems,
- filterItemsBasedOnContext,
- } = useSummaryConfig();
+ /** Header Actions */
+ const headerItems = computed(() => {
+ return _workflowEditorialConfigFns.getHeaderItems({
+ submission: submission.value,
+ selectedPublication: selectedPublication.value,
+ publicationSettings: props.pageInitConfig.publicationSettings,
+ });
+ });
+
+ const primaryItems = computed(() => {
+ return _workflowEditorialConfigFns.getPrimaryItems(_getItemsArgs());
+ });
+
+ const secondaryItems = computed(() => {
+ return _workflowEditorialConfigFns.getSecondaryItems(_getItemsArgs());
+ });
+
+ const actionItems = computed(() => {
+ return _workflowEditorialConfigFns.getActionItems(_getItemsArgs());
+ });
+
+ const publicationControlsLeft = computed(() => {
+ return _workflowEditorialConfigFns.getPublicationControlsLeft(
+ _getItemsArgs(),
+ );
+ });
+
+ const publicationControlsRight = computed(() => {
+ return _workflowEditorialConfigFns.getPublicationControlsRight(
+ _getItemsArgs(),
+ );
+ });
return {
dashboardPage,
submission,
- selectedReviewAssignment,
- currentPublication,
- issue,
- associatedEditors,
- handleAction,
+ selectedPublication,
+ selectPublicationId,
+
+ /**
+ * Navigation
+ * */
+ selectedMenuItem,
+ sideMenuProps,
+ selectedMenuState,
+ navigateToMenu,
+
+ /** Actions
+ *
+ */
+ ...workflowActions,
+ ...decisionActions,
/**
* Summary
*/
- getPrimaryItems,
- getActionItems,
- getMetaItems,
- filterItemsBasedOnContext,
-
- /** Changes tracking */
- registerDataChangeCallback,
- triggerDataChange,
+ stageTitle,
+ headerItems,
+ primaryItems,
+ secondaryItems,
+ actionItems,
+ publicationControlsLeft,
+ publicationControlsRight,
+
+ /**
+ * Expose for extensions
+ */
+
+ _workflowActionsFns,
};
},
);
diff --git a/src/pages/dashboard/components/DashboardTable/CellReviewAssignmentActions.vue b/src/pages/dashboard/components/DashboardTable/CellReviewAssignmentActions.vue
index 63d0b5036..71d96cb96 100644
--- a/src/pages/dashboard/components/DashboardTable/CellReviewAssignmentActions.vue
+++ b/src/pages/dashboard/components/DashboardTable/CellReviewAssignmentActions.vue
@@ -4,23 +4,40 @@
class="-ms-3"
:aria-describedby="'submission-title-' + item.id"
:is-link="true"
- @click="dashboardPageStore.openSummaryModal(item.submissionId, item.id)"
+ @click="
+ dashboardPageStore.openReviewerForm({
+ submissionId: item.submissionId,
+ })
+ "
>
- {{ t('dashboard.action') }}
+ {{ actionLabel }}
diff --git a/src/pages/dashboard/components/DashboardTable/CellReviewAssignmentActivity.vue b/src/pages/dashboard/components/DashboardTable/CellReviewAssignmentActivity.vue
index 8e1b4000e..ed93a4fa8 100644
--- a/src/pages/dashboard/components/DashboardTable/CellReviewAssignmentActivity.vue
+++ b/src/pages/dashboard/components/DashboardTable/CellReviewAssignmentActivity.vue
@@ -6,13 +6,6 @@
v-bind="config.props"
v-for="(config, index) in cellConfig"
:key="index"
- @action="
- (actionName, actionArgs) =>
- dashboardStore.handleItemAction(actionName, {
- ...actionArgs,
- reviewAssignmentId: item.id,
- })
- "
/>
diff --git a/src/pages/dashboard/components/DashboardTable/CellSubmissionActions.vue b/src/pages/dashboard/components/DashboardTable/CellSubmissionActions.vue
index 443bef1f5..a89df1802 100644
--- a/src/pages/dashboard/components/DashboardTable/CellSubmissionActions.vue
+++ b/src/pages/dashboard/components/DashboardTable/CellSubmissionActions.vue
@@ -6,7 +6,7 @@
:is-link="true"
@click="dashboardPageStore.openSummaryModal(item.id)"
>
- {{ t('dashboard.viewSummary') }}
+ {{ t('common.view') }}