Skip to main content

CnReportsPage

One page that lists every report your app offers, as cards. It is the manifest page type reports. Use it in place of a Reports submenu with one entry per report.

An app has one reports page. For other pages of links, use CnLinkCardsPage.

From the manifest​

{
"id": "Reports",
"route": "/reports",
"type": "reports",
"config": {
"categories": { "operational": "Operational" },
"cards": [
{ "id": "Throughput", "label": "Processing time", "description": "How long cases take, by type.", "category": "operational", "route": "Doorlooptijd" }
]
}
}

A card names a route by name. A card without a route or a label is left out. With more than one category in use, a filter above the cards narrows the list.

Widgets under the cards​

widgets and layout take the shape a type: "dashboard" page takes, and draw as a dashboard grid under the cards. Use them for a report's key figures on the page itself: a card title with a headerLink ("Hele rapportage"), stat tiles with a note as sub-line, and a chart. Without layout, each widget takes a full row. The dashboard is only loaded for a page that declares widgets.

Buttons beside the title​

headerButtons puts buttons beside the title, as board DcRapportages draws "Downloaden". Each is { label, action, variant?, icon?, id? }, and action is the id of a headerActions entry, in the shape an index page uses: a registry handler, navigate with a route, type: "navigate" with a target URL (a new tab), emit, or none. Every click also emits header-action { action, id }, except for none. A button naming an entry with href is a real link instead, which runs and emits nothing (see CnIndexPage). Under the board look the buildiq square sits between the secondary buttons and the primary one. Without headerButtons the header is unchanged.

"config": {
"headerActions": [{ "id": "download", "label": "Download", "handler": "downloadReports" }],
"headerButtons": [{ "label": "Download", "action": "download", "icon": "Download" }]
}

The board look​

Under look: "board" (board DcRapportages) the page draws a 28px title over a muted lead, one section per category headed by its label (cards without a category first, under no heading) instead of the category filter, and two-up cards with the card's icon in a 44px tile, its title at 17px and its description at 14px. The Nextcloud look is unchanged.

Props​

PropTypeDefaultDescription
cardsArraynullThe report cards: { id, label, description?, category?, icon?, route }. icon is drawn in a tile under the board look.
categoriesObjectnullCategory key to label.
titleStringnullThe heading. Defaults to "Reports".
descriptionStringnullThe lead paragraph.
allCategoriesLabelStringnullLabel of the "all categories" filter option.
categoryLabelStringnullLabel of the category filter.
emptyLabelStringnullText shown when the filter admits no card.
widgetsArraynullDashboard widgets drawn under the cards.
layoutArraynullGrid placement of widgets: { id, widgetId, gridX, gridY, gridWidth, gridHeight }.
headerButtonsArraynullButtons beside the title: { label, action, variant?, icon?, id? }, action naming a headerActions entry.
headerActionsArraynullThe actions a header button names, in the index page's header action shape.
lookStringnullboard or nextcloud. Absent: the look CnAppRoot provides.
translateFunctionnullTranslate function. Falls back to the one CnAppRoot provides.
pageObject{}The whole manifest page, for a host that mounts the component itself. The props above win.
catalogueBooleannullIn the board look, draw the catalogue: category chips with counts, article cards and an aside with the category index (manifest config.catalogue). Without it the board look draws its sections.
cardMetaStringnullThe catalogue card's footer line (config.cardMeta), default "Opens a page of its own"; a card's own meta wins.
asideNoteObjectnullThe catalogue aside's closing card (config.asideNote): { title, text }.