Skip to content

Commit

Permalink
added errors focus
Browse files Browse the repository at this point in the history
  • Loading branch information
Beverly Nguyen authored and Beverly Nguyen committed Dec 10, 2024
1 parent 28a6b44 commit 2fb4b75
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/main/views/send.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ def send_one_off_step(service_id, template_id, step_index):
link_to_upload=(
request.endpoint == "main.send_one_off_step" and step_index == 0
),
errors = form.errors if form.errors else None
)


Expand Down
1 change: 0 additions & 1 deletion app/templates/views/check/ok.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{% from "components/banner.html" import banner_wrapper %}
{% from "components/page-header.html" import page_header %}
{% from "components/components/button/macro.njk" import usaButton %}
{% from "components/components/skip-link/macro.njk" import usaSkipLink %}
{% from "components/components/back-link/macro.njk" import usaBackLink %}

{% set file_contents_header_id = 'file-preview' %}
Expand Down
1 change: 0 additions & 1 deletion app/templates/views/check/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% from "components/table.html" import list_table, field, text_field, hidden_field_heading %}
{% from "components/page-header.html" import page_header %}
{% from "components/components/button/macro.njk" import usaButton %}
{% from "components/components/skip-link/macro.njk" import usaSkipLink %}
{% from "components/components/back-link/macro.njk" import usaBackLink %}

{% set file_contents_header_id = 'file-preview' %}
Expand Down
19 changes: 18 additions & 1 deletion app/templates/views/send-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
{{ usaBackLink({ "href": back_link }) }}
{% endblock %}


{% block skipLink %}
{% if errors %}
<div>
{{ usaSkipLink({
"href": '#main-content',
"text": 'Skip to main content'
}) }}
</div>
{% else %}
{{ usaSkipLink({
"href": '#main-content',
"text": 'Skip to main content'
}) }}
{% endif %}
{% endblock %}

{% block maincolumn_content %}

{{ page_header(page_title) }}
Expand All @@ -24,7 +41,7 @@
data_kwargs={'force-focus': True}
) %}
<div class="grid-row">
<div class="grid-col-12 {% if form.placeholder_value.label.text == 'phone number' %}extra-tracking{% endif %}">
<div class="grid-col-12 {% if form.placeholder_value.label.text == 'phone number' %}extra-tracking{% endif %}" aria-live="polite" role="alert">
{{ form.placeholder_value(param_extensions={"classes": ""}) }}
</div>
{% if skip_link or link_to_upload %}
Expand Down

0 comments on commit 2fb4b75

Please sign in to comment.