Skip to content

Commit

Permalink
pkp/pkp-lib#7495 Expose componentForms from dashboardStore
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Oct 23, 2024
1 parent e1b52d0 commit 006c931
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/managers/ContributorManager/ContributorManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ContributorsListPanel from '@/components/ListPanel/contributors/Contribut
const props = defineProps({
submission: {type: Object, required: true},
publication: {type: Object, required: true},
contributorForm: {type: Object, required: true},
canEdit: {type: Boolean, required: true},
});
Expand Down
7 changes: 6 additions & 1 deletion src/managers/ContributorManager/contributorManagerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {useUrl} from '@/composables/useUrl';
import {useLocalize} from '@/composables/useLocalize';
import {useForm} from '@/composables/useForm';
import {useDataChanged} from '@/composables/useDataChanged';
import {useDashboardPageStore} from '@/pages/dashboard/dashboardPageStore.js';

export const useContributorManagerStore = defineComponentStore(
'contributorManager',
Expand All @@ -15,7 +16,11 @@ export const useContributorManagerStore = defineComponentStore(
`submissions/${props.submission.id}/publications/__publicationId__`,
);

const {form, setLocales} = useForm(props.contributorForm);
const dashboardStore = useDashboardPageStore();

const {form, setLocales} = useForm(
dashboardStore.componentForms.contributorForm,
);

setLocales(props.submission.metadataLocales);

Expand Down
5 changes: 2 additions & 3 deletions src/pages/dashboard/DashboardPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ const props = defineProps({
selectRevisionDecisionForm: {type: Object, required: true},
/** Form for selection type of revision for recommending editor */
selectRevisionRecommendationForm: {type: Object, required: true},
/** Form for Contributor manager */
contributorForm: {type: Object, required: true},
/** Forms used by managers or other components within dashboard/workflow */
componentForms: {type: Object, required: true},
/** List of Views */
views: {
type: Array,
Expand Down Expand Up @@ -102,4 +102,3 @@ const store = useDashboardPageStore(props);
@apply bg-secondary p-0;
}
</style>
./components/DashboardActiveFilters.vue
2 changes: 2 additions & 0 deletions src/pages/dashboard/dashboardPageStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ export const useDashboardPageStore = defineComponentStore(
getReviewActivityIndicatorProps,
getReviewActivityIndicatorPopoverProps,

// Expose component forms, so managers and other dashboard/workflow component can access them
componentForms: pageInitConfig.componentForms,
_workflowActionFns,
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ export const PublicationConfig = {
props: {
submission: submission,
publication: selectedPublication,
contributorForm: pageInitConfig.contributorForm,
},
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ export const PublicationConfig = {
props: {
submission: submission,
publication: selectedPublication,
contributorForm: pageInitConfig.contributorForm,
},
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,6 @@ export const PublicationConfig = {
props: {
submission: submission,
publication: selectedPublication,
contributorForm: pageInitConfig.contributorForm,
canEdit: permissions.canEditPublication,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ export const PublicationConfig = {
props: {
submission: submission,
publication: selectedPublication,
contributorForm: pageInitConfig.contributorForm,
canEditPublication: permissions.canEditPublication,
},
},
Expand Down

0 comments on commit 006c931

Please sign in to comment.