Skip to content

Commit

Permalink
pkp/pkp-lib#7495 Separate workflowPage for OJS
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec authored and ipula committed Oct 22, 2024
1 parent 97d9402 commit 727c30d
Show file tree
Hide file tree
Showing 15 changed files with 310 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/managers/ContributorManager/ContributorManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const props = defineProps({
submission: {type: Object, required: true},
publication: {type: Object, required: true},
contributorForm: {type: Object, required: true},
canEditPublication: {type: Boolean, required: true},
canEdit: {type: Boolean, required: true},
});
const contributorManagerStore = useContributorManagerStore(props);
Expand Down
2 changes: 1 addition & 1 deletion src/managers/ContributorManager/contributorManagerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useContributorManagerStore = defineComponentStore(

const contributorsListPanelProps = computed(() => {
return {
canEditPublication: props.canEditPublication,
canEditPublication: props.canEdit,
form: form.value,
id: 'contributors',
items: props.publication.authors,
Expand Down
2 changes: 1 addition & 1 deletion src/managers/GalleyManager/GalleyManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const Components = {
const props = defineProps({
publication: {type: Object, required: true},
submission: {type: Object, required: true},
canEditPublication: {type: Boolean, required: true},
canEdit: {type: Boolean, required: true},
});
const {t} = useLocalize();
Expand Down
2 changes: 1 addition & 1 deletion src/managers/GalleyManager/galleyManagerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const useGalleyManagerStore = defineComponentStore(
const _galleyActionsFns = useGalleyManagerActions();
function getActionArgs() {
return {
canEditPublication: props.canEditPublication,
canEdit: props.canEdit,
};
}

Expand Down
12 changes: 6 additions & 6 deletions src/managers/GalleyManager/useGalleyManagerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export const Actions = {
export function useGalleyManagerActions() {
const {t} = useLocalize();

function getBottomActions({canEditPublication}) {
function getBottomActions({canEdit}) {
const actions = [];

if (!canEditPublication) {
if (!canEdit) {
return [];
}

Expand All @@ -28,9 +28,9 @@ export function useGalleyManagerActions() {
return actions;
}

function getTopItems({canEditPublication}) {
function getTopItems({canEdit}) {
const actions = [];
if (!canEditPublication) {
if (!canEdit) {
return [];
}

Expand All @@ -39,10 +39,10 @@ export function useGalleyManagerActions() {
return actions;
}

function getItemActions({canEditPublication}) {
function getItemActions({canEdit}) {
const actions = [];

if (!canEditPublication) {
if (!canEdit) {
return [
{
label: t('common.view'),
Expand Down
2 changes: 2 additions & 0 deletions src/managers/ReviewerManager/useReviewerManagerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ export function useReviewerManagerActions() {
{submission, reviewAssignment, submissionStageId},
finishedCallback,
) {
// http://localhost:8000/index.php/publicknowledge/$$$call$$$/grid/users/reviewer/reviewer-grid/edit-review?submissionId=7&reviewAssignmentId=12&stageId=3

const {openLegacyModal} = useLegacyGridUrl({
component: 'grid.users.reviewer.ReviewerGridHandler',

Expand Down
2 changes: 1 addition & 1 deletion src/pages/workflow/WorkflowPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<template v-if="submission" #post-description>
<StageBubble :extended-stage="workflowStore.extendedStage">
<span class="text-lg-normal">
{{ stageLabel }}
{{ workflowStore.stageLabel }}
</span>
</StageBubble>
</template>
Expand Down
15 changes: 15 additions & 0 deletions src/pages/workflow/WorkflowPageOJS.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<WorkflowPage />
</template>

<script setup>
import WorkflowPage from './WorkflowPage.vue';
import {useWorkflowStore} from './workflowStoreOJS';
const props = defineProps({
submissionId: {type: Number, required: true},
pageInitConfig: {type: Object, required: true},
});
useWorkflowStore(props);
</script>
3 changes: 2 additions & 1 deletion src/pages/workflow/composables/useWorkflowActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,13 @@ export function useWorkflowActions({
});
}

// OMP - might be moved to separate file
async function workflowChangeWorktype(
{submission, workType},
finishedCallback,
) {
const {apiUrl} = useUrl(`submissions/${submission.id}`);

console.log('workType:', workType);
const {fetch} = useFetch(apiUrl, {method: 'PUT', body: {workType}});

await fetch();
Expand All @@ -339,6 +339,7 @@ export function useWorkflowActions({
workflowCreateNewVersion,
workflowPreviewPublication,
workflowChangeSubmissionLanguage,
// OMP
workflowChangeWorktype,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as ConfigEditorialShared from './workflowConfigEditorialOJS';
import * as ConfigAuthorOJS from './workflowConfigAuthorOJS';
import * as ConfigEditorialOJS from './workflowConfigEditorialOJS';

export function useWorkflowConfigOMP({dashboardPage}) {
export function useWorkflowConfigOJS({dashboardPage}) {
const {t} = useLocalize();

let Configs = null;
Expand Down Expand Up @@ -82,7 +82,7 @@ export function useWorkflowConfigOMP({dashboardPage}) {
itemsArgs,
) || []),
];
} else if (selectedMenuState.publicationMenu) {
} else if (selectedMenuState.primaryMenuItem === 'publication') {
const itemsArgs = {
submission,
pageInitConfig: pageInitConfig,
Expand All @@ -97,24 +97,7 @@ export function useWorkflowConfigOMP({dashboardPage}) {
return [
...(Configs.PublicationConfig?.common?.[getterFnName]?.(itemsArgs) ||
[]),
...(Configs.PublicationConfig[selectedMenuState.publicationMenu]?.[
getterFnName
]?.(itemsArgs) || []),
];
} else if (selectedMenuState.marketingMenu) {
const itemsArgs = {
submission,
pageInitConfig: pageInitConfig,
permissions,
};

if (!submission) {
return [];
}

return [
...(Configs.MarketingConfig?.common?.[getterFnName]?.(itemsArgs) || []),
...(Configs.MarketingConfig[selectedMenuState.marketingMenu]?.[
...(Configs.PublicationConfig[selectedMenuState.secondaryMenuItem]?.[
getterFnName
]?.(itemsArgs) || []),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ export function useWorkflowDataSubmissionPublication({submissionId}) {
if (selectedPublicationId.value !== publicationId) {
selectedPublicationId.value = publicationId;
selectedPublication.value = null;

const isPublicationInSubmission = submission.value?.publications?.find(
(publication) => publication.id === publicationId,
);

if (!isPublicationInSubmission) {
submission.value = null;
fetchSubmission();
}
fetchSelectedPublication();
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ export function useWorkflowNavigationConfigOJS(pageInitConfig) {
}

function getMenuItems({submission, permissions}) {
if (!submission) {
return [];
}

const menuItems = [
{
key: 'workflow',
Expand Down
Loading

0 comments on commit 727c30d

Please sign in to comment.