Skip to content

Show appointments and deadlines in a calendar

Use the calendar layout component to show real records as events. This minimal appointments module and index layout use the documented date-range field and title recipe. The syntax is code-verified; this particular UI composition has not been executed here.

Copy the Bakery definitions into the system directory, inspect php bakery plan <system>, then apply them in a disposable preview with php bakery apply <system>. A client must already exist.

modules/appointments/appointments.module.bake.json:

[
{
"resource_module": "appointments",
"resource": {
"identifier": "appointments",
"title": "name",
"fields": [
{
"identifier": "name",
"type": "text"
},
{
"identifier": "period",
"type": "dateRange"
}
],
"layouts": {
"index": "/modules/appointments/appointments.index"
}
}
}
]

modules/appointments/appointments.index.json:

{
"tabs": [
{
"identifier": "general",
"rows": [
{
"cols": [
{
"span": 24,
"components": [
{
"type": "calendar",
"options": {
"events": [
{
"identifier": "appointments",
"module": "appointments",
"field": "period",
"recipes": {
"title": "this.name"
}
}
]
}
}
]
}
]
}
]
}
]
}

Each event type maps a module and date/date-time/date-range field into a calendar. recipes.title supplies the visible event text. Open /appointments; grant the actor read/write access as appropriate. Add event types for other modules when needed. Calendar permissions still come from the underlying records.

Create an appointment fixture with start/end timestamps and assert its saved period with workflow field_equals or entity_matches. The calendar itself needs a browser test: verify title, timezone, switching event types, opening, dragging and resizing. These UI behaviors are not covered by workflow assertions.

  • Recommended for an external calendar app: the personal iCal subscription from the calendar sidebar. Treat its token as access credentials.
  • Recommended for custom integrations: the calendar API per field. It supplies data, not another Brezel UI component.
  • Recommended for recurring display: calendar recurrence options. To create records for each occurrence, use recurring tasks.
  • Not recommended for sending deterministic reminders: assuming that calendar display sends mail. Use deadline reminders.

Calendar component · Event types · Date fields · Workflow tests · Assertions