forked from pkp/ui-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#10618 Refine submission status, clean up inherited config…
…urations, various fixes
- Loading branch information
1 parent
b1a232e
commit 6fa4697
Showing
12 changed files
with
195 additions
and
808 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
src/pages/workflow/components/primary/WorkflowReviewRoundStatus.vue
This file was deleted.
Oops, something went wrong.
125 changes: 101 additions & 24 deletions
125
src/pages/workflow/components/primary/WorkflowSubmissionStatus.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,117 @@ | ||
<template> | ||
<div class="border border-light p-5"> | ||
<h2 class="text-lg-bold text-heading">{{ texts.heading }}</h2> | ||
<p v-if="description" class="text-base-normal">{{ texts.description }}</p> | ||
<div v-if="message" class="border border-light p-4"> | ||
<h3 v-if="message.heading" class="mb-2 text-lg-bold text-heading"> | ||
{{ message.heading }} | ||
</h3> | ||
<p v-if="message.body" class="text-sm-normal">{{ message.body }}</p> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import {computed} from 'vue'; | ||
import {useSubmission} from '@/composables/useSubmission.js'; | ||
import {useLocalize} from '@/composables/useLocalize'; | ||
const props = defineProps({ | ||
submission: {type: Object, required: true}, | ||
submission: { | ||
type: String, | ||
required: true, | ||
}, | ||
selectedStageId: {type: Number, required: true}, | ||
selectedReviewRoundId: {type: Number, required: false}, | ||
}); | ||
const {t} = useLocalize(); | ||
const {t, tk} = useLocalize(); | ||
const { | ||
getActiveStage, | ||
hasNotSubmissionStartedStage, | ||
hasSubmissionPassedStage, | ||
getCurrentReviewRound, | ||
} = useSubmission(); | ||
//const activeStage = computed(() => getActiveStage(props.submission)); | ||
const StageNames = { | ||
[pkp.const.WORKFLOW_STAGE_ID_INTERNAL_REVIEW]: tk( | ||
'workflow.review.internalReview', | ||
), | ||
[pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW]: tk( | ||
'workflow.review.externalReview', | ||
), | ||
[pkp.const.WORKFLOW_STAGE_ID_EDITING]: tk('submission.copyediting'), | ||
[pkp.const.WORKFLOW_STAGE_ID_PRODUCTION]: tk('submission.production'), | ||
}; | ||
const texts = computed(() => { | ||
switch (props.submission.stageId) { | ||
case pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW: | ||
const message = computed(() => { | ||
// not initiated yet | ||
if (hasNotSubmissionStartedStage(props.submission, props.selectedStageId)) { | ||
return { | ||
heading: t('common.status'), | ||
body: t('workflow.stageNotStarted', { | ||
stage: t(StageNames[props.selectedStageId]), | ||
}), | ||
}; | ||
// submission is in some future stage | ||
} else if ( | ||
hasSubmissionPassedStage(props.submission, props.selectedStageId) | ||
) { | ||
const activeStage = getActiveStage(props.submission); | ||
// more detailed messaging for review rounds that has been moved to the next review round | ||
if ( | ||
props.selectedStageId === pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW || | ||
props.selectedStageId === pkp.const.WORKFLOW_STAGE_ID_INTERNAL_REVIEW | ||
) { | ||
const currentReviewRound = getCurrentReviewRound( | ||
props.submission, | ||
props.selectedStageId, | ||
); | ||
if (props.selectedReviewRoundId < currentReviewRound.id) { | ||
return { | ||
heading: t('common.status'), | ||
body: t('workflow.submissionNextReviewRoundInFutureStage', { | ||
stage: t(StageNames[activeStage.id]), | ||
}), | ||
}; | ||
} | ||
} | ||
return { | ||
heading: t('common.status'), | ||
body: t('workflow.submissionInFutureStage', { | ||
stage: t(StageNames[activeStage.id]), | ||
}), | ||
}; | ||
// when active stage is review stage | ||
} else if ( | ||
props.selectedStageId === pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW || | ||
props.selectedStageId === pkp.const.WORKFLOW_STAGE_ID_INTERNAL_REVIEW | ||
) { | ||
const currentReviewRound = getCurrentReviewRound( | ||
props.submission, | ||
props.selectedStageId, | ||
); | ||
if (props.selectedReviewRoundId < currentReviewRound.id) { | ||
return { | ||
heading: t('editor.submission.workflowDecision.submission.underReview'), | ||
heading: t('common.status'), | ||
body: t('workflow.submissionInNextReviewRound'), | ||
}; | ||
case pkp.const.WORKFLOW_STAGE_ID_EDITING: | ||
return {heading: 'todo'}; | ||
case pkp.const.WORKFLOW_STAGE_ID_PRODUCTION: | ||
switch (props.submission.status) { | ||
case pkp.const.STATUS_QUEUED: | ||
return {heading: 'todo'}; | ||
case pkp.const.STATUS_SCHEDULED: | ||
return {heading: 'todo'}; | ||
case pkp.const.STATUS_PUBLISHED: | ||
return {heading: 'todo'}; | ||
case pkp.const.STATUS_DECLINED: | ||
return {heading: 'todo'}; | ||
} | ||
} | ||
return { | ||
heading: t('notification.type.roundStatusTitle', { | ||
round: currentReviewRound.round, | ||
}), | ||
body: currentReviewRound.status, | ||
}; | ||
} else if (props.selectedStageId === pkp.const.WORKFLOW_STAGE_ID_PRODUCTION) { | ||
if (props.submission.status === pkp.const.STATUS_PUBLISHED) { | ||
return { | ||
heading: t('common.status'), | ||
body: t('editor.submission.workflowDecision.submission.published'), | ||
}; | ||
} | ||
} | ||
return ''; | ||
return null; | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.