Skip to main content

Module record_macros

Module record_macros 

Source
Expand description

VAPP-217 (eApps U2): the HOST half of the RecordForm and RecordTable macros, the mirror of src/host/record-macros.ts (fixtures/record-macros.json locks both). A macro sees only its node’s props, so before a template is reduced the host fills every RecordForm / RecordTable node of the flat component list from its kind’s schema: the fields with their checks, the table columns (the Data tab’s typed widths), the rows binding, the draft path and the actions. The macro table then expands the filled node like any other.

Constants§

RECORD_FORM_ROOT
RECORD_ISSUES_PATH
RECORD_LONG_TEXT
A string longer than this (its maxLength) is a Textarea.
RECORD_MEMBERS_PATH
The team’s members and issues the macros’ Selects read (one binding per surface, outside the package’s sources: the macro’s own).
RECORD_MENU_WIDTH
RECORD_TABLE_ROOT
RECORD_UPDATED_WIDTH

Functions§

field_label
closeDate / close_date → Close date.
fill_record_macros
Every RecordForm / RecordTable of a template’s flat component list, filled from records (the package’s records object); other components untouched. Returns (components, bindings): a RecordTable appends its phone row <id>__row, when editable its Delete <id>__rowDelete, and the binding /recordTable/<id>/rows.
is_record_macro_binding
A record macro’s own source at its own path passes any sources.
record_columns
The Data tab’s column order: required (in order), then the rest by name.
record_form_fields
The form fields of a kind, values under path (files left out).
record_macro_issues
VAPP-217: a writing RecordForm / editable RecordTable needs records.upsert (a table also records.delete) in functions; a RecordTable’s records:<kind> must pass sources when set. At the macro’s component.
record_table_columns
The table columns: the chosen fields (default every one), typed and sized like the Data tab, then updatedAt, then the row menu.
uses_record_macros
True when a template uses a record macro.