Skip to content

Commit 77c0c66

Browse files
authored
pkp/pkp-lib#9295 publishing without issue assignment in editorial workflow (#619)
pkp/pkp-lib#9295 remove context level settings named continuousPublication pkp/pkp-lib#9295 code cleanup pkp/pkp-lib#9295 fixed issue change glitch pkp/pkp-lib#9295 removed unnecessary comment pkp/pkp-lib#9295 optimize for issue less context pkp/pkp-lib#9295 repplace setting continuousPublication with first class column published pkp/pkp-lib#9295 publish execution order update pkp/pkp-lib#9295 published logic check added pkp/pkp-lib#9295 better state handing before publication publish or schedule
1 parent 70d66c1 commit 77c0c66

File tree

3 files changed

+35
-7
lines changed

3 files changed

+35
-7
lines changed

src/components/Form/fields/FieldSelectIssue.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ export default {
164164
'@/pages/workflow/workflowStore.js'
165165
);
166166
167-
const workflowSotre = useWorkflowStore();
167+
const workflowStore = useWorkflowStore();
168168
169-
workflowSotre.workflowAssignToIssue({}, (finishedData) => {
170-
if (finishedData.data.issueId) {
169+
workflowStore.workflowAssignToIssue({}, (finishedData) => {
170+
if (finishedData.data) {
171171
this.currentValue = finishedData.data.issueId;
172172
}
173173
});

src/pages/workflow/composables/useWorkflowActions.js

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function useWorkflowActions() {
101101
}
102102

103103
function workflowAssignToIssueAndScheduleForPublication(
104-
{selectedPublication, submission},
104+
{pageInitConfig, selectedPublication, submission},
105105
finishedCallback,
106106
) {
107107
// if version is unassigned, we need to assign it to a publication stage first
@@ -110,13 +110,40 @@ export function useWorkflowActions() {
110110
{selectedPublication, submission},
111111
(publicationData) =>
112112
workflowAssignToIssueAndScheduleForPublication(
113-
{submission, selectedPublication: publicationData},
113+
{pageInitConfig, selectedPublication: publicationData, submission},
114114
finishedCallback,
115115
),
116116
);
117117
}
118118

119-
if (selectedPublication.issueId === null) {
119+
// if there are no issues, we can schedule the publication immediately
120+
if (pageInitConfig.publicationSettings.countIssues === 0) {
121+
workflowScheduleForPublication(
122+
{submission, selectedPublication},
123+
finishedCallback,
124+
);
125+
126+
return;
127+
}
128+
129+
// If the publication is marked as published,
130+
// and not assigned to an issue, or assigned to an issue that is not published (e.g. future issue),
131+
// we can publish the publication immediately as issueless or continuous publication
132+
if (
133+
selectedPublication.published &&
134+
(selectedPublication.issueId === null ||
135+
!pageInitConfig.publicationSettings.issuePublishedStatus[
136+
selectedPublication.issueId
137+
])
138+
) {
139+
workflowScheduleForPublication(
140+
{submission, selectedPublication},
141+
finishedCallback,
142+
);
143+
return;
144+
}
145+
146+
if (selectedPublication.issueId === null || selectedPublication.published) {
120147
const {url} = useLegacyGridUrl({
121148
component: 'modals.publish.AssignToIssueHandler',
122149
op: 'assign',
@@ -138,7 +165,7 @@ export function useWorkflowActions() {
138165
},
139166
{
140167
onClose: async ({formId, data}) => {
141-
if (data?.issueId) {
168+
if (data?.issueId || data?.published) {
142169
workflowScheduleForPublication(
143170
{submission, selectedPublication},
144171
finishedCallback,

src/pages/workflow/workflowStore.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export const useWorkflowStore = defineComponentStore(
157157
submission: submission.value,
158158
selectedPublication: selectedPublication.value,
159159
reviewRoundId: selectedReviewRound.value?.id,
160+
pageInitConfig: props.pageInitConfig,
160161
store,
161162
},
162163
(finishedData) => {

0 commit comments

Comments
 (0)