From 6a3eceb2a6dfaea268d9d02d8bbb6b2966645f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Thu, 7 Nov 2024 12:08:28 +0100 Subject: [PATCH] pkp/pkp-lib#7495 OPS e2e tests migration for new submission listing and workflow side modal --- .../action/WorkflowActionChangeDecision.vue | 28 +++++++++++++++++ .../composables/useWorkflowActions.js | 2 +- .../workflowConfigEditorialOPS.js | 31 +++++++++++++++---- .../composables/useWorkflowDecisions.js | 8 ++++- src/pages/workflow/workflowStoreOPS.js | 2 ++ 5 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 src/pages/workflow/components/action/WorkflowActionChangeDecision.vue diff --git a/src/pages/workflow/components/action/WorkflowActionChangeDecision.vue b/src/pages/workflow/components/action/WorkflowActionChangeDecision.vue new file mode 100644 index 000000000..88bc6d3e1 --- /dev/null +++ b/src/pages/workflow/components/action/WorkflowActionChangeDecision.vue @@ -0,0 +1,28 @@ + + + diff --git a/src/pages/workflow/composables/useWorkflowActions.js b/src/pages/workflow/composables/useWorkflowActions.js index 72b7a3ae0..ff0677841 100644 --- a/src/pages/workflow/composables/useWorkflowActions.js +++ b/src/pages/workflow/composables/useWorkflowActions.js @@ -20,7 +20,7 @@ export const Actions = { WORKFLOW_RECOMMEND_REVISION: 'workflowRecommendRevision', WORKFLOW_ASSIGN_TO_ISSUE_AND_SCHEDULE_FOR_PUBLICATION: 'workflowAssignToIssueAndScheduleForPublication', - WORKFLOW_SCHEDULE_FOR_PUBLICATION: 'workflowUnschedulePublication', + WORKFLOW_SCHEDULE_FOR_PUBLICATION: 'workflowScheduleForPublication', WORKFLOW_PREVIEW_PUBLICATION: 'workflowPreviewPublication', WORKFLOW_UNSCHEDULE_PUBLICATION: 'workflowUnschedulePublication', WORKFLOW_UNPUBLISH_PUBLICATION: 'workflowUnpublishPublication', diff --git a/src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOPS.js b/src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOPS.js index 80be03ca6..5d4726670 100644 --- a/src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOPS.js +++ b/src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOPS.js @@ -117,6 +117,29 @@ export const WorkflowConfig = { return []; } + if (submission.status === pkp.const.STATUS_DECLINED) { + items.push({ + component: 'WorkflowActionChangeDecision', + props: { + actionButtonsProps: [ + { + label: t('editor.submission.schedulePublication'), + isPrimary: true, + action: 'navigateToMenu', + actionArgs: 'publication_titleAbstract', + }, + { + label: t('editor.submission.decision.revertDecline'), + isSecondary: true, + action: DecisionActions.DECISION_REVERT_INITIAL_DECLINE, + }, + ], + }, + }); + + return items; + } + items.push({ component: 'WorkflowActionButton', props: { @@ -230,13 +253,9 @@ export const PublicationConfig = { props: { // {{ submission.status === getConstant('STATUS_PUBLISHED') ? publishLabel : schedulePublicationLabel }} - label: - submission.status === pkp.const.STATUS_PUBLISHED - ? t('publication.publish') - : t('editor.submission.schedulePublication'), + label: t('publication.publish'), isSecondary: true, - action: - Actions.WORKFLOW_ASSIGN_TO_ISSUE_AND_SCHEDULE_FOR_PUBLICATION, + action: Actions.WORKFLOW_SCHEDULE_FOR_PUBLICATION, }, }); } else if (selectedPublication.status === pkp.const.STATUS_SCHEDULED) { diff --git a/src/pages/workflow/composables/useWorkflowDecisions.js b/src/pages/workflow/composables/useWorkflowDecisions.js index 1230a4032..a4fb23719 100644 --- a/src/pages/workflow/composables/useWorkflowDecisions.js +++ b/src/pages/workflow/composables/useWorkflowDecisions.js @@ -8,13 +8,14 @@ export const Actions = { DECISION_EXTERNAL_REVIEW: 'decisionExternalReview', DECISION_SKIP_EXTERNAL_REVIEW: 'decisionSkipExternalReview', DECISION_INITIAL_DECLINE: 'decisionInitialDecline', + DECISION_REVERT_INITIAL_DECLINE: 'decisionRevertInitialDecline', + DECISION_SEND_TO_PRODUCTION: 'decisionSendToProduction', DECISION_BACK_FROM_COPYEDITING: 'decisionBackFromCopyediting', DECISION_NEW_EXTERNAL_ROUND: 'decisionNewExternalRound', DECISION_BACK_FROM_PRODUCTION: 'decisionBackFromProduction', DECISION_RECOMMEND_ACCEPT: 'decisionRecommendAccept', DECISION_RECOMMEND_DECLINE: 'decisionRecommendDecline', - // OMP SPECIFIC DECISION_INTERNAL_REVIEW: 'decisionInternalReview', DECISION_RECOMMEND_EXTERNAL_REVIEW: 'decisionRecommendExternalReview', @@ -89,6 +90,10 @@ export function useWorkflowDecisions() { openDecisionPage(submission, pkp.const.DECISION_INITIAL_DECLINE); } + function decisionRevertInitialDecline({submission}) { + openDecisionPage(submission, pkp.const.DECISION_REVERT_INITIAL_DECLINE); + } + function decisionSendToProduction({submission}) { openDecisionPage(submission, pkp.const.DECISION_SEND_TO_PRODUCTION); } @@ -232,6 +237,7 @@ export function useWorkflowDecisions() { decisionExternalReview, decisionSkipExternalReview, decisionInitialDecline, + decisionRevertInitialDecline, decisionSendToProduction, decisionBackFromCopyediting, decisionNewExternalRound, diff --git a/src/pages/workflow/workflowStoreOPS.js b/src/pages/workflow/workflowStoreOPS.js index 5faaba5aa..ccdca0bb7 100644 --- a/src/pages/workflow/workflowStoreOPS.js +++ b/src/pages/workflow/workflowStoreOPS.js @@ -31,6 +31,7 @@ import ContributorManager from '@/managers/ContributorManager/ContributorManager import ParticipantManager from '@/managers/ParticipantManager/ParticipantManager.vue'; import GalleyManager from '@/managers/GalleyManager/GalleyManager.vue'; import WorkflowActionButton from './components/action/WorkflowActionButton.vue'; +import WorkflowActionChangeDecision from './components/action/WorkflowActionChangeDecision.vue'; import WorkflowNotificationDisplay from './components/primary/WorkflowNotificationDisplay.vue'; import WorkflowPublicationForm from './components/publication/WorkflowPublicationForm.vue'; import WorkflowPublicationVersionControl from './components/publication/WorkflowPublicationVersionControl.vue'; @@ -191,6 +192,7 @@ export const useWorkflowStore = defineComponentStore('workflow', (props) => { ParticipantManager, GalleyManager, WorkflowActionButton, + WorkflowActionChangeDecision, WorkflowNotificationDisplay, WorkflowPrimaryBasicMetadata, WorkflowPublicationForm,