Ga naar hoofdinhoud

CnStatsBlockWidget

Manifest-driven dashboard widget that pulls a count from OpenRegister's GraphQL endpoint and forwards it to CnStatsBlock for rendering. Mounted automatically by CnDashboardPage when a widget definition has type: 'stats-block'.

Manifest example

{
"id": "minutes-in-review",
"type": "stats-block",
"title": "Notulen ter goedkeuring",
"iconClass": "icon-file",
"props": { "countLabel": "notulen", "variant": "warning" },
"dataSource": {
"register": "decidesk",
"schema": "minutes",
"filter": { "lifecycle": "review" },
"aggregate": "count"
}
}

Props

PropTypeDefaultDescription
dataSourceobjectrequiredManifest dataSource block. See useDataSource.
titlestring''Block title.
countLabelstring''Label next to the count.
variant'default'|'primary'|'success'|'warning'|'error''default'Color variant.
showZeroCountbooleantrueShow 0 instead of the empty-label fallback.
horizontalbooleanfalseHorizontal layout.
routeobject|nullnullVue-router location; when set, the inner card becomes a <router-link>.

Notes

  • Designed only for the manifest path. If you already have a count number in JS, mount CnStatsBlock directly.
  • Errors from the underlying GraphQL request fall back to count = 0. The dashboard never blanks on a transport failure.