Canonical form for the filter values a dashboard carries.
A filter value is a string. That is what survives a round-trip through the
URL query string, and it is what Lotus.Dashboards expects when it applies
a filter's transform to a card's query variables.
The one filter that does not arrive as a string is the date range. Its
picker is two <input type="date"> elements posted under one filter name,
so Phoenix parses them into %{"start" => _, "end" => _}. normalize/1
flattens that to "start,end", which is the shape the
date_range_start and date_range_end transforms already parse.
Summary
Functions
Builds the filter values for a dashboard from URL params, falling back to each filter's default.
Reduces posted filter params to their canonical string form.
Splits a canonical date-range value into its two dates, either of which may
be nil when that end of the range is open.
Reduces filter values to the params worth putting in the URL, dropping the ones carrying nothing.
Functions
Builds the filter values for a dashboard from URL params, falling back to each filter's default.
Reduces posted filter params to their canonical string form.
Splits a canonical date-range value into its two dates, either of which may
be nil when that end of the range is open.
Reduces filter values to the params worth putting in the URL, dropping the ones carrying nothing.