{
- if (item.hasOwnProperty('cached')) {
- return item.cached
- } else if (item.hasOwnProperty('person_attributes')) {
- return `${item.person_attributes?.last_name}, ${item.person_attributes?.first_name}`
- } else {
- return `${item.last_name}, ${item.first_name}`
- }
- })
+ return list.map(
+ (item) =>
+ item.cached ||
+ (item.person_attributes &&
+ `${item.person_attributes?.last_name}, ${item.person_attributes?.first_name}`) ||
+ item.name ||
+ `${item.last_name}, ${item.first_name}`
+ )
},
applyAttr() {
diff --git a/app/javascript/vue/tasks/images/new_image/components/Panel/PanelCopyrightHolder.vue b/app/javascript/vue/tasks/images/new_image/components/Panel/PanelCopyrightHolder.vue
index 8c0590149e..f054e3320a 100644
--- a/app/javascript/vue/tasks/images/new_image/components/Panel/PanelCopyrightHolder.vue
+++ b/app/javascript/vue/tasks/images/new_image/components/Panel/PanelCopyrightHolder.vue
@@ -12,17 +12,9 @@
v-model="view"
/>
-
@@ -40,7 +32,6 @@
import BlockLayout from '@/components/layout/BlockLayout.vue'
import VSwitch from '@/components/switch'
import RolePicker from '@/components/role_picker'
-import VAutocomplete from '@/components/ui/Autocomplete'
import { ROLE_ATTRIBUTION_COPYRIGHT_HOLDER } from '@/constants'
import { GetterNames } from '../../store/getters/getters.js'
import { MutationNames } from '../../store/mutations/mutations.js'
@@ -69,14 +60,4 @@ const year = computed({
})
const view = ref('Someone else')
-
-function setOrganization(organization) {
- rolesAttributes.value = [
- {
- type: ROLE_ATTRIBUTION_COPYRIGHT_HOLDER,
- label: organization.label,
- organization_id: organization.id
- }
- ]
-}
diff --git a/app/javascript/vue/tasks/images/new_image/components/Panel/PanelOwner.vue b/app/javascript/vue/tasks/images/new_image/components/Panel/PanelOwner.vue
index d4ff742d2f..78e59c1226 100644
--- a/app/javascript/vue/tasks/images/new_image/components/Panel/PanelOwner.vue
+++ b/app/javascript/vue/tasks/images/new_image/components/Panel/PanelOwner.vue
@@ -3,6 +3,7 @@
v-model="owners"
:role-type="ROLE_ATTRIBUTION_OWNER"
title="Owner"
+ organization
/>
diff --git a/app/javascript/vue/tasks/images/new_image/components/PeopleSelector.vue b/app/javascript/vue/tasks/images/new_image/components/PeopleSelector.vue
index 14b9407695..e765a0cfac 100644
--- a/app/javascript/vue/tasks/images/new_image/components/PeopleSelector.vue
+++ b/app/javascript/vue/tasks/images/new_image/components/PeopleSelector.vue
@@ -4,18 +4,34 @@
{{ title }}
-
+
+
+
+
diff --git a/app/javascript/vue/tasks/images/new_image/store/actions/applyAttibutions.js b/app/javascript/vue/tasks/images/new_image/store/actions/applyAttibutions.js
index 9361fb81e0..f77ce18b2a 100644
--- a/app/javascript/vue/tasks/images/new_image/store/actions/applyAttibutions.js
+++ b/app/javascript/vue/tasks/images/new_image/store/actions/applyAttibutions.js
@@ -56,7 +56,7 @@ export default ({ state, commit }) => {
license: state.license,
attribution_object_type: item.base_class,
attribution_object_id: item.id,
- roles_attributes: roles
+ roles_attributes: attributionRoles
}
const attributionCreated = state.attributionsCreated.find(
@@ -67,8 +67,11 @@ export default ({ state, commit }) => {
const createdRolesList = getRoleList(attributionCreated)
const newRoles = attributionRoles.filter(
(item) =>
- !createdRolesList.find(
- (role) => !!item?.person_id && role.person.id === item.person_id
+ !createdRolesList.some(
+ (role) =>
+ (!!item?.person_id && role.person?.id === item?.person_id) ||
+ (role.organization &&
+ role.organization.id === item.organization_id)
)
)
diff --git a/app/javascript/vue/tasks/sources/filter/components/bibtex.vue b/app/javascript/vue/tasks/sources/filter/components/bibtex.vue
index 8534e9e5db..2adad51902 100644
--- a/app/javascript/vue/tasks/sources/filter/components/bibtex.vue
+++ b/app/javascript/vue/tasks/sources/filter/components/bibtex.vue
@@ -1,15 +1,15 @@
Bibtex
@@ -34,7 +34,7 @@
-