Skip to content

Commit 98ddbef

Browse files
committed
pkp/pkp-lib#9295 introduced publication status consts similar to submission
1 parent 4cd263c commit 98ddbef

File tree

11 files changed

+54
-27
lines changed

11 files changed

+54
-27
lines changed

public/globals.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ window.pkp = {
100100
STATUS_PUBLISHED: 3,
101101
STATUS_DECLINED: 4,
102102
STATUS_SCHEDULED: 5,
103+
PUBLICATION_STATUS_QUEUED: 1,
104+
PUBLICATION_STATUS_PUBLISHED: 3,
105+
PUBLICATION_STATUS_DECLINED: 4,
106+
PUBLICATION_STATUS_SCHEDULED: 5,
103107
WORKFLOW_STAGE_ID_SUBMISSION: 1,
104108
WORKFLOW_STAGE_ID_INTERNAL_REVIEW: 2,
105109
WORKFLOW_STAGE_ID_EXTERNAL_REVIEW: 3,

src/components/Form/fields/FieldSelectIssue.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default {
7676
type: String,
7777
required: true,
7878
},
79-
/** One of the `PKPSubmission::STATUS_` constants. When set to `PKPSubmission::STATUS_QUEUED` or `PKPSubmission::STATUS_PUBLISHED` the issue selection will be hidden. */
79+
/** One of the `PKPPublication::STATUS_` constants. When set to `PKPPublication::STATUS_QUEUED` or `PKPPublication::STATUS_PUBLISHED` the issue selection will be hidden. */
8080
publicationStatus: {
8181
type: Number,
8282
required: true,
@@ -113,7 +113,7 @@ export default {
113113
*/
114114
button() {
115115
let button = null;
116-
if (this.publicationStatus !== pkp.const.STATUS_PUBLISHED) {
116+
if (this.publicationStatus !== pkp.const.PUBLICATION_STATUS_PUBLISHED) {
117117
button = {
118118
label: this.value ? this.changeIssueLabel : this.assignLabel,
119119
};
@@ -129,9 +129,11 @@ export default {
129129
*/
130130
notice() {
131131
let notice = '';
132-
if (this.publicationStatus === pkp.const.STATUS_PUBLISHED) {
132+
if (this.publicationStatus === pkp.const.PUBLICATION_STATUS_PUBLISHED) {
133133
notice = this.publishedNoticeBase;
134-
} else if (this.publicationStatus === pkp.const.STATUS_SCHEDULED) {
134+
} else if (
135+
this.publicationStatus === pkp.const.PUBLICATION_STATUS_SCHEDULED
136+
) {
135137
notice = this.scheduledNoticeBase;
136138
} else if (this.value) {
137139
notice = this.assignedNoticeBase;

src/managers/GalleyManager/useGalleyManagerConfig.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function useGalleyManagerConfig() {
8585
const permittedActions = GalleyManagerConfiguration.actions
8686
.filter((action) => {
8787
if (
88-
publication.value.status === pkp.const.STATUS_PUBLISHED &&
88+
publication.value.status === pkp.const.PUBLICATION_STATUS_PUBLISHED &&
8989
GalleyManagerConfiguration.actionsRequiresUnpublishedState.includes(
9090
action,
9191
)
@@ -141,12 +141,14 @@ export function useGalleyManagerConfig() {
141141

142142
if (config.permittedActions.includes(Actions.GALLEY_EDIT)) {
143143
const label =
144-
publication.status === pkp.const.STATUS_PUBLISHED
144+
publication.status === pkp.const.PUBLICATION_STATUS_PUBLISHED
145145
? t('common.view')
146146
: t('common.edit');
147147

148148
const icon =
149-
publication.status === pkp.const.STATUS_PUBLISHED ? 'View' : 'Edit';
149+
publication.status === pkp.const.PUBLICATION_STATUS_PUBLISHED
150+
? 'View'
151+
: 'Edit';
150152

151153
actions.push({
152154
label,

src/pages/workflow/components/publication/WorkflowPublicationVersionControl.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ const selectedPublication = computed(() =>
3131
const statusProps = computed(() => {
3232
const publication = selectedPublication.value;
3333
if (
34-
publication.status === pkp.const.STATUS_QUEUED &&
34+
publication.status === pkp.const.PUBLICATION_STATUS_QUEUED &&
3535
publication.id === props.submission.currentPublicationId
3636
) {
3737
return {
3838
label: t('publication.status.unscheduled'),
3939
color: 'bg-stage-declined',
4040
};
41-
} else if (publication.status === pkp.const.STATUS_SCHEDULED) {
41+
} else if (publication.status === pkp.const.PUBLICATION_STATUS_SCHEDULED) {
4242
return {
4343
label: t('publication.status.scheduled'),
4444
color: 'bg-stage-scheduled-for-publishing',
4545
};
46-
} else if (publication.status === pkp.const.STATUS_PUBLISHED) {
46+
} else if (publication.status === pkp.const.PUBLICATION_STATUS_PUBLISHED) {
4747
return {
4848
label: t('publication.status.published'),
4949
color: 'bg-stage-published',

src/pages/workflow/composables/useWorkflowActions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export function useWorkflowActions() {
118118
const requirePublicationStage = isOJS()
119119
? !selectedPublication.versionStage ||
120120
![
121-
pkp.const.STATUS_READY_TO_PUBLISH,
122-
pkp.const.STATUS_READY_TO_SCHEDULE,
121+
pkp.const.PUBLICATION_STATUS_READY_TO_PUBLISH,
122+
pkp.const.PUBLICATION_STATUS_READY_TO_SCHEDULE,
123123
].includes(selectedPublication.status)
124124
: !selectedPublication.versionStage;
125125

src/pages/workflow/composables/useWorkflowConfig/workflowConfigAuthorOJS.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ export const PublicationConfig = {
274274
selectedPublication,
275275
}) => {
276276
const items = [];
277-
if (selectedPublication.status === pkp.const.STATUS_PUBLISHED) {
277+
if (
278+
selectedPublication.status === pkp.const.PUBLICATION_STATUS_PUBLISHED
279+
) {
278280
items.push({
279281
component: 'WorkflowPublicationEditDisabled',
280282
props: {},

src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOJS.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,9 @@ export const PublicationConfig = {
716716
selectedPublication,
717717
}) => {
718718
const items = [];
719-
if (selectedPublication.status === pkp.const.STATUS_PUBLISHED) {
719+
if (
720+
selectedPublication.status === pkp.const.PUBLICATION_STATUS_PUBLISHED
721+
) {
720722
items.push({
721723
component: 'WorkflowPublicationEditDisabled',
722724
props: {},
@@ -769,9 +771,11 @@ export const PublicationConfig = {
769771
return [];
770772
}
771773
if (
772-
selectedPublication.status === pkp.const.STATUS_QUEUED ||
773-
selectedPublication.status === pkp.const.STATUS_READY_TO_PUBLISH ||
774-
selectedPublication.status === pkp.const.STATUS_READY_TO_SCHEDULE
774+
selectedPublication.status === pkp.const.PUBLICATION_STATUS_QUEUED ||
775+
selectedPublication.status ===
776+
pkp.const.PUBLICATION_STATUS_READY_TO_PUBLISH ||
777+
selectedPublication.status ===
778+
pkp.const.PUBLICATION_STATUS_READY_TO_SCHEDULE
775779
) {
776780
if (
777781
hasSubmissionPassedStage(
@@ -803,7 +807,9 @@ export const PublicationConfig = {
803807
WorkflowActions.WORKFLOW_ASSIGN_TO_ISSUE_AND_SCHEDULE_FOR_PUBLICATION,
804808
},
805809
});
806-
} else if (selectedPublication.status === pkp.const.STATUS_SCHEDULED) {
810+
} else if (
811+
selectedPublication.status === pkp.const.PUBLICATION_STATUS_SCHEDULED
812+
) {
807813
items.push({
808814
component: 'WorkflowActionButton',
809815
props: {
@@ -821,7 +827,9 @@ export const PublicationConfig = {
821827
action: WorkflowActions.WORKFLOW_UNSCHEDULE_PUBLICATION,
822828
},
823829
});
824-
} else if (selectedPublication.status === pkp.const.STATUS_PUBLISHED) {
830+
} else if (
831+
selectedPublication.status === pkp.const.PUBLICATION_STATUS_PUBLISHED
832+
) {
825833
items.push({
826834
component: 'WorkflowActionButton',
827835
props: {

src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOMP.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ export const PublicationConfig = {
479479
if (!permissions.canPublish) {
480480
return [];
481481
}
482-
if (selectedPublication.status === pkp.const.STATUS_QUEUED) {
482+
if (selectedPublication.status === pkp.const.PUBLICATION_STATUS_QUEUED) {
483483
if (
484484
hasSubmissionPassedStage(
485485
submission,
@@ -506,7 +506,9 @@ export const PublicationConfig = {
506506
action: WorkflowActions.WORKFLOW_SCHEDULE_FOR_PUBLICATION,
507507
},
508508
});
509-
} else if (selectedPublication.status === pkp.const.STATUS_SCHEDULED) {
509+
} else if (
510+
selectedPublication.status === pkp.const.PUBLICATION_STATUS_SCHEDULED
511+
) {
510512
items.push({
511513
component: 'WorkflowActionButton',
512514
props: {
@@ -524,7 +526,9 @@ export const PublicationConfig = {
524526
action: WorkflowActions.WORKFLOW_UNSCHEDULE_PUBLICATION,
525527
},
526528
});
527-
} else if (selectedPublication.status === pkp.const.STATUS_PUBLISHED) {
529+
} else if (
530+
selectedPublication.status === pkp.const.PUBLICATION_STATUS_PUBLISHED
531+
) {
528532
items.push({
529533
component: 'WorkflowActionButton',
530534
props: {

src/pages/workflow/composables/useWorkflowConfig/workflowConfigEditorialOPS.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export const PublicationConfig = {
220220
if (!permissions.canPublish) {
221221
return [];
222222
}
223-
if (selectedPublication.status === pkp.const.STATUS_QUEUED) {
223+
if (selectedPublication.status === pkp.const.PUBLICATION_STATUS_QUEUED) {
224224
if (
225225
hasSubmissionPassedStage(
226226
submission,
@@ -247,7 +247,9 @@ export const PublicationConfig = {
247247
action: WorkflowActions.WORKFLOW_SCHEDULE_FOR_PUBLICATION,
248248
},
249249
});
250-
} else if (selectedPublication.status === pkp.const.STATUS_SCHEDULED) {
250+
} else if (
251+
selectedPublication.status === pkp.const.PUBLICATION_STATUS_SCHEDULED
252+
) {
251253
items.push({
252254
component: 'WorkflowActionButton',
253255
props: {
@@ -265,7 +267,9 @@ export const PublicationConfig = {
265267
action: WorkflowActions.WORKFLOW_UNSCHEDULE_PUBLICATION,
266268
},
267269
});
268-
} else if (selectedPublication.status === pkp.const.STATUS_PUBLISHED) {
270+
} else if (
271+
selectedPublication.status === pkp.const.PUBLICATION_STATUS_PUBLISHED
272+
) {
269273
items.push({
270274
component: 'WorkflowActionButton',
271275
props: {

src/pages/workflow/composables/useWorkflowPermissions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export function useWorkflowPermissions({submission, selectedPublication}) {
5252

5353
if (
5454
selectedPublication.value &&
55-
selectedPublication.value?.status === pkp.const.STATUS_PUBLISHED
55+
selectedPublication.value?.status ===
56+
pkp.const.PUBLICATION_STATUS_PUBLISHED
5657
) {
5758
canEditPublication = false;
5859
}

0 commit comments

Comments
 (0)