Releases: x-govuk/govuk-form-builder
Version 2.7.0
-
Change
#govuk_submit
so it renders a<button>
element instead of an<input type="submit">
. This is in response to #295 which highlights a longstanding bug with the design system where the top few pixels of the input element don't respond properly to clicks. The<button>
element should be functionally the same and any tests written using Capybara'sclick_button
style helpers should work, but it's probably going to break a few tests where assertions are made on thevalue
attribute, now they need to compare against the element's contents.Additionally, as
<button>
elements support any HTML inside them, we support passing a proc:= govuk_submit(-> { tag.strong("Click me!" })
Thanks to @frankieroberto for reporting this #296
-
Switch any remaining specs that use nested
#have_tag
over to#with_tag
syntax #294
Version 2.6.0
- Make the publish workflow target the oldest supported version of Rails #289
- Add some enhancements to the error summary:
- Allow the error summary to accept blocks of arbitrary HTML. These are placed between the title and the error messages list and can be used to provide some additional context #291
- Allow the order that errors are displayed in to be customised. The custom order can be provided via the
order:
argument or a default method can be assigned on models that the builder will look for (allowing the ordering to be set in one place and applied to all forms associated with the object). #290
- Add a helpers module that can be included with
include GOVUKDesignSystemFormBuilder::BuilderHelper
. It currently has two methods that expose some form builder functionality to 'the outside'. Theres a sample PR here that shows how to get started. #268govuk_field_id
- so you can override the id on custom form elements in a way that the builder's error summary can link to themgovuk_error_summary
- allows the error summary to be rendered outside of the form
Version 2.5.3
Version 2.5.2
- Stop rendering conditional blocks when there's no block content. Thanks to @jsugarman and @jrmhaig for reporting and helping with this 🙌🏽 #283
- Remove some duplication between
FieldsetCheckBox
andFieldsetRadioButton
and their associated specs #284 - Support GOV.UK Frontend version
3.12.0
#280
Version 2.5.1
- Fix a bug caused by our use of deeper merge. When deeply-merging attributes, all attributes were treated equally and duplicate values removed (to prevent doubling up classes). This had the unwanted side-effect of removing words that occur more than once within the attribute; on textual attributes (like value, title, etc) repeated words were removed. The fix implements a fix by providing a list of attributes that are skipped when merging. Thanks to @cpjmcquillan for diagnosing and fixing this. #279
- Add a security policy and integrate SemGrep #275, #277
Version 2.5.0
- Add new
#govuk_select
helper. It is to#select
what#govuk_collection_select
is to#collection_select
. Allows more flexibility withoption
andoptgroup
elements, including the ability to add custom attributes. More info in the guide. Thanks to @AbigailMcP for suggesting this. #260 - Improve HTML attribute merging, now deeply nested attributes that are space separated lists are properly-merged #256
- Make the format date values can be set in more lenient. Release 2.4.0 introduced a change that made unexpected date formats cause a crash, now a warning will be logged but it will no longer crash #261
- Bump Ruby and Rails to latest versions #262
- Add a missing width from the text field guide entry, thanks @david-mears-dfe for this #263
- Allow the gem's warnings to be suppressed library-wide #264
Version 2.4.0
- Allow date inputs to retrieve values from a multiparam attribute hash as well as date objects #255
Version 2.3.0
- allow custom HTML attributes to be set across more form helpers. Thanks to @callumacrae for getting the ball rolling on this one #251
- various code cleanup and refactoring #248
- various guide updates #253, #254
Upgrade notes
The approach for setting custom HTML attributes has been standardised and now they are set via keyword arguments. Previously, the #govuk_collection_select
helper allowed a html_options
keyword argument (Rails-style), but this behaviour is no longer supported and will log a deprecation warning.
To upgrade, remove the html_options
kwarg and move the custom attributes to the method call:
- = govuk_collection_select :favourite_colour, @colours, :id, :name, html_options: { autofocus: false }
+ = govuk_collection_select :favourite_colour, @colours, :id, :name, autofocus: false
Version 2.2.0
- Support Ruby 3.0.0 #232
- Drop support for Rails 5.2.4 - Rails 3.0.0 doesn't support Rails 5.2.4 so the build matrix fails. It's very likely that the form builder will continue to work with Rails 5.2.x for the foreseeable future but it will no longer be automatically tested or officially supported #232
- Allow the submit button's
formnovalidate
value to be configured #242 - Various spec and guidance updates, thanks @david-mears-dfe for adding a new example to the radio buttons page #244, #245, #247
- Upgrade to GOV.UK Rubocop 4.0.0.pre.1 #246
Version 2.1.9
- This release brings some improvements to the collection form helpers:
- Add
include_blank
support to#govuk_collection_check_boxes
. This brings the checkboxes variant of the collection helper in line with the radio buttons one. Thanks to @njseeto for reporting #238 - Bring the default
include_blank
arguments in line with Rails' defaults by setting them totrue
by default. Previously the value wasfalse
in#govuk_collection_radio_buttons
91db189 - Add a configuration options so the default values for
include_blank
can be set for the check box and radio button helpers individually. To change the behaviour to how it was prior to2.1.9
use this configuration:
- Add
GOVUKDesignSystemFormBuilder.configure do |conf|
conf.default_collection_check_boxes_include_hidden = true
conf.default_collection_radio_buttons_include_hidden = false
end