-
Notifications
You must be signed in to change notification settings - Fork 47
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#7495 initial adjustments for new submission listing & wor…
…kflow for OPS
- Loading branch information
1 parent
272bf4a
commit e88d2d2
Showing
13 changed files
with
1,412 additions
and
18 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
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
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
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 './workflowStoreOPS'; | ||
const props = defineProps({ | ||
submissionId: {type: Number, required: true}, | ||
pageInitConfig: {type: Object, required: true}, | ||
}); | ||
useWorkflowStore(props); | ||
</script> |
50 changes: 50 additions & 0 deletions
50
src/pages/workflow/components/publication/WorkflowPublicationRelationDropdownOPS.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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<Dropdown | ||
class="pkpWorkflow__publicationRelation" | ||
has-dropdown-icon | ||
:label="t('publication.relation')" | ||
> | ||
<PkpForm v-bind="relationForm" @set="set" /> | ||
</Dropdown> | ||
</template> | ||
|
||
<script setup> | ||
import {watch} from 'vue'; | ||
import Dropdown from '@/components/Dropdown/Dropdown.vue'; | ||
import PkpForm from '@/components/Form/Form.vue'; | ||
import {useLocalize} from '@/composables/useLocalize'; | ||
import {useForm} from '@/composables/useForm'; | ||
import {useUrl} from '@/composables/useUrl'; | ||
import {useDashboardPageStore} from '@/pages/dashboard/dashboardPageStore.js'; | ||
const dashboardStore = useDashboardPageStore(); | ||
const {t} = useLocalize(); | ||
const props = defineProps({publication: {type: Object, required: true}}); | ||
const relationForm = dashboardStore.componentForms.relationForm; | ||
const {setValue, setAction, set} = useForm(relationForm); | ||
watch( | ||
props.publication, | ||
(newPublication) => { | ||
setValue('relationStatus', newPublication.relationStatus); | ||
setValue('vorDoi', newPublication.vorDoi); | ||
const {apiUrl} = useUrl( | ||
`submissions/${newPublication.submissionId}/publications/${newPublication.id}`, | ||
); | ||
setAction(apiUrl.value); | ||
}, | ||
{immediate: true}, | ||
); | ||
</script> | ||
<style lang="less"> | ||
.pkpWorkflow__publicationRelation .pkpDropdown__content { | ||
min-width: 22em; | ||
max-width: 22em; | ||
} | ||
</style> |
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
134 changes: 134 additions & 0 deletions
134
src/pages/workflow/composables/useWorkflowConfig/useWorkflowConfigOPS.js
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 |
---|---|---|
@@ -0,0 +1,134 @@ | ||
import {useLocalize} from '@/composables/useLocalize'; | ||
import {DashboardPageTypes} from '@/pages/dashboard/dashboardPageStore'; | ||
|
||
import * as ConfigAuthorOPS from './workflowConfigAuthorOPS'; | ||
import * as ConfigEditorialOPS from './workflowConfigEditorialOPS'; | ||
|
||
export function useWorkflowConfigOPS({dashboardPage}) { | ||
const {t} = useLocalize(); | ||
|
||
let Configs = null; | ||
|
||
if (dashboardPage === DashboardPageTypes.EDITORIAL_DASHBOARD) { | ||
Configs = { | ||
getHeaderItems: ConfigEditorialOPS.getHeaderItems, | ||
WorkflowConfig: { | ||
//...ConfigEditorialShared.WorkflowConfig, | ||
...ConfigEditorialOPS.WorkflowConfig, | ||
}, | ||
PublicationConfig: { | ||
//...ConfigEditorialShared.PublicationConfig, | ||
...ConfigEditorialOPS.PublicationConfig, | ||
}, | ||
}; | ||
} else { | ||
Configs = { | ||
getHeaderItems: ConfigEditorialOPS.getHeaderItems, | ||
WorkflowConfig: { | ||
...ConfigAuthorOPS.WorkflowConfig, | ||
}, | ||
PublicationConfig: { | ||
...ConfigAuthorOPS.PublicationConfig, | ||
}, | ||
}; | ||
} | ||
|
||
function _getItems( | ||
getterFnName, | ||
{ | ||
selectedMenuState, | ||
submission, | ||
pageInitConfig, | ||
selectedPublication, | ||
selectedPublicationId, | ||
selectedReviewRound, | ||
permissions, | ||
}, | ||
) { | ||
if (selectedMenuState.stageId) { | ||
const itemsArgs = { | ||
submission, | ||
selectedPublication, | ||
selectedPublicationId, | ||
selectedStageId: selectedMenuState.stageId, | ||
selectedReviewRound, | ||
permissions, | ||
}; | ||
if (!submission) { | ||
return []; | ||
} | ||
|
||
if (!permissions.accessibleStages.includes(selectedMenuState.stageId)) { | ||
if (getterFnName === 'getPrimaryItems') { | ||
return [ | ||
{ | ||
component: 'PrimaryBasicMetadata', | ||
props: {body: t('user.authorization.accessibleWorkflowStage')}, | ||
}, | ||
]; | ||
} else { | ||
return []; | ||
} | ||
} | ||
|
||
return [ | ||
...(Configs.WorkflowConfig?.common?.[getterFnName]?.(itemsArgs) || []), | ||
...(Configs.WorkflowConfig[selectedMenuState.stageId]?.[getterFnName]?.( | ||
itemsArgs, | ||
) || []), | ||
]; | ||
} else if (selectedMenuState.primaryMenuItem === 'publication') { | ||
const itemsArgs = { | ||
submission, | ||
pageInitConfig: pageInitConfig, | ||
selectedPublication, | ||
selectedPublicationId, | ||
permissions, | ||
}; | ||
if (!submission || !selectedPublication) { | ||
return []; | ||
} | ||
|
||
return [ | ||
...(Configs.PublicationConfig?.common?.[getterFnName]?.(itemsArgs) || | ||
[]), | ||
...(Configs.PublicationConfig[selectedMenuState.secondaryMenuItem]?.[ | ||
getterFnName | ||
]?.(itemsArgs) || []), | ||
]; | ||
} | ||
} | ||
|
||
function getHeaderItems(args) { | ||
return Configs.getHeaderItems(args); | ||
} | ||
|
||
function getPrimaryItems(args) { | ||
return _getItems('getPrimaryItems', args); | ||
} | ||
|
||
function getSecondaryItems(args) { | ||
return _getItems('getSecondaryItems', args); | ||
} | ||
|
||
function getActionItems(args) { | ||
return _getItems('getActionItems', args); | ||
} | ||
|
||
function getPublicationControlsLeft(args) { | ||
return _getItems('getPublicationControlsLeft', args); | ||
} | ||
|
||
function getPublicationControlsRight(args) { | ||
return _getItems('getPublicationControlsRight', args); | ||
} | ||
|
||
return { | ||
getHeaderItems, | ||
getPrimaryItems, | ||
getSecondaryItems, | ||
getActionItems, | ||
getPublicationControlsLeft, | ||
getPublicationControlsRight, | ||
}; | ||
} |
Oops, something went wrong.