forked from pkp/ui-library
-
Notifications
You must be signed in to change notification settings - Fork 0
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 workflow store refactor to have separate version for…
… OMP and OJS
- Loading branch information
1 parent
1cf730d
commit 97d9402
Showing
30 changed files
with
2,984 additions
and
1,043 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<GridWrapper | ||
:key="`${submissionId} - ${publicationId}`" | ||
grid-component="grid.users.chapter.ChapterGridHandler" | ||
:params="params" | ||
></GridWrapper> | ||
</template> | ||
<script setup> | ||
import GridWrapper from '@/components/GridWrapper/GridWrapper.vue'; | ||
import {computed} from 'vue'; | ||
const props = defineProps({ | ||
submissionId: {type: String, required: true}, | ||
publicationId: {type: String, required: true}, | ||
}); | ||
const params = computed(() => ({ | ||
submissionId: props.submissionId, | ||
publicationId: props.publicationId, | ||
})); | ||
</script> |
21 changes: 21 additions & 0 deletions
21
src/managers/PublicationFormatManager/PublicationFormatManager.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,21 @@ | ||
<template> | ||
<GridWrapper | ||
:key="`${submissionId} - ${publicationId}`" | ||
grid-component="grid.catalogEntry.PublicationFormatGridHandler" | ||
:params="params" | ||
></GridWrapper> | ||
</template> | ||
<script setup> | ||
import GridWrapper from '@/components/GridWrapper/GridWrapper.vue'; | ||
import {computed} from 'vue'; | ||
const props = defineProps({ | ||
submissionId: {type: String, required: true}, | ||
publicationId: {type: String, required: true}, | ||
}); | ||
const params = computed(() => ({ | ||
submissionId: props.submissionId, | ||
publicationId: props.publicationId, | ||
})); | ||
</script> |
19 changes: 19 additions & 0 deletions
19
src/managers/RepresentativeManager/RepresentativeManager.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,19 @@ | ||
<template> | ||
<GridWrapper | ||
:key="`${submissionId}`" | ||
grid-component="grid.catalogEntry.RepresentativesGridHandler" | ||
:params="params" | ||
></GridWrapper> | ||
</template> | ||
<script setup> | ||
import GridWrapper from '@/components/GridWrapper/GridWrapper.vue'; | ||
import {computed} from 'vue'; | ||
const props = defineProps({ | ||
submissionId: {type: String, required: true}, | ||
}); | ||
const params = computed(() => ({ | ||
submissionId: props.submissionId, | ||
})); | ||
</script> |
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 './workflowStoreOMP'; | ||
const props = defineProps({ | ||
submissionId: {type: Number, required: true}, | ||
pageInitConfig: {type: Object, required: true}, | ||
}); | ||
useWorkflowStore(props); | ||
</script> |
52 changes: 52 additions & 0 deletions
52
src/pages/workflow/components/header/WorkflowWorkTypeOMP.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,52 @@ | ||
<template> | ||
<DropdownActions | ||
:label="label" | ||
:actions="actions" | ||
@action="handleAction" | ||
></DropdownActions> | ||
</template> | ||
|
||
<script setup> | ||
import {computed} from 'vue'; | ||
import DropdownActions from '@/components/DropdownActions/DropdownActions.vue'; | ||
import {useLocalize} from '@/composables/useLocalize'; | ||
import {useWorkflowStore} from '@/pages/workflow/workflowStore'; | ||
const {t} = useLocalize(); | ||
const props = defineProps({submission: {type: Object, required: true}}); | ||
const label = computed(() => { | ||
if (props.submission.workType === pkp.const['WORK_TYPE_EDITED_VOLUME']) { | ||
return t('submission.workflowType.editedVolume.label'); | ||
} | ||
return t('common.publication'); | ||
}); | ||
const actions = computed(() => { | ||
return [ | ||
{ | ||
label: t('submission.workflowType.editedVolume.label'), | ||
name: 'setAsEditedVolume', | ||
}, | ||
{ | ||
label: t('common.publication'), | ||
name: 'setAsAuthoredWork', | ||
}, | ||
]; | ||
}); | ||
const workflowStore = useWorkflowStore(); | ||
function handleAction(actionName) { | ||
if (actionName === 'setAsEditedVolume') { | ||
workflowStore.workflowChangeWorktype({ | ||
workType: pkp.const.WORK_TYPE_EDITED_VOLUME, | ||
}); | ||
} else if (actionName === 'setAsAuthoredWork') { | ||
workflowStore.workflowChangeWorktype({ | ||
workType: pkp.const.WORK_TYPE_AUTHORED_WORK, | ||
}); | ||
} | ||
} | ||
</script> |
42 changes: 42 additions & 0 deletions
42
src/pages/workflow/components/publication/WorkflowMarketingForm.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,42 @@ | ||
<template> | ||
<PkpForm | ||
v-if="form" | ||
v-bind="form" | ||
@set="set" | ||
@success="triggerDataChange" | ||
></PkpForm> | ||
</template> | ||
|
||
<script setup> | ||
import {computed, watch} from 'vue'; | ||
import PkpForm from '@/components/Form/Form.vue'; | ||
import {useFetch} from '@/composables/useFetch'; | ||
import {useForm} from '@/composables/useForm'; | ||
import {useUrl} from '@/composables/useUrl'; | ||
import {useDataChanged} from '@/composables/useDataChanged'; | ||
const props = defineProps({ | ||
formName: {type: String, required: true}, | ||
submission: {type: Object, required: true}, | ||
}); | ||
const relativeUrl = computed(() => { | ||
// its not publication specific, but its under publications endpoint, therefore selecting publication works correctly | ||
return `submissions/${props.submission.id}/publications/${props.submission.publications[0].id}/_components/${props.formName}`; | ||
}); | ||
const {apiUrl: publicationFormUrl} = useUrl(relativeUrl); | ||
const {data: publicationForm, fetch: fetchForm} = useFetch(publicationFormUrl); | ||
watch( | ||
relativeUrl, | ||
() => { | ||
fetchForm(); | ||
}, | ||
{immediate: true}, | ||
); | ||
const {triggerDataChange} = useDataChanged(); | ||
const {set, form} = useForm(publicationForm); | ||
</script> |
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
Oops, something went wrong.