Skip to main content

CnContactsTab

Sidebar tab for the contacts integration leaf. Renders the vCard contacts linked to an OpenRegister object grouped by role (Applicants / Handlers / Advisors / Other). Backed by ContactService + ContactsProvider via the OR REST surface /api/objects/{r}/{s}/{id}/contacts.

Tier-2: the tab hosts two header actions — Link existing contact (opens CnContactPicker) and Add new contact (opens CnContactCreate). Both dialogs delegate the actual API call back to the tab so the loading + refresh handshake stays here.

Usage​

<CnContactsTab
:object-id="objectId"
:register="registerId"
:schema="schemaId" />

People on objects​

Since the people-on-objects change a linked person is a Nextcloud user or a vCard contact, and the listing carries more than a flat list:

  • byRole groups the people the way the server sees them. When it is present the tab renders those groups in that order, labelled by the schema's vocabulary; when it is absent the tab keeps its own buckets (Applicants / Handlers / Advisors / Other).
  • roles is the schema's linkRoles vocabulary. The tab passes it to the picker as roleOptions, so a handler picks a declared role instead of typing one.
  • kind says user or contact, active says whether today falls inside the link's validity window, and validFrom / validUntil / note describe it. A link that is not active keeps its row and gains a badge, because a past handler is still a fact about the object.
  • Removing a row removes that role, not the person: the tab sends DELETE …/contacts/{contactUid}?role=<role>, since one person may hold several roles on one object.

Props​

PropTypeDefaultDescription
objectIdString—(required) The OR object's UUID.
registerString''The register slug or numeric id.
schemaString''The schema slug or numeric id.
apiBaseString/apps/openregister/apiBase path for the OR REST API.
linkExistingLabelStringLink contactHeader button label.
addNewLabelStringlook's ownLabel of the create button; empty takes the look's own: "New contact" in the board look, "Add new contact" in the Nextcloud look. In the board look the buttons read Link contact then New contact, both outlined; in the Nextcloud look Add new contact comes first and Link contact is the primary.

Events​

EventPayloadDescription
open-reverse-lookup{contactUid, displayName}Emitted when a contact row is clicked. Consumers route this into the reverse-lookup flyout.