From b8b71780114d364436f7f6ec4195bedd936fd610 Mon Sep 17 00:00:00 2001 From: Precious Onyenaucheya Date: Mon, 26 Jun 2023 12:57:51 +0100 Subject: [PATCH] make checkboxeslabel not required for radios and fix visual test failure --- ...mple-checkboxes-with-descriptions_0_document_0_desktop.png | 4 ++-- ...ample-checkboxes-with-descriptions_0_document_1_tablet.png | 4 ++-- ...ample-checkboxes-with-descriptions_0_document_2_mobile.png | 4 ++-- ...xample-images-for-regular-screens_0_document_0_desktop.png | 3 --- ...example-images-for-regular-screens_0_document_1_tablet.png | 3 --- ...example-images-for-regular-screens_0_document_2_mobile.png | 3 --- ...example-images-for-retina-screens_0_document_0_desktop.png | 3 --- ..._example-images-for-retina-screens_0_document_1_tablet.png | 3 --- ..._example-images-for-retina-screens_0_document_2_mobile.png | 3 --- ...xample-images-for-regular-screens_0_document_0_desktop.png | 3 --- ...example-images-for-regular-screens_0_document_1_tablet.png | 3 --- ...example-images-for-regular-screens_0_document_2_mobile.png | 3 --- ...example-images-for-retina-screens_0_document_0_desktop.png | 3 --- ..._example-images-for-retina-screens_0_document_1_tablet.png | 3 --- ..._example-images-for-retina-screens_0_document_2_mobile.png | 3 --- ...xample-panel-with-timeout-warning_0_document_0_desktop.png | 4 ++-- ...example-panel-with-timeout-warning_0_document_1_tablet.png | 4 ++-- src/components/checkboxes/_macro-options.md | 2 +- src/components/checkboxes/_macro.njk | 2 ++ .../checkboxes/example-checkboxes-with-descriptions.njk | 1 + 20 files changed, 14 insertions(+), 47 deletions(-) delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_0_desktop.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_1_tablet.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_2_mobile.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_0_desktop.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_1_tablet.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_2_mobile.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_0_desktop.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_1_tablet.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_2_mobile.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_0_desktop.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_1_tablet.png delete mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_2_mobile.png diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_0_desktop.png index 615220ebc8..2be61e0fbc 100644 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_0_desktop.png +++ b/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_0_desktop.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:14b9afe6f8bd58dd04f462fd1a9b75313bb189e68f8a3fc84637202c0b5fa357 -size 45250 +oid sha256:9401c79b73a9c7482b8bef23e934f3c2bf55ccab977ce938630150a64ba6e7c0 +size 47169 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_1_tablet.png index 49bbe7e111..39caef90cf 100644 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_1_tablet.png +++ b/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_1_tablet.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:260f80e7eb42ec8006fb405ba983a334830c7c12f8e75aee2874963c051296a3 -size 41400 +oid sha256:d7dd98e12f3bb6181f2d2436c9d30fb007f1788ca8265bc064206e94ae7bd16f +size 43508 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_2_mobile.png index efb07245b4..f582fc54dc 100644 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_2_mobile.png +++ b/backstop_data/bitmaps_reference/ds-vr-test__components_checkboxes_example-checkboxes-with-descriptions_0_document_2_mobile.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b09cc3da869de24b55488255aec047e56c46b1d736e365262e5470aa00353fd -size 37877 +oid sha256:4fd0c0be270ffdecb3b48094583069fe1ea57fbbed03f416937f63e0dd0b4ee9 +size 40012 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_0_desktop.png deleted file mode 100644 index a06a16cf9f..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_0_desktop.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9b4e537c199381dbfb2e84fcd1b35362a86078e488345da76b9a866c1348250b -size 436423 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_1_tablet.png deleted file mode 100644 index 3b3837611d..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_1_tablet.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:82188b2f7f7fcbc06ca8d274937c95c578b04a4ddf7071aeb575a3e4dd571a13 -size 417139 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_2_mobile.png deleted file mode 100644 index 7b7fd06457..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-regular-screens_0_document_2_mobile.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33af11d0ab2ba81871775f21aed3d9d5692d5a9ed526b54f4cc401b2acbede09 -size 139714 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_0_desktop.png deleted file mode 100644 index a06a16cf9f..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_0_desktop.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9b4e537c199381dbfb2e84fcd1b35362a86078e488345da76b9a866c1348250b -size 436423 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_1_tablet.png deleted file mode 100644 index 3b3837611d..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_1_tablet.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:82188b2f7f7fcbc06ca8d274937c95c578b04a4ddf7071aeb575a3e4dd571a13 -size 417139 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_2_mobile.png deleted file mode 100644 index 7b7fd06457..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_image_example-images-for-retina-screens_0_document_2_mobile.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33af11d0ab2ba81871775f21aed3d9d5692d5a9ed526b54f4cc401b2acbede09 -size 139714 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_0_desktop.png deleted file mode 100644 index a06a16cf9f..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_0_desktop.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9b4e537c199381dbfb2e84fcd1b35362a86078e488345da76b9a866c1348250b -size 436423 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_1_tablet.png deleted file mode 100644 index 3b3837611d..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_1_tablet.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:82188b2f7f7fcbc06ca8d274937c95c578b04a4ddf7071aeb575a3e4dd571a13 -size 417139 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_2_mobile.png deleted file mode 100644 index 7b7fd06457..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-regular-screens_0_document_2_mobile.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33af11d0ab2ba81871775f21aed3d9d5692d5a9ed526b54f4cc401b2acbede09 -size 139714 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_0_desktop.png deleted file mode 100644 index a06a16cf9f..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_0_desktop.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9b4e537c199381dbfb2e84fcd1b35362a86078e488345da76b9a866c1348250b -size 436423 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_1_tablet.png deleted file mode 100644 index 3b3837611d..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_1_tablet.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:82188b2f7f7fcbc06ca8d274937c95c578b04a4ddf7071aeb575a3e4dd571a13 -size 417139 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_2_mobile.png deleted file mode 100644 index 7b7fd06457..0000000000 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_images_example-images-for-retina-screens_0_document_2_mobile.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33af11d0ab2ba81871775f21aed3d9d5692d5a9ed526b54f4cc401b2acbede09 -size 139714 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_timeout-panel_example-panel-with-timeout-warning_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__components_timeout-panel_example-panel-with-timeout-warning_0_document_0_desktop.png index 7f20b39e92..6ff63d5d1d 100644 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_timeout-panel_example-panel-with-timeout-warning_0_document_0_desktop.png +++ b/backstop_data/bitmaps_reference/ds-vr-test__components_timeout-panel_example-panel-with-timeout-warning_0_document_0_desktop.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:67986068c453ec5534fd2138bd3974e43a6b837e2603416495be0e48679a66d6 -size 17441 +oid sha256:47df53d9a4630fa991d39f9420d0920c814cbf2b78891da45b678b1f45452b04 +size 17486 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_timeout-panel_example-panel-with-timeout-warning_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__components_timeout-panel_example-panel-with-timeout-warning_0_document_1_tablet.png index 38d3cec173..e57dee7bd7 100644 --- a/backstop_data/bitmaps_reference/ds-vr-test__components_timeout-panel_example-panel-with-timeout-warning_0_document_1_tablet.png +++ b/backstop_data/bitmaps_reference/ds-vr-test__components_timeout-panel_example-panel-with-timeout-warning_0_document_1_tablet.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:255ba5261f88e83a8fb612ac518ba06379e3d196a20b65f9d17e2b856fe84124 -size 13594 +oid sha256:8cb52531d1d281043cf0541c3c8d2a5b93bbc00c3d2a60d1244b4949a954c265 +size 13505 diff --git a/src/components/checkboxes/_macro-options.md b/src/components/checkboxes/_macro-options.md index d70202c929..4344a2cd52 100644 --- a/src/components/checkboxes/_macro-options.md +++ b/src/components/checkboxes/_macro-options.md @@ -6,7 +6,7 @@ | legendClasses | string | false | Classes to add to the fieldset‘s legend | | description | string | false | Hint text following the fieldset‘s legend to help users answer | | attributes | object | false | HTML attributes (for example, data attributes) to add to the fieldset | -| checkboxesLabel | string | true | A prompt for the checkboxes, for example, “Select all that apply” | +| checkboxesLabel | string | true (unless inside a radio) | A prompt for the checkboxes, for example, “Select all that apply” | | checkboxesLabelClasses | string | false | Classes to add to the checkboxes prompt element (`checkboxesLabel`) | | checkboxes | array`` | true | Settings for each [checkbox](#checkbox) | | borderless | boolean | false | Set to “true” to remove the border surrounding the input and label | diff --git a/src/components/checkboxes/_macro.njk b/src/components/checkboxes/_macro.njk index 512b752426..933838c4b4 100644 --- a/src/components/checkboxes/_macro.njk +++ b/src/components/checkboxes/_macro.njk @@ -5,7 +5,9 @@ {% from "components/button/_macro.njk" import onsButton %} {% set fields %} + {% if params.checkboxesLabel is defined %}

{{ params.checkboxesLabel }}

+ {% endif %} {% set hasOther = false %} {% for checkbox in params.checkboxes %} {% if checkbox.other %} diff --git a/src/components/checkboxes/example-checkboxes-with-descriptions.njk b/src/components/checkboxes/example-checkboxes-with-descriptions.njk index df26a92400..36d59729f1 100644 --- a/src/components/checkboxes/example-checkboxes-with-descriptions.njk +++ b/src/components/checkboxes/example-checkboxes-with-descriptions.njk @@ -8,6 +8,7 @@ }) %} {{ onsCheckboxes({ + "checkboxesLabel": "Select all that apply", "dontWrap": true, "name": "central-heating", "checkboxes": [