Releases: x-govuk/govuk-form-builder
Version 2.7.5
- Fix a bug in the deep merging of HTML attributes that was causing
data-
values to be affected. The logic has been flipped so only certain attributes (those that contain space-separated lists of values) will be merged and all others ignored. Thanks @baarkerlounger for diagnosing and reporting this #320 - Add support for GOV.UK Frontend version 3.14.0 #321
- Bump GOV.UK Dependabot to 4.1.0 #317
Version 2.7.4
- Improve the behaviour of
bold_labels
in radio button collections. Since the beginning the behaviour has been to flip the default to bold labels when the:description
is present, as it adds hints per option and they can blend into the labels. This approach didn't allow bold labels to be turned off when not wanted, so here we're changing the default fromfalse
tonil
. Whennil
, the old behaviour continues but when set to eithertrue
orfalse
the setting will take precedence. Thanks @fofr for identifying and raising this. #316 - Upgrade to version 3.13.1 of the design system #314
Version 2.7.3
- Allow error summary to take a
presenter
argument for further customisation of the error summary list. The default presenter implements the current behaviour (it displays the first error for each attribute) but gives developers full control over the output. There's a new section in the guide covering its use. Many thanks to @jsugarman for this #311 - Refactor some of the label/legend content building, move from
#compact#first
to#find(&:presence)
#308
Version 2.7.2
- Fix a bug where the nesting of multiple checkbox and radio fieldsets could lead to blocks being rendered more than once. Many thanks to @jsugarman for identifying, diagnosing and fixing this one 🙌🏽 #301
Version 2.7.1
- Support version 3.13.0 of the GOV.UK Design System #298:
- Add a
#govuk_check_box_divider
helper that works in exactly the same way as the radio button divider. It can be used to add a separator, "or" by default, to a list of checkboxes within a#govuk_check_boxes_fieldset
. Like the radio variant, the default text can be overridden via a config flag - Add a
exclusive
keyword argument to#govuk_check_box
. Exclusive checkboxes will automatically uncheck their siblings when checked, and automatically become unchecked when any of their siblings become checked - Add a new section to the guide covering the above features
- Add a
- Make input element
#builder_method
private, it doesn't need to be exposed. This was applied to allElement::Input
classes #297
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