CnAuditTrailCard
Compact audit-trail widget for the pluggable integration registry. Fetches the most recent audit-trail entries for an OpenRegister object (query-time storage strategy) and renders them inside a CnDetailCard. Surface-aware shell around the audit-trail integration: handles user-dashboard, app-dashboard, detail-page, and single-entity from a single component.
Wraps: CnDetailCard
Try it
Usage
<CnAuditTrailCard
:register="registerId"
:schema="schemaId"
:object-id="objectId"
surface="detail-page"
@show-all="openAuditTrailTab" />
Pass pre-translated labels when your app handles i18n:
<CnAuditTrailCard
:register="reg"
:schema="schema"
:object-id="id"
:no-entries-label="t('myapp', 'No audit entries yet')"
:show-all-label="t('myapp', 'Show all')" />
Display props
| Prop | Type | Default | Notes |
|---|---|---|---|
title | String | '' | Override the card title (defaults to the translated label). |
maxDisplay (max-display) | Number | 5 | Maximum rows to render. |
layout | String | '' | stacked (DqTaak "Historie"): the action, then one muted line under it with the moment ("6 okt 09:05") and who, when the action does not already name them. Empty: the moment beside the action, who under it. |
density | String | '' | compact (DqZaaktype "Historie"): the rows closer together, a stacked row 10px above and below in the board look instead of 12px. The audit-trail widget reads it from content.density. |
excludeActions (exclude-actions) | Array | [] | Actions left out, case-insensitive (['read'] for a history of what changed). The card then reads up to ten times maxDisplay entries (at most 100), so the rows it leaves out do not crowd the rest away. |
excludeActors (exclude-actors) | Array | [] | Actors left out by user id, case-insensitive (['System'] for a history of what people did): the bookkeeping a background job writes is not shown. |
collapsible | Boolean | false | Whether the card collapses. |
actionLabel (action-label) | String | t('nextcloud-vue', 'Change') | Pre-translated fallback action label. |
apiBase (api-base) | String | '/apps/openregister/api' | Base API URL. |
refusedLabel (refused-label) | String | t('nextcloud-vue', '(refused)') | Shown on an entry the server refused (authorized: false). |
failedLabel (failed-label) | String | t('nextcloud-vue', 'The history could not be loaded') | Shown when a source or endpoint read failed. |
footnote | String | '' | A muted line under the trail, inside the card ("Kenmerk ZT-OMV-REG"). |
A flow task, or another source
| Prop | Type | Default | Description |
|---|---|---|---|
source | Object | null | { kind: 'flow-task', id } reads {apiBase}/flow-tasks/{id}/audit, the task engine's own trail. id may be left out or written @objectId. |
actionLabels | Object | null | What happened, in words: by action (claim) or by action and the state it led to (complete:completed, tried first). {actor}, {state} and {changed.<key>} (a value the entry recorded, in the words of valueLabels) are filled in, and a label that names the actor leaves it off the line under it. An action without a label shows as written, with its state in brackets. DqTaak: { "claim": "Task picked up by {actor}" }. |
changeLabels | Array | [] | Words for an entry by what it changed: [{ action?, field, to?, label }], the first whose field the entry changed (to to, when given) wins over actionLabels. A label fills the same tokens, plus {object.<path>} from object ("Version {object.version} published" for isDraft set to false). |
valueLabels | Object | null | Words for the values a label quotes as {changed.<key>}: { "purpose": { "handling": "Handling" } }. A value without words shows as written. |
relatedSources | Array | [] | Records beside the object whose events join its history: [{ as, register, schema, filter, limit? }]. The card lists the objects matching filter (@objectId is this object, at most limit, default 5), reads their trails and merges the entries with the object's own, newest first; a related entry is labelled by actionLabels["<as>.<action>"] first. A related read that fails leaves only its entries out. DqSociaalDomein: { as: "consent", schema: "toestemming", filter: { caseId: "@objectId" } }. |
endpoint | String | '' | A trail URL of its own; {id} is filled with the source's id or objectId. |
order | String | '' | newest or oldest first. Empty reads a source oldest first and an object newest first. |
A row shows the action with the state it led to (stateAfter), the actor, the kind of performer when it is not a person (performerType), on whose behalf (onBehalfOf), "(refused)" for authorized: false, and the entry's reason. A failed read says so instead of showing an empty trail.
Reference
OpenRegister reliance
medium: this component relies on OpenRegister for part of what it does. 1 direct reference, 8 files reached through imports.
See the reliance overview for the filterable list.
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
footnote | string | '' | A muted line under the trail, inside the card ("Kenmerk ZT-OMV-REG"). | |
register | string | '' | OpenRegister register id (slug or uuid). Optional for scope: "app". | |
schema | string | '' | OpenRegister schema id (slug or uuid). Optional for scope: "app". | |
objectId | string | '' | Parent object id. Required for scope: "object" (the default); unused for scope: "app". | |
scope | string | 'object' | What the card lists. object (the default) is one object's trail and needs register, schema and objectId. app is the app-wide feed: the entries of every object the caller may read (OpenRegister's /audit-trails/readable), narrowed to register and schema when those are set. | |
surface | string | 'detail-page' | Rendering surface — passed for AD-19 surface fallback consumers. | |
apiBase | string | '/apps/openregister/api' | Base API URL. | |
source | union | null | Read the trail of something that is not an OpenRegister object: { kind: 'flow-task', id } reads \$\{apiBase}/flow-tasks/{id}/audit, oldest first. id may be left out or written @objectId. | |
endpoint | string | '' | A trail URL that replaces the object's own; {id} is filled with the source's id or objectId. | |
order | string | '' | newest first (the object trail's order) or oldest first; empty takes oldest for a source and newest otherwise. | |
maxDisplay | number | 5 | Maximum rows to render. | |
layout | string | '' | stacked (DqTaak "Historie"): the action, then one muted line under it with the moment ("6 okt 09:05") and who, when the action does not already name them. Default: the moment beside the action, who under it. dated (PqJourney "Geschiedenis"): a two-column list, the short date ("2 okt") beside what happened; who shows only where the action's label names them ({actor}). | |
density | string | '' | compact draws the rows closer together: in the board look a stacked row 10px above and below (DqZaaktype "Historie") instead of 12px (DqTaak). Default: the layout's own spacing. | |
excludeActions | array | [] | Actions the card leaves out (case-insensitive), such as ['read'] for a history of what changed. It then reads more entries than it shows, so the rows it leaves out do not crowd the rest away. | |
excludeActors | array | [] | Actors the card leaves out by user id (case-insensitive), such as ['System'] for a history of what people did: the bookkeeping a background job writes is not shown. | |
collapsible | boolean | false | Whether the card collapses. | |
title | string | '' | Override the card title (defaults to the translated label). | |
noEntriesLabel | string | () => t('nextcloud-vue', 'No audit entries yet') | Pre-translated empty label. | |
showAllLabel | string | () => t('nextcloud-vue', 'Show all') | Pre-translated overflow label. | |
actionLabel | string | () => t('nextcloud-vue', 'Change') | Pre-translated fallback action label. | |
refusedLabel | string | () => t('nextcloud-vue', '(refused)') | Shown on an entry the server refused (authorized: false). | |
actionLabels | Object<string, string>|null | null | What happened, in words, by action (claim) or by action and the state it led to (complete:completed, tried first). {actor}, {state} and {changed.<key>} (a value the entry recorded, a dotted key reading into it such as {changed.data.fileName}, in the words of valueLabels) are filled in; a label that names the actor leaves it off the line under it. An action without a label shows as written. | |
valueLabels | {[key: string]: {[value: string]: string}}|null | null | Words for the values an action label quotes as {changed.<key>}: { purpose: { handling: 'Handling' } }. A value without an entry shows as written. | |
changeLabels | Array<{action?: string, field: string, to?: unknown, label: string}> | [] | What happened, in words, by the field an entry changed: rules [{ action?, field, to?, label }], the first whose field the entry changed (to to, when given) wins over actionLabels. A label fills the same tokens, plus {object.<path>} from object ("Version {object.version} published" for isDraft set to false). | |
object | object | null | The audited record, for {object.<path>} in a label; null without one. | |
relatedSources | Array<{as: string, register: string, schema: string, filter?: object, limit?: number}> | [] | Records beside the object whose events belong in its history: [{ as, register, schema, filter, limit? }]. The card lists the objects matching filter (@objectId is this object; at most limit, default 5), reads their trails and merges the entries with the object's own, newest first. A related entry is labelled by actionLabels["<as>.<action>"] first. Object scope only. | |
failedLabel | string | () => t('nextcloud-vue', 'The history could not be loaded') | Shown when a source or endpoint read failed. |
Events
| Name | Payload | Description |
|---|---|---|
show-all | — |
The app-wide feed (scope: "app")
| Prop | Type | Default | Description |
|---|---|---|---|
scope | String | 'object' | object lists one object's trail and needs register, schema and objectId. app lists the reader's whole feed: the entries of every object the caller may read (OpenRegister's /audit-trails/readable), narrowed to register and schema when set, with no object. |
The built-in audit-trail widget (CnAuditTrailWidget) takes the same scope as a prop or as content.scope, so a dashboard can declare { "widgetKey": "audit-trail", "props": { "content": { "scope": "app", "title": "Recent activity", "register": "dossiq" } } }.