diff --git a/frontend/src/modules/contributor/components/edit/affilations/contributor-affilations-edit-item.vue b/frontend/src/modules/contributor/components/edit/affilations/contributor-affilations-edit-item.vue index 004a8fab7c..8c4740fcee 100644 --- a/frontend/src/modules/contributor/components/edit/affilations/contributor-affilations-edit-item.vue +++ b/frontend/src/modules/contributor/components/edit/affilations/contributor-affilations-edit-item.vue @@ -1,6 +1,6 @@ @@ -105,6 +119,8 @@ import LfContributorEditAffilationsItem import useVuelidate from '@vuelidate/core'; import Message from '@/shared/message/message'; import moment from 'moment'; +import LfDropdown from '@/ui-kit/dropdown/Dropdown.vue'; +import LfDropdownItem from '@/ui-kit/dropdown/DropdownItem.vue'; const props = defineProps<{ modelValue: boolean, @@ -177,6 +193,21 @@ const isProjectInvalid = (projectId: string) => form.value.some((affiliation) => const hasFormChanged = computed(() => JSON.stringify(form.value) !== JSON.stringify(initialForm.value)); +const copyToOtherProjects = (index: number) => { + const affiliation = form.value[index]; + const otherProjects = props.contributor.segments.filter((seg) => seg.id !== affiliation.segmentId); + + otherProjects.forEach((project) => { + form.value.push({ + segmentId: project.id, + organization: affiliation.organization, + dateStart: affiliation.dateStart, + dateEnd: affiliation.dateEnd, + currentlyAffiliated: affiliation.currentlyAffiliated, + }); + }); +}; + onMounted(() => { form.value = props.contributor.affiliations.map((affiliation) => ({ segmentId: affiliation.segmentId || '',