Skip to main content

CnViewPresentationPicker

Choose how a saved view shows: a table, a board grouped by a status field, or a calendar by a date field. It takes the view's JSON schema and a presentation value, and emits input with a presentation in OpenRegister's shape only:

{ viewType: 'table' }
{ viewType: 'kanban', kanban: { groupByField, cardFields?, columnOrder? } }
{ viewType: 'calendar', calendar: { dateField, endDateField? } }

Each field picker offers only the schema properties that can serve its role (the server stays the authority):

RoleOffered properties
kanban.groupByFielda string property with an enum, the property the schema's x-openregister-lifecycle names as its state, or a relation to one object ($ref)
kanban.cardFieldsany scalar property, at most four
kanban.columnOrderthe values of the chosen groupByField enum, reorderable with Move up and Move down buttons; hidden when the field has no enum. Emitted only once the order is changed.
calendar.dateField, calendar.endDateFielda property with format date or date-time

A type whose required role has no candidate is disabled with the reason ("This schema has no date field"). Switching type drops the other type's settings, so a board turned back into a table emits { viewType: 'table' } and no stale kanban block. Every select carries an input label.

CnSaveViewDialog (with a schema) and CnSavedViewPresentationDialog carry it. isPresentationComplete(presentation) and presentationCandidates(schema) live in utils/presentationCandidates.js.

<CnViewPresentationPicker :schema="schema" :value="presentation" @input="presentation = $event" />

Props​

PropTypeDefaultDescription
schemaObjectnullThe view's JSON Schema (with properties), which decides what each role offers.
valueObject{ viewType: 'table' }The current presentation, in OpenRegister's shape. Empty reads as a table.
disabledBooleanfalseDisable every control.
errorsObject{}A refusal message per path (kanban.groupByField, calendar.dateField, calendar.endDateField), shown under the picker it is about.

Events​

EventPayloadDescription
inputobjectThe presentation in OpenRegister's shape.