Changed
- Raise an
ArgumentErrorinstead of aFunctionClauseErrorin
Flop.Phoenix.page_link_range/3if the page link option is neither:all,
:nonenor a positive integer. - Raise an
ArgumentErrorinstead of aFunctionClauseErrorin
Flop.Phoenix.Pagination.new/2if theFlopstruct has no pagination
parameters. - Document how to handle
_unused_*and_targetparameters produced by
Phoenix forms.
Fixed
- Return one entry per message in the errors of a form built from a
Flop.Metastruct, so thatform[:page].errorsis[{message, opts}]
instead of[[{message, opts}]]. - Derive the input type of a filter from the Ecto type of the field even if the
meta struct has errors, instead of falling back to a text input. - Replace existing Flop query parameters in
Flop.Phoenix.build_path/3when
the path is given as a URL string, instead of appending a second set of them. - Render the hidden inputs of each filter once instead of twice in
Flop.Phoenix.filter_fields/1. - Set
ellipsis_start?andellipsis_end?tofalsein
Flop.Phoenix.Pagination.new/2whenpage_linksis:none. - Resolve Flop options from the backend module set on the meta struct, not only
from the schema. - Render the configured filter fields instead of raising a
FunctionClauseErrorif thefiltersparameter is not a list of maps. - Remove Flop query parameters that the
Flopstruct does not set from a path
given as a URL string inFlop.Phoenix.build_path/3. - Omit pagination, order and filter parameters that match a default from the
hidden inputs of a form built from aFlop.Metastruct that has validation
errors. - Do not render the hidden
_persistent_idinputs that
Phoenix.Component.inputs_for/1adds inFlop.Phoenix.filter_fields/1. Flop.Phoenix.filter_fields/1withdynamic={true}raised a
FunctionClauseErrorif the meta struct had validation errors.
How to upgrade
If you flattened the errors yourself before rendering them, you can remove that
step. In the input component mix phx.new generates, that is:
- |> assign(:errors, Enum.map(List.flatten(field.errors), &translate_error/1))
+ |> assign(:errors, Enum.map(field.errors, &translate_error/1))