diff options
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/rfcProps.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/models/rfcProps.js b/src/models/rfcProps.js index 13ec5bb0..861d74b0 100644 --- a/src/models/rfcProps.js +++ b/src/models/rfcProps.js @@ -21,6 +21,7 @@ */ import { VCardTime } from 'ical.js' import { loadState } from '@nextcloud/initial-state' +import { otherContacts } from '../utils/chartUtils' import ActionCopyNtoFN from '../components/Actions/ActionCopyNtoFN' import ActionToggleYear from '../components/Actions/ActionToggleYear' @@ -226,7 +227,25 @@ const properties = { readableName: t('contacts', 'Manager'), icon: 'icon-category-monitoring', default: false, - options: [], + options({ contact, $store, selectType }) { + // Only allow contacts of the same address book + const contacts = otherContacts({ + $store, + self: contact, + }) + + // Reduce to an object to eliminate duplicates + return Object.values(contacts.reduce((prev, { key }) => { + const contact = $store.getters.getContact(key) + return { + ...prev, + [contact.uid]: { + id: contact.key, + name: contact.displayName, + }, + } + }, selectType ? { [selectType.value]: selectType } : {})) + }, }, 'x-socialprofile': { multiple: true, |