From a691f5c0dda83f2bd51f3a1bf6bfaf6a773a1dec Mon Sep 17 00:00:00 2001 From: alexjanousekGSA Date: Wed, 9 Jul 2025 16:40:34 -0300 Subject: [PATCH] Migrate radio buttons from GOV.UK to USWDS - Replace .multiple-choice with .usa-radio classes - Update radio templates to use USWDS patterns - Remove GOV.UK dependencies from radio components - Convert nested lists to flat divs with USWDS margin utilities - Update tests to use new radio classes --- .../uswds/_uswds-theme-custom-styles.scss | 3 --- app/templates/components/radios.html | 2 +- app/templates/components/select-input.html | 27 +++++++------------ tests/app/main/views/test_add_service.py | 2 +- tests/javascripts/templateFolderForm.test.js | 14 +++++----- 5 files changed, 19 insertions(+), 29 deletions(-) diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index e10071f3d..da85cb5ba 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -108,9 +108,6 @@ p, box-shadow: none !important; } -.multiple-choice [type='radio']:focus + label::before { - box-shadow: 0 0 0 3px color('blue-40v'); -} .usa-dark-background .pill-item__container { color: #fff; diff --git a/app/templates/components/radios.html b/app/templates/components/radios.html index b629bb871..22489e289 100644 --- a/app/templates/components/radios.html +++ b/app/templates/components/radios.html @@ -40,7 +40,7 @@
{% for option in field %} -
+
{{ option }}
- {% endif %} {% endmacro %} diff --git a/tests/app/main/views/test_add_service.py b/tests/app/main/views/test_add_service.py index 3a781bda5..a62c21487 100644 --- a/tests/app/main/views/test_add_service.py +++ b/tests/app/main/views/test_add_service.py @@ -54,7 +54,7 @@ def test_get_should_not_render_radios_if_org_type_known( page = client_request.get("main.add_service") assert page.select_one("h1").text.strip() == "About your service" assert page.select_one("input[name=name]").get("value") is None - assert not page.select(".multiple-choice") + assert not page.select(".usa-radio") def test_show_different_page_if_user_org_type_is_local( diff --git a/tests/javascripts/templateFolderForm.test.js b/tests/javascripts/templateFolderForm.test.js index c9fbdf734..d12a40748 100644 --- a/tests/javascripts/templateFolderForm.test.js +++ b/tests/javascripts/templateFolderForm.test.js @@ -12,17 +12,17 @@ function setFixtures (hierarchy, newTemplateDataModules = "") { nodes .filter(node => node.type === 'folder') .forEach(node => { - result += `
  • + result += `
    ${node.children ? foldersCheckboxesHTML(node.children) : ''} -
  • `; +
    `; count++; }); - return `
      ${result}
    `; + return `
    ${result}
    `; }; }(); @@ -83,25 +83,25 @@ function setFixtures (hierarchy, newTemplateDataModules = "") { New template -
    +
    -
    +
    -
    +
    -
    +