From 084a5e37fc13f5a3e7390d1771c85e78548ca8be Mon Sep 17 00:00:00 2001 From: Beverly Nguyen <53159604+heyitsmebev@users.noreply.github.com> Date: Tue, 21 Jan 2025 22:20:44 -0800 Subject: [PATCH] Revert "Send Message A11Y Audit - Unique IDs and also refactor error message on templates page" --- .../uswds/_uswds-theme-custom-styles.scss | 4 ---- app/main/views/templates.py | 1 - .../components/components/input/template.njk | 4 +--- app/templates/components/form.html | 1 + app/templates/components/textbox.html | 23 ++++++++++--------- app/templates/views/edit-sms-template.html | 7 ++---- app/templates/views/send-test.html | 4 ++-- app/templates/views/templates/template.html | 4 ++++ tests/app/main/views/test_send.py | 2 +- tests/app/main/views/test_tour.py | 2 +- 10 files changed, 24 insertions(+), 28 deletions(-) diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index 7fafb8276..0bb1aab7e 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -1024,7 +1024,3 @@ nav.nav { font-size: units(3); font-weight: bold; } - -.form-control-error { - border: 4px solid #b10e1e -} diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 3a7315db7..5c59e1e7c 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -645,7 +645,6 @@ def edit_service_template(service_id, template_id): return render_template( "views/edit-{}-template.html".format(template["template_type"]), form=form, - errors=form.errors if form.errors else None, template=template, heading_action="Edit", ) diff --git a/app/templates/components/components/input/template.njk b/app/templates/components/components/input/template.njk index 9e2cff08c..7f5634651 100644 --- a/app/templates/components/components/input/template.njk +++ b/app/templates/components/components/input/template.njk @@ -42,7 +42,5 @@ {%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %} {%- if params.autocomplete %} autocomplete="{{ params.autocomplete}}"{% endif %} {%- if params.pattern %} pattern="{{ params.pattern }}"{% endif %} - {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%} - {%- if params.required %} required{% endif %} -/> + {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}> diff --git a/app/templates/components/form.html b/app/templates/components/form.html index 5875a19a9..17cabc7f0 100644 --- a/app/templates/components/form.html +++ b/app/templates/components/form.html @@ -19,6 +19,7 @@ data-{{ key }}="{{ val }}" {% endif %} {% endfor %} + novalidate > {{ caller() }} diff --git a/app/templates/components/textbox.html b/app/templates/components/textbox.html index e8b6f813d..3e479cbce 100644 --- a/app/templates/components/textbox.html +++ b/app/templates/components/textbox.html @@ -13,13 +13,22 @@ safe_error_message=False, rows=8, extra_form_group_classes='', - placeholder='', - required=None + placeholder='' ) %}
+ {% if not safe_error_message %}{{ field.errors[0] }}{% else %}{{ field.errors[0]|safe }}{% endif %} +
+