From 8ab550a22f8d61c61eee885618fd6a7355e238ca Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Fri, 25 Aug 2023 15:31:44 -0400 Subject: [PATCH] Radio buttons and list edits --- app/assets/javascripts/previewPane.js | 2 +- app/assets/javascripts/radioSelect.js | 30 +- app/main/forms.py | 13 +- .../components/components/label/template.njk | 2 +- .../components/components/radios/template.njk | 8 +- app/templates/error/401.html | 2 +- .../views/accessibility_statement.html | 12 +- app/templates/views/add-service-local.html | 2 +- app/templates/views/cookies.html | 16 +- app/templates/views/email-not-received.html | 2 +- .../add-nhs-local-organization.html | 2 +- .../settings/set-email-branding.html | 2 +- .../pricing/billing-details-signed-out.html | 2 +- .../views/pricing/billing-details.html | 2 +- app/templates/views/privacy.html | 2 +- .../link-service-to-organization.html | 2 +- .../views/service-settings/name-local.html | 2 +- .../service-settings/set-email-branding.html | 2 +- app/templates/views/templates/_template.html | 2 +- app/templates/views/templates/set-sender.html | 3 +- .../views/templates/set-template-sender.html | 3 +- .../views/verification-not-received.html | 2 +- paas-failwhale/index.html | 6 +- package-lock.json | 17208 +++------------- package.json | 1 - .../service_settings/test_service_settings.py | 12 +- tests/app/main/views/test_add_service.py | 8 +- tests/app/main/views/test_api_integration.py | 2 +- tests/app/main/views/test_find_users.py | 2 +- .../javascripts/collapsibleCheckboxes.test.js | 2 +- tests/javascripts/listEntry.test.js | 2 +- tests/javascripts/liveSearch.test.js | 14 +- tests/javascripts/previewPane.test.js | 2 +- tests/javascripts/radioSelect.test.js | 16 +- tests/javascripts/support/helpers/html.js | 6 +- 35 files changed, 2430 insertions(+), 14966 deletions(-) diff --git a/app/assets/javascripts/previewPane.js b/app/assets/javascripts/previewPane.js index e327687bf..4266b8590 100644 --- a/app/assets/javascripts/previewPane.js +++ b/app/assets/javascripts/previewPane.js @@ -4,7 +4,7 @@ $ = global.jQuery; - let branding_style = $('.govuk-radios__item input[name="branding_style"]:checked'); + let branding_style = $('.usa-radio input[name="branding_style"]:checked'); if (!branding_style.length) { return; } diff --git a/app/assets/javascripts/radioSelect.js b/app/assets/javascripts/radioSelect.js index cfe723158..fc26013b2 100644 --- a/app/assets/javascripts/radioSelect.js +++ b/app/assets/javascripts/radioSelect.js @@ -10,9 +10,9 @@ 'initial': Hogan.compile(` {{#showNowAsDefault}}
-
- - +
+ +
{{/showNowAsDefault}} @@ -25,17 +25,17 @@ 'choose': Hogan.compile(` {{#showNowAsDefault}}
-
- - +
+ +
{{/showNowAsDefault}}
{{#choices}} -
- - +
+ +
{{/choices}} @@ -44,17 +44,17 @@ 'chosen': Hogan.compile(` {{#showNowAsDefault}}
-
- - +
+ +
{{/showNowAsDefault}}
{{#choices}} -
- - +
+ +
{{/choices}}
diff --git a/app/main/forms.py b/app/main/forms.py index aa46da166..24b3ee187 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -774,7 +774,7 @@ def govuk_radios_field_widget(self, field, param_extensions=None, **kwargs): "attributes": {"id": field.name}, "legend": { "text": field.label.text, - "classes": "govuk-fieldset__legend--s" + "classes": "usa-fieldset" } }, 'errorMessage': error_message, @@ -1432,10 +1432,7 @@ class AdminProviderRatioForm(Form): f"{provider['display_name']} (%)", validators=[validators.NumberRange( min=0, max=100, message="Must be between 0 and 100" - )], - param_extensions={ - 'classes': "govuk-input--width-3", - } + )] ) ) for provider in providers ] @@ -1591,13 +1588,12 @@ class AdminEditEmailBrandingForm(StripWhitespaceForm): name = GovukTextInputField('Name of brand') text = GovukTextInputField('Text') colour = GovukTextInputField( - 'Colour', + 'colour', validators=[ Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code (starting with #)') ], param_extensions={ - "classes": "govuk-input--width-6", - "attributes": {"data-module": "colour-preview"} + "attributes": {"data-module": "color-preview"} } ) file = FileField_wtf('Upload a PNG logo', validators=[FileAllowed(['png'], 'PNG Images only!')]) @@ -1871,7 +1867,6 @@ class SomethingElseBrandingForm(StripWhitespaceForm): param_extensions={ "label": { "isPageHeading": True, - "classes": "govuk-label--l", }, "hint": { "text": "Include links to your brand guidelines or examples of how to use your branding." diff --git a/app/templates/components/components/label/template.njk b/app/templates/components/components/label/template.njk index 71d261681..d2510fc59 100644 --- a/app/templates/components/components/label/template.njk +++ b/app/templates/components/components/label/template.njk @@ -8,7 +8,7 @@ {% endset %} {% if params.isPageHeading %} -

{{ labelHtml | safe | indent(2) }}

+

{{ labelHtml | safe | indent(2) }}

{% else %} {{ labelHtml | safe }} {% endif %} diff --git a/app/templates/components/components/radios/template.njk b/app/templates/components/components/radios/template.njk index 0ee1a77c2..375dcfd3a 100644 --- a/app/templates/components/components/radios/template.njk +++ b/app/templates/components/components/radios/template.njk @@ -54,8 +54,8 @@ {%- else %} {% set hasHint = true if item.hint.text or item.hint.html %} {% set itemHintId = id + '-item-hint' %} -
- +
-

You’re not authorised to see this page

+

You’re not authorized to see this page

Sign in to Notify.gov and try again.

{% endblock %} diff --git a/app/templates/views/accessibility_statement.html b/app/templates/views/accessibility_statement.html index 9782a305b..cbca9e59a 100644 --- a/app/templates/views/accessibility_statement.html +++ b/app/templates/views/accessibility_statement.html @@ -25,7 +25,7 @@

This website is run by the Public Benefits Studio team at the Technology Transformation Services within GSA. It is designed to be used by as many people as possible. You should be able to:

-
    +
    • change colors, contrast levels and fonts
    • zoom in up to 300% without the text spilling off the screen
    • navigate most of the website using just a keyboard
    • @@ -46,7 +46,7 @@

      We know some parts of this website are not fully accessible:

      -
        +
        • the ‘upload a file’ button may cause issues for some users
        • if a team adds template folders, screen readers may announce the page heading in a confusing way
        • the ‘copy to clipboard’ button does not work with some screen readers
        • @@ -103,7 +103,7 @@ The following content on the Notify website is not compliant with the WCAG version 2.1 AA standard:

          -
            +
            • the HTML code for the ‘upload a file’ button may cause issues for assistive technology users - this fails success criterion 1.3.1: info and relationships
            • @@ -121,7 +121,7 @@ We’ve identified the following problems with the user interface:

              -
                +
                • the JAWS screen reader announces template folder page headings as multiple sentences
                • @@ -170,14 +170,14 @@ The following content on the Notify status page is not compliant with the WCAG version 2.1 AA standard:

                  -
                    + diff --git a/app/templates/views/add-service-local.html b/app/templates/views/add-service-local.html index ffb103bbe..8020378be 100644 --- a/app/templates/views/add-service-local.html +++ b/app/templates/views/add-service-local.html @@ -15,7 +15,7 @@ {{ page_header('About your service') }}

                    Give your service a name that tells users what your messages are about, as well as who they’re from. For example:

                    -
                      +
                      • School admissions – {{ current_user.default_organization.name }}
                      • Electoral services – {{ current_user.default_organization.name }}
                      • Blue Badge – {{ current_user.default_organization.name }}
                      • diff --git a/app/templates/views/cookies.html b/app/templates/views/cookies.html index 6534b099d..a591ce2f3 100644 --- a/app/templates/views/cookies.html +++ b/app/templates/views/cookies.html @@ -72,7 +72,7 @@

                        Google Analytics stores anonymized information about:

                        -
                          +
                          • how you got to Notify.gov
                          • the pages you visit on Notify and how long you spend on them
                          • any errors you see while using Notify
                          • @@ -114,7 +114,7 @@