Liking cljdoc? Tell your friends :D

boundary.admin.core.ui.base

Shared admin UI primitives used across multiple ui.* sections.

Leaf namespace: URL helpers, field-value rendering, list-column width heuristics, and small formatting/label utilities. Must NOT require any other boundary.admin.core.ui.* implementation namespace — it is the dependency root that the focused sections build on.

Shared admin UI primitives used across multiple ui.* sections.

Leaf namespace: URL helpers, field-value rendering, list-column width
heuristics, and small formatting/label utilities. Must NOT require any
other boundary.admin.core.ui.* implementation namespace — it is the
dependency root that the focused sections build on.
raw docstring

current-list-urlclj

(current-list-url entity-name table-query filters)

Build the current admin list URL with filters/pagination applied.

Used to seed return-to on links that navigate away from a list view (notably the delegated create flow), so the user lands back on the same filtered/paginated page after cancel or success. Returns the plain /web/admin/<entity> when no meaningful query params exist.

Build the current admin list URL with filters/pagination applied.

Used to seed `return-to` on links that navigate away from a list view
(notably the delegated create flow), so the user lands back on the
same filtered/paginated page after cancel or success. Returns the
plain `/web/admin/<entity>` when no meaningful query params exist.
sourceraw docstring

entity-create-urlclj

(entity-create-url entity-name entity-config)
(entity-create-url entity-name entity-config caller-url)

Resolve the URL used for the 'New' button on an entity.

Entities may expose a dedicated create flow via :create-redirect-url (e.g. split-table entities that cannot be created via the generic admin CRUD path). Falls back to /web/admin/<entity>/new when no override is configured.

When caller-url is provided AND the entity delegates via :create-redirect-url, the caller URL is threaded through as a return-to query parameter so the delegated flow (e.g. the user module's /web/users/new page) can bring the admin back to their current filtered/paginated list view on cancel or success. The value is URL-encoded to survive embedded &/= characters from filters and pagination.

caller-url is ignored for the non-delegated path because the generic admin create handler re-renders the default list view directly and does not honor return-to.

Resolve the URL used for the 'New' button on an entity.

Entities may expose a dedicated create flow via `:create-redirect-url`
(e.g. split-table entities that cannot be created via the generic admin
CRUD path). Falls back to `/web/admin/<entity>/new` when no override is
configured.

When `caller-url` is provided AND the entity delegates via
`:create-redirect-url`, the caller URL is threaded through as a
`return-to` query parameter so the delegated flow (e.g. the user
module's `/web/users/new` page) can bring the admin back to their
current filtered/paginated list view on cancel or success. The value
is URL-encoded to survive embedded `&`/`=` characters from filters
and pagination.

`caller-url` is ignored for the non-delegated path because the generic
admin create handler re-renders the default list view directly and
does not honor `return-to`.
sourceraw docstring

format-field-labelclj

(format-field-label field-name)

Format field name as human-readable label.

Args: field-name: Keyword field name

Returns: Capitalized string label

Format field name as human-readable label.

Args:
  field-name: Keyword field name

Returns:
  Capitalized string label
sourceraw docstring

get-field-errorsclj

(get-field-errors errors field-name)

Extract errors for a specific field from validation result.

Args: errors: Validation errors map or vector field-name: Keyword field name

Returns: Vector of error messages for the field

Extract errors for a specific field from validation result.

Args:
  errors: Validation errors map or vector
  field-name: Keyword field name

Returns:
  Vector of error messages for the field
sourceraw docstring

list-column-stylesclj

(list-column-styles list-fields entity-config)

Given the ordered list-fields and the entity config, return a seq of Hiccup [:col {:style ...}] elements with proportional width:N% for the data columns. The select/actions framing columns are sized via CSS classes elsewhere, so widths here sum to 100% of the remaining data area.

Returns a seq (not a vector) so Hiccup splices the elements into the surrounding :colgroup rather than treating them as a single element.

Pure helper — no I/O.

Given the ordered list-fields and the entity config, return a seq of
Hiccup `[:col {:style ...}]` elements with proportional `width:N%` for the
data columns. The select/actions framing columns are sized via CSS classes
elsewhere, so widths here sum to 100% of the remaining data area.

Returns a seq (not a vector) so Hiccup splices the elements into the
surrounding `:colgroup` rather than treating them as a single element.

Pure helper — no I/O.
sourceraw docstring

list-column-weightclj

(list-column-weight field field-config)

Relative width weight for a list column, used to distribute table width proportionally instead of evenly.

Resolution order:

  1. Explicit :width in the field config (interpreted as a weight) wins.
  2. Otherwise derived from :type, with a name-based heuristic for strings (e.g. "description" gets more room than "status").

Pure: takes a field keyword + its config map, returns a positive number.

Relative width weight for a list column, used to distribute table width
proportionally instead of evenly.

Resolution order:
1. Explicit `:width` in the field config (interpreted as a weight) wins.
2. Otherwise derived from `:type`, with a name-based heuristic for strings
   (e.g. "description" gets more room than "status").

Pure: takes a field keyword + its config map, returns a positive number.
sourceraw docstring

render-field-valueclj

(render-field-value _field-name value field-config)

Render field value for display in table or detail view.

Args: field-name: Keyword field name value: Field value to render field-config: Field configuration map

Returns: Hiccup structure or string for display

Render field value for display in table or detail view.

Args:
  field-name: Keyword field name
  value: Field value to render
  field-config: Field configuration map

 Returns:
   Hiccup structure or string for display
sourceraw docstring

url-encodeclj

(url-encode s)

URL-encode a string for use as a query-string value.

Required when threading return_to (or any contextual URL containing its own ?/& characters) through query parameters — otherwise the embedded & splits into a second top-level parameter and the receiving handler sees a truncated value.

URL-encode a string for use as a query-string value.

Required when threading `return_to` (or any contextual URL containing
its own `?`/`&` characters) through query parameters — otherwise the
embedded `&` splits into a second top-level parameter and the receiving
handler sees a truncated value.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close