- Fixed #17 - when there was more than 9 items in collections, they were ordered 1, 10, 11 ..., 2, 20, 21..., 3...
- Fixed #15 - issue in collections, when
id
of struct was""
instead ofnil
- Changed Validator module to be compatible with
Formex.Ecto
0.2
- Fixed using
multi_select
with array field when value of field isnil
- Changed argument of
custom_value
callback
- Added a
custom_value
option in fields
- Added another way to define the
translate_error
function, to fix usage with Distillery. Details are in Formex.Validator docs. - Added a default
translate_error
implementation, so you don't need to set it in config.ex, when you don't want to translate error messages.
- Fixed file uploads in collections
-
Changed behaviour when user sends no value for field.
You have a form with
first_name
andlast_name
fields, and user manually removes in browser thefirst_name
field.What happens after form submit:
- Prior to formex 0.6.0, the
first_name
value will be unchanged. - Since 0.6.0, the
first_name
value will be""
.
This new behaviour is the same as in the Symfony form library. It was necessary to change, because browser sends no value in
multiple_select
if there is nothing selected, or even there may be no value in normalselect
when we using Ajax Bootstrap Select plugin and was nothing selected. - Prior to formex 0.6.0, the
-
Fixed deselecting all options in multiple select jakub-zawislak/formex_ecto#2
- Changed behaviour of select validation. When user tried to provide an invalid select value
(that wasn't in list of available options), an elixir error was raised.
Since now user will see message
"invalid value"
attached to field, instead of server error. This message can be translated via gettext.
- Added support for ajax selects plugins, such as Ajax-Bootstrap-Select
- Partially rewritten JS library. Now it supports multi-level nested forms.
- Added
:struct_name
key in form collection struct for compability with validation libraries which (since 0.5.5) looks for:struct_name
in form item instead of:name
.
- Fixed select validation when using another format for
<option>
's than[key: value]
- Added ability to use a different field name than in a structure
- Restored
\n
to<br>
conversion in error messages, which was removed in 0.5.0
- Fixed nested forms when using with Ecto
- Fixed applying new params to struct for nested forms and collections
- Created simple validator that only have one option:
:required
- Added ability to use library without Ecto
- Ecto functionality moved to
formex_ecto
library - Added ability to use external validators
:required
option no longer validates presence of value. It's now used only in template- Config option
:translate_error
is no longer required, by default errors are not translated
- Template now converts
\n
to<br>
in error messages usingPhoenix.HTML.Format.text_to_html\2
- Added
form
parameter inFormex.Type.changeset_after_create_callback
- Fixed passing
form.opts
to a prototype form inFormex.View.Collection
See CHANGELOG.md for migration instructions
- Temporarily removed ability to filter collection items, that was added in the 0.4.10
- Added
Formex.View.formex_input
andFormex.View.formex_label
- Ability to filter items in form collections
- Improved code of form collections. It's required to update JS library:
Run
npm install formex
.
- Added prefixes
formex-
in HTML attributes (data-prototype
is nowdata-formex-prototype
etc.). Runnpm install formex
to update JS library.
- Fixed "
Phoenix.HTML.Form.Formex.CustomField.SelectAssoc/3
is undefined" errors - Added
opts
argument inFormex.Builder/4
- Fixed collections where items has ID as UUID instead of integer.
embedded_schema
uses UUID.
- Fixed JS library
- Added
- Ability to use with
embedded_schema
, without a database
- Ability to use with
- Added
- Collections of forms
- Ability to write templates of nested forms
- Changed
-
API of
Formex.View
Use
use Formex.View
instead ofimport Formex.View
inside your web.ex
-
- Changed API of
Formex.Type
-
swapped second and third argument of
Formex.Type.add\4
.Instead of:
|> add(:text_input, :title)
write:
|> add(:title, :text_input)
The order of arguments is now the same as in Symfony.
-
removed
Formex.Type.add_button\4
. UseFormex.Type.add\4
instead. -
removed
Formex.Type.add_form\4
. UseFormex.Type.add\4
instead.
-
- Added
- Nested forms with
_to_one
relation
- Nested forms with
- Added
- SelectAssoc
- multiple_select support
- Select
- Validation if value sent by user exists in the generated select
- SelectAssoc
- Added
Formex.Template.add_class
-
Added
- Ability to create a custom templates
- Templates
- Bootstrap horizontal
- Bootstrap vertical
-
Changed
- Extracted repo functions from a
Formex.Builder
to aFormex.Repo
. web/web.ex
- You have touse Formex.Controller
instead ofimport Formex.Builder
from now on.
- Extracted repo functions from a
-
Removed
formex_row_horizontal
andformex_rows_horizontal
. You have to use a horizontal template from now on.
- Added
- Select Assoc
group_by
option
- Select Assoc
- Added
- Select Assoc
query
option
- Select Assoc
- Changed
- Select Assoc
- renamed
choice_name
tochoice_label
- renamed
- Select Assoc
- Added
- tests
- Added
- custom fields