Skip to main content

CnTaskFormDialog

A dialog that shows the form an OpenRegister task asks a person to fill in and completes the task with what they typed. It reads GET /api/flow-tasks/{uuid} (or takes the answer as task), loads the subject schema and object, and scopes CnFormDialog to the declared, renderable fields in the declared order, each required exactly when the declaration says so.

<CnTaskFormDialog taskUuid="…" outcome="approved" @completed="reload" @close="open = false" />

States​

  • form: null: a comment field only.
  • ready: the declared fields.
  • broken: the same, plus one disabled row per field the schema no longer offers, with the server's reason. Confirm stays enabled unless a broken field is required (the row then says the person who set up the step has to fix it).
  • unresolvable, or an external form that is unavailable: the server's error and no form; Confirm is disabled.

Completing​

With submit (the default) Confirm posts { outcome, comment, data } to /api/flow-tasks/{uuid}/complete and emits completed. A 400 keeps the dialog open with every typed value: an empty named field is marked required, a filled one refused, and a field the dialog did not offer is named in the top message. A checklist, unresolvable or no-subject refusal shows only the error. With submit false it emits confirm with { outcome, comment, data } and the parent reports back through setResult().

The flow editor (CnFlowDetail) flags a user-task step whose declared form names a field the trigger's schema dropped, made read-only or hid.

Props​

taskUuid, task, outcome (default done), submit (default true), dialogTitle (dialog-title, defaults to the task title) and apiBase (api-base, default /apps/openregister/api).

OpenRegister reliance​

heavy: this component cannot work without OpenRegister. 1 direct reference, 109 files reached through imports.

Through: CnAnalyticsReportPicker, CnAuditTrailCard, CnBookmarkPicker, CnCalendarEventCreate, CnCalendarEventPicker, CnChildRecordsField, CnCollectivePageCreate, CnCollectivePagePicker, CnContactPicker, CnCospendCreate, CnCospendPicker, CnDataTable, CnDeckCardCreate, CnDeckCardPicker, CnEmailPicker, CnFilesCard, CnFkResolveCell, CnFlowOperationPicker, CnFormDialog, CnIndexPage, CnMapPoiPicker, CnNoteComposer, CnNotesCard, CnObjectSidebar, CnOpenProjectCreate, CnOpenProjectPicker, CnPhotoAlbumPicker, CnPollPicker, CnResourceSelect, CnTagsCard, CnTalkRoomPicker, CnTasksCard, CnTimeTrackerCreate, CnTimeTrackerPicker, CnVersionHistory, CnXwikiPageCreate, CnXwikiPagePicker.

See the reliance overview for the filterable list.

Props​

NameTypeRequiredDefaultDescription
taskUuidstring''UUID of the task. Fetched when task is not given.
taskunionnullThe answer of GET /api/flow-tasks/{uuid} already fetched; skips the fetch.
outcomestring'done'The outcome sent on completion.
submitbooleantruePost to /complete on Confirm. With false, emit confirm and let the parent persist.
dialogTitlestring''Dialog title. Defaults to the task title.
apiBasestring'/apps/openregister/api'Base URL of the OpenRegister API.

Events​

NamePayloadDescription
close—Emitted when the dialog should close.
completed—Emitted with the completed task row after the server accepts the completion.
confirm—Emitted on Confirm when submit is false. Report back through setResult().

Methods​

NameDescription
setResultReport the outcome when submit is false.