Ga naar hoofdinhoud

CnReadinessChecklist

A list of the things an instance needs, each with its state in words (Done, Still open, Unknown), an explanation, and a link to the screen that fixes it. Reported, never gated: nothing in the list blocks the app. Used for a first-run list and a prerequisites list on an admin page.

The state is always a word with a colour beside it, never a colour alone (WCAG 1.4.1).

Props​

PropTypeDefaultDescription
itemsArray[]The items: { id, label, explanation?, met, fixHref?, failure?, group?, blocking? }. met is true, false or null (unknown). With fixHref the label links to the screen that fixes it. failure says why an item could not be read
sourceString''An app path to read the items from (/apps/<app>/api/setup/status), resolved with generateUrl. Read on mount and again when the window regains focus, so a fix made on another screen shows on return
itemsPathString'items'Where the items sit in the answer (a bare array is taken as is)
fieldsObject{}Item key to row key, over the defaults: { label: 'title', explanation: 'body', met: 'done', fixHref: 'screen' }
groupsArray[]Headings for grouped items, in order: [{ id, title }]. Items without a known group come first, without a heading
descriptionString''A line above the list
statusLabelsObject{}The words per state: { met, unmet, unknown } (e.g. present and missing)
emptyTextString''Said when there is nothing to check
errorTextString''Said when the source could not be read
blockingTextString''Said before the unmet items marked blocking ("Cannot run until this is installed:")

Texts the page declares go through the host's cnTranslate.

Events​

EventPayloadDescription
loadedthe answerThe source answered; a host can read more from it (a note under the list)

Example​

<CnReadinessChecklist
source="/apps/myapp/api/setup/status"
itemsPath="readiness"
:fields="{ label: 'title', explanation: 'body', met: 'done', fixHref: 'screen' }" />