Ga naar hoofdinhoud

CnContactPicker

Modal dialog for selecting an existing CardDAV contact to link to an OpenRegister object (Tier-2 of the contacts integration leaf — see ADR-019).

Search is hit-as-you-type against the OR-side contact search endpoint (GET {apiBase}/contacts/search?q=<term>) which proxies CardDAV via OCP\Contacts\IManager. Each row shows the avatar + display name + primary email. A role dropdown (Applicant / Handler / Advisor / Other or freeform) tags the link before confirming.

Lives in its own .vue file under src/components/CnContactPicker/ per ADR-004 (modal isolation).

Usage

<CnContactPicker
v-if="showPicker"
:api-base="apiBase"
@link="onPickerLink"
@close="showPicker = false" />

The parent (typically CnContactsTab) handles the actual POST to /api/objects/{r}/{s}/{id}/contacts and the list refresh.

Props

PropTypeDefaultDescription
apiBaseString/apps/openregister/apiBase path for the OR REST API.
titleStringLink contactDialog title.
roleOptionsArrayApplicant/Handler/Advisor/OtherRole dropdown choices.

Events

EventPayloadDescription
link{contactUid, addressbookId, contactUri, displayName, email, role}Emitted when the user confirms a selection.
closeEmitted on cancel or close.

Label props

All optional, pre-translated overrides:

PropTypeDescription
searchLabelStringA11y label for the search field.
searchPlaceholderStringPlaceholder for the search field.
emptyLabelStringTitle for the empty/no-results state.
emptyDescriptionStringDescription for the empty/no-results state.
unknownLabelStringFallback label for a contact with no display name.
roleLabelStringLabel for the contact role field.
cancelLabelStringCancel button label.
confirmLabelStringConfirm/link button label.