Ga naar hoofdinhoud

CnContactCreate

Modal dialog for creating a brand-new CardDAV contact + linking it to an OpenRegister object in a single step (Tier-2 of the contacts integration leaf).

The dialog itself does NOT perform the create — it emits a create event with the form payload. The parent (typically CnContactsTab) POSTs /api/objects/{r}/{s}/{id}/contacts/new and on success closes the dialog + refreshes the linked-contacts list.

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

Usage

<CnContactCreate
v-if="showCreate"
:loading="createLoading"
@create="onCreateSubmit"
@close="showCreate = false" />

Form fields

FieldRequiredNotes
displayNameyesShown in the contact list. Trimmed; whitespace-only is rejected.
emailnoValidated against a basic local@host.tld regex.
phonenoFree-text.
orgnoPrimary organisation.
rolenoPicked from a dropdown (Applicant/Handler/Advisor/Other) or freeform.

Events

EventPayloadDescription
create{displayName, email, phone, org, role}Emitted when the user submits a valid form.
closeEmitted on cancel or close.

Form & label props

PropTypeDescription
titleStringDialog title.
displayNameLabelStringLabel for the display-name field.
displayNameHelperStringHelper text under the display-name field.
emailLabelStringLabel for the email field.
emailHelperStringHelper text under the email field.
phoneLabelStringLabel for the phone field.
orgLabelStringLabel for the organisation field.
roleLabelStringLabel for the role field.
cancelLabelStringCancel button label.
confirmLabelStringConfirm/create button label.
displayNameRequiredMsgStringValidation message when the display name is empty.
emailInvalidMsgStringValidation message for an invalid email.
roleOptionsArraySelectable role options for the role field.