Utility functions for dealing with parameters for Dashboards and Cards.
Utility functions for dealing with parameters for Dashboards and Cards.
(add-name-field fields)
For all fields
that are :type/PK
Fields, look for a :type/Name
Field belonging to the same Table. For each
Field, if a matching name Field exists, add it under the :name_field
key. This is so the Fields can be used in
public/embedded field values search widgets. This only includes the information needed to power those widgets, and
no more.
For all `fields` that are `:type/PK` Fields, look for a `:type/Name` Field belonging to the same Table. For each Field, if a matching name Field exists, add it under the `:name_field` key. This is so the Fields can be used in public/embedded field values search widgets. This only includes the information needed to power those widgets, and no more.
(card->template-tag-field-ids card)
Return a set of Field IDs referenced in template tag parameters in CARD.
Return a set of Field IDs referenced in template tag parameters in CARD.
(dashboard->param-field-ids dashboard)
Return a set of Field IDs referenced by parameters in Cards in this DASHBOARD, or nil
if none are referenced. This
also includes IDs of Fields that are to be found in the 'implicit' parameters for SQL template tag Field filters.
Return a set of Field IDs referenced by parameters in Cards in this DASHBOARD, or `nil` if none are referenced. This also includes IDs of Fields that are to be found in the 'implicit' parameters for SQL template tag Field filters.
(field-form->id field-form)
Inputs: [field-form] Returns: su/IntGreaterThanZero
Expand a field-id
or fk->
FORM and return the ID of the Field it references. Also handles unwrapped integers.
(field-form->id [:field-id 100]) ; -> 100
Inputs: [field-form] Returns: su/IntGreaterThanZero Expand a `field-id` or `fk->` FORM and return the ID of the Field it references. Also handles unwrapped integers. (field-form->id [:field-id 100]) ; -> 100
(wrap-field-id-if-needed field-id-or-form)
Wrap a raw Field ID in a :field-id
clause if needed.
Wrap a raw Field ID in a `:field-id` clause if needed.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close