Merge pull request #1963 from GSA/notify-admin-1937b

Fix moderate a11y violations reported by axe-core
This commit is contained in:
Jonathan Bobel
2024-09-25 16:35:02 -04:00
committed by GitHub
9 changed files with 15 additions and 14 deletions

View File

@@ -1,2 +1,4 @@
<a href="{%- if params.href %}{{ params.href }}{% else %}#{% endif -%}" class="usa-link usa-back-link display-inline-flex margin-bottom-3 {%- if params.classes %} {{ params.classes }}{% endif -%}"
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ (params.html | safe if params.html else (params.text if params.text else 'Back')) }}</a>
<nav class="usa-breadcrumb" aria-label="Breadcrumb">
<a href="{{ params.href or '#' }}" class="usa-link usa-back-link display-inline-flex {{ params.classes or '' }}"
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}" {% endfor %}>{{ params.html | safe or params.text or 'Back' }}</a>
</nav>

View File

@@ -1,7 +1,7 @@
{% if help %}
{% include 'partials/tour.html' %}
{% else %}
<nav class="nav margin-bottom-4">
<nav id="nav-main-nav" aria-label="Main navigation" class="nav margin-bottom-4">
<a class="usa-button margin-top-1 margin-bottom-5 width-full"
href="{{ url_for('.choose_template', service_id=current_service.id) }}">Send messages</a>
<ul class="usa-sidenav">

View File

@@ -1,4 +1,4 @@
<nav class="nav margin-bottom-4">
<nav id="nav-org-nav" aria-label="Organization navigation" class="nav margin-bottom-4">
<ul class="usa-sidenav">
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('dashboard') }}" href="{{ url_for('.organization_dashboard', org_id=current_org.id) }}">Usage</a></li>
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('team-members') }}" href="{{ url_for('.manage_org_users', org_id=current_org.id) }}">Team members</a></li>

View File

@@ -1,3 +1,4 @@
<nav id="nav-service-nav" aria-label="Service navigation">
<div class="navigation-service margin-top-5 display-flex flex-align-end flex-justify border-bottom padding-bottom-1">
{% if current_service.organization_id %}
{% if current_user.platform_admin or
@@ -13,3 +14,4 @@
</div>
<a href="{{ url_for('main.choose_account') }}" class="usa-link">Switch service</a>
</div>
</nav>

View File

@@ -21,7 +21,7 @@
{% endif %}
</p>
{% else %}
<nav id="template-list">
<nav id="template-list" aria-label="Template list">
{% set checkboxes_data = [] %}
{% if not current_user.has_permissions('manage_templates') %}

View File

@@ -37,7 +37,7 @@
{{ live_search(target_selector='#template-list .template-list-item', show=True, form=search_form) }}
<nav id="template-list">
<nav id="template-list" aria-label="Choose reply">
<ul>
{% for item in templates_and_folders %}
<li class="template-list-item {% if item.ancestors %}template-list-item-hidden-by-default{% endif %} {% if not item.ancestors %}template-list-item-without-ancestors{% endif %}">

View File

@@ -25,7 +25,7 @@
form=search_form,
autofocus=True
) }}
<nav id="template-list">
<nav id="template-list" aria-label="Copy template list">
<ul>
{% for item in services_templates_and_folders %}

View File

@@ -424,7 +424,7 @@ def test_caseworkers_get_caseworking_navigation(
client_request.login(active_caseworking_user)
page = client_request.get("main.choose_template", service_id=SERVICE_ONE_ID)
assert normalize_spaces(page.select_one("header + .grid-container nav").text) == (
"Send messages Sent messages"
"service one Switch service"
)
@@ -439,5 +439,5 @@ def test_caseworkers_see_jobs_nav_if_jobs_exist(
client_request.login(active_caseworking_user)
page = client_request.get("main.choose_template", service_id=SERVICE_ONE_ID)
assert normalize_spaces(page.select_one("header + .grid-container nav").text) == (
"Send messages Sent messages"
"service one Switch service"
)

View File

@@ -29,12 +29,9 @@ def check_axe_report(page):
results = axe.run(page)
# TODO we are setting this to critical for now
# to keep tests passing. Once the serious and
# moderate issues are fixed, we will set this
# 'moderate'
# TODO fix remaining 'moderate' failures
# so we can set the level we skip to minor only
for violation in results["violations"]:
assert violation["impact"] in [
"minor",
"moderate",
], f"Accessibility violation: {violation}"