Skip to content

Commit

Permalink
pkp/pkp-lib#7495 OPS e2e tests migration for new submission listing a…
Browse files Browse the repository at this point in the history
…nd workflow side modal
  • Loading branch information
jardakotesovec committed Nov 7, 2024
1 parent e88d2d2 commit bcafd3b
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<div>
<PkpButton v-if="!isActionsShowed" class="" is-link @click="showActions">
{{ t('editor.submission.workflowDecision.changeDecision') }}
</PkpButton>
<div v-else class="flex flex-col space-y-3">
<WorkflowActionButton
v-for="(actionProps, index) in actionButtonsProps"
v-bind="actionProps"
:key="`${index}`"
/>
</div>
</div>
</template>

<script setup>
import {ref} from 'vue';
import PkpButton from '@/components/Button/Button.vue';
import WorkflowActionButton from '@/pages/workflow/components/action/WorkflowActionButton.vue';
defineProps({actionButtonsProps: {type: Array, required: true}});
const isActionsShowed = ref(false);
function showActions() {
isActionsShowed.value = true;
}
</script>
2 changes: 1 addition & 1 deletion src/pages/workflow/composables/useWorkflowActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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) {
Expand Down
8 changes: 7 additions & 1 deletion src/pages/workflow/composables/useWorkflowDecisions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -232,6 +237,7 @@ export function useWorkflowDecisions() {
decisionExternalReview,
decisionSkipExternalReview,
decisionInitialDecline,
decisionRevertInitialDecline,
decisionSendToProduction,
decisionBackFromCopyediting,
decisionNewExternalRound,
Expand Down
2 changes: 2 additions & 0 deletions src/pages/workflow/workflowStoreOPS.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -191,6 +192,7 @@ export const useWorkflowStore = defineComponentStore('workflow', (props) => {
ParticipantManager,
GalleyManager,
WorkflowActionButton,
WorkflowActionChangeDecision,
WorkflowNotificationDisplay,
WorkflowPrimaryBasicMetadata,
WorkflowPublicationForm,
Expand Down

0 comments on commit bcafd3b

Please sign in to comment.