PhoenixKitManufacturing. ColumnConfig. Machines
(PhoenixKitManufacturing v0.3.2)
Copy Markdown
View Source
Column registry for the Machines index list LiveView
(PhoenixKitManufacturing.Web.MachinesLive, :index).
Operates on enriched machine maps of shape %{uuid, name, code, status, status_label, location, types_csv, type_names, manufacturer, model, manufacture_year, commissioned_on, warranty_until, to_next_on, data},
built by enrich_machines/2 in the LiveView the same way
PhoenixKitWarehouse.ColumnConfig.Inventories's flat maps are built by
enrich_documents/1 in inventories_live.ex.
types_csv is the sorted, comma-joined list of machine type names (e.g.
"CNC, Milling") used as the :enum filter key — distinct_options/2
returns distinct CSV strings and enum_filter/1 matches on the full CSV.
type_names (a sorted list of the same strings) is kept on the enriched
map for badge rendering in the LiveView without re-splitting the CSV.
Summary
Functions
Ordered list of column metadata maps. Used by the picker modal.
Map %{id => meta} for fast lookup during a single render pass.
Filter input list to known column ids, preserving order.
Filter input list to known filterable column ids, preserving order.
Functions
@spec all_column_ids() :: [String.t()]
@spec available_columns() :: [map()]
Ordered list of column metadata maps. Used by the picker modal.
Map %{id => meta} for fast lookup during a single render pass.
@spec default_columns() :: [String.t()]
@spec scope() :: String.t()
Filter input list to known column ids, preserving order.
Filter input list to known filterable column ids, preserving order.