Upgrading to v0.16
View SourceBump Your Deps
Update Backpex to the latest version:
defp deps do
[
{:backpex, "~> 0.16.0"}
]
endRefactoring of filter components
We have enhanced and refactored the filter components, introducing some breaking changes.
index_prefix from filter component names has been removedfilter_badge/1component has been moved toBackpex.HTML.Resource
Note that you will only be affected by these changes if you use filter components manually on custom pages.
Due to the refactoring of the filter components, there may be other unexpected errors, so we recommend looking into the changes of the PR in detail if you manually insert filter components to pages.
Backpex.Fields.Currency has been updated
The appearance of the currency field has changed completely. We now use a custom masked input instead of a number input which improves UX a lot.
In addition we've removed the money dependency from Backpex so you can use whatever library you want to use for currencies in your app.
The removal of money includes our custom Backpex.Ecto.AmountType ecto type.
If you used the money library before, these are the changes you have to make:
- Configure
unit,unit_position,radixandthousands_separatorforBackpex.Fields.Currency
def fields do
[
price: %{
module: Backpex.Fields.Currency,
label: "Price",
unit: "€",
unit_position: :after,
radix: ",",
thousands_separator: ".",
symbol_space: true
},
...
]
endSee field-specific options for default values.
- Configure defaults for
moneyin yourconfig/config.exs
config :money,
default_currency: :EUR,
separator: ".",
delimiter: ",",
symbol_on_right: true,
symbol_space: trueThe default values should ideally match the field options from step 1.
- Replace
Backpex.Ecto.AmountTypewithMoney.Ecto.Amount.Type
schema "products" do
field :price, Money.Ecto.Amount.Type
...
end- Add money dependency to your app
def deps do
[
{:money, "~> 1.14"},
...
]
endComponent changes
Backpex.HTML.Layout.field_container/1now uses adlelement instead of adivelement to better align with HTML semanticsBackpex.HTML.Layout.input_label/1has been enhanced by addingas,forandrestattribute
We've created a Backpex.HTML.CoreComponents.dropdown/1, which is now used for all Backpex dropdowns.