Ga naar hoofdinhoud

CnSetupWizard

Abstract, manifest-driven first-time setup wizard (ADR-042). Wraps CnWizardDialog and renders a manifest.setup.steps[] array by each step's type, reusing the same field components the admin pages use. It is the second modal in the first-open flow (after the "help us" modal), and is also openable from the admin page via CnAdminSettingsShell.

It NEVER writes OpenRegister objects from the browser — OpenRegister enforces RBAC on saveObject, so all persistence goes through a per-app server contract (POST /apps/{appId}/api/setup/config and /api/setup/action/{actionId}), which runs privileged. CnAppRoot's setup phase gates the app shell while a required step is unmet.

Step types

typeRendersPersists via
infoa note card (title + body)
config-fieldsfields from a JSON Schema (fieldsFromSchema)POST /api/setup/config
choicean NcSelect bound to configKey (options[], multiple?)POST /api/setup/config
run-actiona "Run" button → POST /api/setup/action/{action} + resultthe action itself
summarya recap of step completion
componentthe parent's #step-<id> slot (escape hatch)up to the slot

Try it

<template>
<CnSetupWizard
:app-id="'procest'"
:steps="manifest.setup.steps"
@action-result="onActionResult"
@complete="onComplete"
@close="show = false" />
</template>

Props

PropTypeDefaultDescription
appIdstring— (required)App id; builds the /apps/{appId}/api/setup/* URLs.
stepsArray[]The manifest.setup.steps array to render.
dialogTitlestring"Set up this app"Dialog header.
submitLabelstring"Finish"Final-step submit label.
cancelLabelstring"Cancel"Cancel label.
nextLabelstring"Next"Next label.
backLabelstring"Back"Back label.
runLabelstring"Run"Run-action button label.
successTextstring"Setup complete."Result-phase success text.

Events

EventPayloadWhen
completeThe last step was submitted (setup finished).
action-result{ stepId, action, success, message }A run-action step finished.
step-change{ stepId, stepIndex, direction }The active step changed.
closeThe dialog should close.

Slots

  • #step-{id} — override a step's body (for component steps or any bespoke step). Scope: the CnWizardDialog step scope plus { step, runAction, saveConfig }.

See also