overlay.rk
Company layer (layer 4): fields, rules and view tweaks an organisation adds to an app model, in <site>/custom/<model>.rk. The kernel merges them onto the app model at load; app upgrades never touch them.
Lives in <site>/custom/<model>.rk · Schema overlay.json (source) · first line: # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/overlay.json
Properties
| Property | Type | Meaning |
|---|---|---|
model required | name | The app model this overlay extends; must equal the file name pattern ^[a-z][a-z0-9_]{0,62}$ |
label | label | The company's word for the model (page title, the create button, widget titles); replaces the app model's label (contract 0049 §5) |
label.id required | string | |
label.en | string | |
labels | map of label | The company's words for fields of the app model, by field name; each replaces that field's label (contract 0049 §5) |
fields | list of items | |
rules | list of object | |
rules[].name required | ||
rules[].on required | save · submit · cancel | |
rules[].level | error · warn · info | |
rules[].check required | ||
rules[].message required | ||
approvals | list of object | |
approvals[].name required | ||
approvals[].on required | submit, cancel or an action name of this model | |
approvals[].when | Policy applies only when this is true (absent = always) | |
approvals[].approvers required | list of items | Roles that may approve; owner always may at least 1 |
approvals[].label | ||
views | object | |
views.form | object | |
views.form.add | list of object | |
views.form.add[].field required | name | snake_case, never renamed once released pattern ^[a-z][a-z0-9_]{0,62}$ |
views.form.add[].after | name | Place after this field or column; at the end when omitted pattern ^[a-z][a-z0-9_]{0,62}$ |
views.form.layout | list of or | Replaces the app model's form layout; fields it leaves out are not shown (views.form.add still applies after it) at least 1 |
views.form.layout[].section required | ||
views.form.layout[].fields | list of items | |
views.form.layout[].columns | list of list of items | at most 2 |
views.form.layout[].tab | ||
views.list | object | |
views.list.add | list of object | |
views.list.add[].field required | name | snake_case, never renamed once released pattern ^[a-z][a-z0-9_]{0,62}$ |
views.list.add[].after | name | Place after this field or column; at the end when omitted pattern ^[a-z][a-z0-9_]{0,62}$ |
views.list.columns | list of string | Replaces the list columns (views.list.add still applies after it) at least 1 |
views.kanban | object | |
views.kanban.columns | list of string | Order of the kanban group_by option values; values left out are hidden at least 1 |
options | map of list of object | Options appended to a select field of the model, by field name |
add
| Property | Type | Meaning |
|---|---|---|
field required | name | snake_case, never renamed once released pattern ^[a-z][a-z0-9_]{0,62}$ |
after | name | Place after this field or column; at the end when omitted pattern ^[a-z][a-z0-9_]{0,62}$ |
Example
From rangka-apps/examples/sites/demo-jasa/custom/quotation.rk (first 60 lines):
yaml
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/overlay.json
# The firm's own rule (contract 0007 §1): cancelling a submitted quotation also needs a sales manager, so a revision
# (quotation.revise cancels first) by someone else waits for approval.
model: quotation
approvals:
- name: cancel_approval
on: cancel
approvers: [sales_manager]
label: {id: Persetujuan manajer untuk membatalkan penawaran, en: Manager approval to cancel a quotation}Generated from the schema by website/scripts/gen-reference.mjs. Edit the schema, not this page.