Skip to content

Commit

Permalink
pkp/pkp-lib#10618 Add OMP notifications for productiong stage
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Nov 27, 2024
1 parent dd993a3 commit 0904eb8
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 18 deletions.
13 changes: 13 additions & 0 deletions src/composables/useApp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export function useApp() {
function isOJS() {
return pkp.context.app === 'ojs2';
}
function isOMP() {
return pkp.context.app === 'omp';
}
function isOPS() {
return pkp.context.app === 'ops';
}

return {isOJS, isOMP, isOPS};
}
5 changes: 3 additions & 2 deletions src/managers/GalleyManager/useGalleyManagerConfiguration.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {useLocalize} from '@/composables/useLocalize';
import {useApp} from '@/composables/useApp';

export function useGalleyManagerConfiguration() {
const {t} = useLocalize();

const {isOPS} = useApp();
function getGalleyGridComponent() {
if (pkp.context.app === 'ops') {
if (isOPS()) {
return 'grid.preprintGalleys.PreprintGalleyGridHandler';
} else {
return 'grid.articleGalleys.ArticleGalleyGridHandler';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
import {computed, watch} from 'vue';
import {useUrl} from '@/composables/useUrl';
import {useFetch} from '@/composables/useFetch';
import {useApp} from '@/composables/useApp';
const props = defineProps({submission: {type: Object, required: true}});
const {pageUrl} = useUrl(`notification/fetchNotification`);
const {isOJS, isOMP} = useApp();
function getRequestOptionsPerStage(stageId) {
switch (stageId) {
Expand All @@ -31,24 +33,36 @@ function getRequestOptionsPerStage(stageId) {
[pkp.const.NOTIFICATION_LEVEL_TRIVIAL]: 0,
};
case pkp.const.WORKFLOW_STAGE_ID_PRODUCTION:
return {
[pkp.const.NOTIFICATION_LEVEL_NORMAL]: {
/** OMP specific */
[pkp.const.NOTIFICATION_TYPE_VISIT_CATALOG]: {
assocType: pkp.const.ASSOC_TYPE_SUBMISSION,
assocId: props.submission.id,
},
[pkp.const.NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER]: {
assocType: pkp.const.ASSOC_TYPE_SUBMISSION,
assocId: props.submission.id,
if (isOJS()) {
return {
[pkp.const.NOTIFICATION_LEVEL_NORMAL]: {
[pkp.const.NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER]: {
assocType: pkp.const.ASSOC_TYPE_SUBMISSION,
assocId: props.submission.id,
},
[pkp.const.NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS]: {
assocType: pkp.const.ASSOC_TYPE_SUBMISSION,
assocId: props.submission.id,
},
},
[pkp.const.NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS]: {
assocType: pkp.const.ASSOC_TYPE_SUBMISSION,
assocId: props.submission.id,
[pkp.const.NOTIFICATION_LEVEL_TRIVIAL]: 0,
};
} else if (isOMP()) {
return {
[pkp.const.NOTIFICATION_LEVEL_NORMAL]: {
[pkp.const.NOTIFICATION_TYPE_VISIT_CATALOG]: {
assocType: pkp.const.ASSOC_TYPE_SUBMISSION,
assocId: props.submission.id,
},
[pkp.const.NOTIFICATION_TYPE_FORMAT_NEEDS_APPROVED_SUBMISSION]: {
assocType: pkp.const.ASSOC_TYPE_SUBMISSION,
assocId: props.submission.id,
},
},
},
[pkp.const.NOTIFICATION_LEVEL_TRIVIAL]: 0,
};
[pkp.const.NOTIFICATION_LEVEL_TRIVIAL]: 0,
};
}
return null;
default:
return null;
}
Expand Down

0 comments on commit 0904eb8

Please sign in to comment.