Display roles for the admin overview (ADR-040).
A field's role says what its value is to a reader — a relation, money, a
due date — and decides how a list cell renders it. Roles are derived from
the field's type, its name and the entity's relations; an explicit
:display in the field config wins. Pure: config in, data out.
Display roles for the admin overview (ADR-040). A field's role says what its value is to a reader — a relation, money, a due date — and decides how a list cell renders it. Roles are derived from the field's type, its name and the entity's relations; an explicit `:display` in the field config wins. Pure: config in, data out.
(belongs-to-fields entity-config)Field → the belongs-to relationship it holds.
Field → the belongs-to relationship it holds.
(default-list-fields entity-config field-order)List columns for an entity with no :list-fields: title, relations, the
facet, other enums and many-to-many relations, money, dates, then the
rest, at most seven. Long text, JSON, identifiers that are not the title
and audit columns other than created-at are left out. Within a rank,
field-order keeps column order.
List columns for an entity with no `:list-fields`: title, relations, the facet, other enums and many-to-many relations, money, dates, then the rest, at most seven. Long text, JSON, identifiers that are not the title and audit columns other than `created-at` are left out. Within a rank, `field-order` keeps column order.
(default-sort entity-config)[field dir] a list starts sorted by: newest first when the entity has :created-at, else by its title field, else by its primary key. A UUID key alone would give a random order.
[field dir] a list starts sorted by: newest first when the entity has :created-at, else by its title field, else by its primary key. A UUID key alone would give a random order.
(display-role entity-config field)The display role of field in entity-config. See role-with-source.
The display role of `field` in `entity-config`. See `role-with-source`.
(explain entity-config)What the overview derives for entity-config, for (explain-entity :e) in the REPL:
each field's role and why, the title field, the facet and the list fields.
What the overview derives for `entity-config`, for `(explain-entity :e)` in the REPL: each field's role and why, the title field, the facet and the list fields.
(facet-field entity-config)The enum whose values become the status tabs: the explicit :facet, else
the field called status or state when it is an enum, else nil.
The enum whose values become the status tabs: the explicit `:facet`, else the field called status or state when it is an enum, else nil.
(format-explain entity-name explained)explain as text for the REPL: one line per field, list columns first.
`explain` as text for the REPL: one line per field, list columns first.
(has-many-columns entity-config)List column key → the has-many relationship it counts. A has-many is a list
column when :list-fields names its key: its child entity, or
<entity>-by-<foreign-key> when two relations share that child.
List column key → the has-many relationship it counts. A has-many is a list column when `:list-fields` names its key: its child entity, or `<entity>-by-<foreign-key>` when two relations share that child.
(link-columns entity-config)List column key → the many-to-many relation it shows (BOU-778).
List column key → the many-to-many relation it shows (BOU-778).
(link-rel entity-config k)The many-to-many relation of entity-config named k, or nil.
The many-to-many relation of `entity-config` named `k`, or nil.
(role-with-source entity-config field)[role source] for field, source saying why: explicit, title field,
belongs-to <entity>, has-many <entity>, a name rule, or type default.
Precedence: explicit :display, the title field, belongs-to, has-many,
many-to-many, enum, name rules, the type default.
[role source] for `field`, source saying why: `explicit`, `title field`, `belongs-to <entity>`, `has-many <entity>`, a name rule, or `type default`. Precedence: explicit `:display`, the title field, belongs-to, has-many, many-to-many, enum, name rules, the type default.
Every display role. Closed: the cell renderer and the CSS know each one.
Every display role. Closed: the cell renderer and the CSS know each one.
(title-field entity-config)What a record of this entity is called: the explicit :title-field, else
the first of :name :title :label :email :slug :number the entity has and
shows, else its first string identifier (a code, a SKU, a reference), else
its primary key.
What a record of this entity is called: the explicit `:title-field`, else the first of :name :title :label :email :slug :number the entity has and shows, else its first string identifier (a code, a SKU, a reference), else its primary key.
Tones an enum value can carry. The CSS colours each one.
Tones an enum value can carry. The CSS colours each one.
(with-display entity-config {:keys [derive-list-fields? derive-default-sort?]})entity-config with its derived :title-field, :facet and
:display-roles (list column → role). With derive-list-fields?, an
entity whose config names no :list-fields gets default-list-fields;
with derive-default-sort?, one naming no :default-sort gets default-sort.
`entity-config` with its derived `:title-field`, `:facet` and `:display-roles` (list column → role). With `derive-list-fields?`, an entity whose config names no `:list-fields` gets `default-list-fields`; with `derive-default-sort?`, one naming no `:default-sort` gets `default-sort`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |