Ga naar hoofdinhoud

CnRegisterMapping

OpenRegister register/schema configuration panel. Lets admin users map app object types to OpenRegister registers and schemas. Groups related object types together, shows a register dropdown (with auto-schema-matching), and a save/reimport action area.

Wraps: NcSelect, NcNoteCard, NcButton, NcLoadingIcon (via CnSettingsSection)

Try it

Loading CnRegisterMapping playground…

CnRegisterMapping showing register and schema dropdowns for each entity type

Props

PropTypeDefaultDescription
groupsArray(required)Groups of object types that share a register. Each group: { name, description?, registerConfigKey?, types: [{ slug, label, description?, configKey? }] }
nameString'Register configuration'Section title
descriptionString'Configure OpenRegister schema mappings for your object types'Section description
docUrlString''Documentation URL — shows an info icon next to the title
configurationObject{}Current configuration values keyed by config key: { register: '5', client_schema: '28', ... }
showSaveButtonBooleantrueWhether to show the Save button
savingBooleanfalseWhether a save is in progress
showReimportButtonBooleanfalseWhether to show the Re-import button
reimportingBooleanfalseWhether a reimport is in progress
saveButtonTextString'Save configuration'Save button label
reimportButtonTextString'Re-import configuration'Re-import button label
autoMatchBooleantrueWhen a register is selected, automatically match schema titles to object type slugs
labelsObject{ register, schema, configured, notConfigured, noSchemas, selectRegister, selectSchema, allConfigured, partiallyConfigured }Override UI strings (all default to translated English)

Events

EventPayloadDescription
update:configurationconfigurationEmitted when any register or schema selection changes (use with .sync or v-model)
saveSave button clicked
reimportRe-import button clicked

Slots

SlotDescription
#actionsExtra action buttons rendered alongside Save/Re-import
#group-headerCustom header content for each group (scoped: { group })
#footerFooter content below the configuration section

Usage

<CnRegisterMapping
:groups="[
{
name: 'Client management',
registerConfigKey: 'client_register',
types: [
{ slug: 'client', label: 'Clients', configKey: 'client_schema' },
{ slug: 'contact', label: 'Contacts', configKey: 'contact_schema' },
],
},
]"
:configuration="settings"
:saving="saving"
@update:configuration="settings = $event"
@save="onSave" />

This component is typically used in the admin settings page of an app to let administrators configure which OpenRegister registers and schemas map to each entity type.

Reference (auto-generated)

The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnRegisterMapping.vue and update automatically whenever the component changes.

Props

NameTypeRequiredDefaultDescription
namestring() =&gt; t('nextcloud-vue', 'Register configuration')Section title
descriptionstring() =&gt; t('nextcloud-vue', 'Configure OpenRegister schema mappings for your object types')Section description
docUrlstring''Documentation URL
groupsArray<{ name: string, description: string, registerConfigKey: string, types: Array<{ slug: string, label: string, description: string, configKey: string }> }>Groups of object types that share a register.
configurationobject\{\}Current configuration values: { register: '5', client_schema: '28', ... }
showSaveButtonbooleantrueShow save button
savingbooleanfalseWhether save is in progress
showReimportButtonbooleanfalseShow reimport button
reimportingbooleanfalseWhether reimport is in progress
saveButtonTextstring() =&gt; t('nextcloud-vue', 'Save configuration')Save button text
reimportButtonTextstring() =&gt; t('nextcloud-vue', 'Re-import configuration')Reimport button text
autoMatchbooleantrueAuto-match schema titles to type slugs on register change
labelsobject\{ register: t('nextcloud-vue', 'Register'), schema: t('nextcloud-vue', 'Schema'), configured: t('nextcloud-vue', 'Configured'), notConfigured: t('nextcloud-vue', 'Not configured'), noSchemas: t('nextcloud-vue', 'No schemas available in this register'), selectRegister: t('nextcloud-vue', 'Select a register'), selectSchema: t('nextcloud-vue', 'Select a schema'), allConfigured: t('nextcloud-vue', 'All types configured'), partiallyConfigured: t('nextcloud-vue', 'configured') \}UI labels (i18n)

Events

NamePayloadDescription
reimport
update:configuration
save

Slots

NameBindingsDescription
actions
group-headergroup, configured-count, total-count
footer