Remove unused skip-link from contact list upload pages

Since file contents are directly below the header, there is no need
for a skip link moving focus to those file contents.
This commit is contained in:
Pea Tyczynska
2020-08-18 12:25:47 +01:00
parent 8659e46828
commit 33ebd01d70
5 changed files with 15 additions and 61 deletions

View File

@@ -6,13 +6,6 @@
{% from "components/back-link/macro.njk" import govukBackLink %}
{% from "components/message-count-label.html" import message_count_label, recipient_count_label %}
{% set file_contents_header_id = 'file-preview' %}
{% macro skip_to_file_contents() %}
<p class="govuk-visually-hidden">
<a class="govuk-link govuk-link--no-visited-state" href="#{{ file_contents_header_id }}">Skip to file contents</a>
</p>
{% endmacro %}
{% block service_page_title %}
Error
{% endblock %}
@@ -48,9 +41,6 @@
</p>
{% endif %}
{{ skip_to_file_contents() }}
{% endcall %}
</div>
@@ -66,7 +56,7 @@
<a href="#content" class="govuk-link govuk-link--no-visited-state back-to-top-link">Back to top</a>
</div>
<h2 class="heading-medium" id="{{ file_contents_header_id }}">{{ original_file_name }}</h2>
<h2 class="heading-medium" id="file-preview">{{ original_file_name }}</h2>
{% call(item, row_number) list_table(
recipients.displayed_rows,

View File

@@ -6,13 +6,6 @@
{% from "components/message-count-label.html" import message_count_label, recipient_count_label %}
{% from "components/button/macro.njk" import govukButton %}
{% set file_contents_header_id = 'file-preview' %}
{% macro skip_to_file_contents() %}
<p class="govuk-visually-hidden">
<a class="govuk-link govuk-link--no-visited-state" href="#{{ file_contents_header_id }}">Skip to file contents</a>
</p>
{% endmacro %}
{% block service_page_title %}
{{ original_file_name }}
{% endblock %}

View File

@@ -6,12 +6,6 @@
{% from "components/back-link/macro.njk" import govukBackLink %}
{% from "components/message-count-label.html" import message_count_label %}
{% set file_contents_header_id = 'file-preview' %}
{% macro skip_to_file_contents() %}
<p class="govuk-visually-hidden">
<a class="govuk-link govuk-link--no-visited-state" href="#{{ file_contents_header_id }}">Skip to file contents</a>
</p>
{% endmacro %}
{% block service_page_title %}
Error
@@ -43,7 +37,6 @@
{% endfor %}
</ul>
{% endif %}
{{ skip_to_file_contents() }}
{% endcall %}
</div>

View File

@@ -6,12 +6,6 @@
{% from "components/back-link/macro.njk" import govukBackLink %}
{% from "components/message-count-label.html" import message_count_label %}
{% set file_contents_header_id = 'file-preview' %}
{% macro skip_to_file_contents() %}
<p class="govuk-visually-hidden">
<a class="govuk-link govuk-link--no-visited-state" href="#{{ file_contents_header_id }}">Skip to file contents</a>
</p>
{% endmacro %}
{% block service_page_title %}
Error
@@ -56,9 +50,6 @@
</p>
{% endif %}
{{ skip_to_file_contents() }}
{% endcall %}
</div>
@@ -76,7 +67,7 @@
{% set column_headers = recipients._raw_column_headers if recipients.duplicate_recipient_column_headers else recipients.column_headers %}
<h2 class="heading-medium" id="{{ file_contents_header_id }}">{{ original_file_name }}</h2>
<h2 class="heading-medium" id="file-preview">{{ original_file_name }}</h2>
<div class="fullscreen-content" data-module="fullscreen-table">
{% call(item, row_number) list_table(

View File

@@ -40,8 +40,7 @@ def test_upload_contact_list_page(client_request):
(
'Your file has too many columns '
'It needs to have 1 column, called email address or phone number. '
'Right now it has 2 columns called telephone and name. '
'Skip to file contents'
'Right now it has 2 columns called telephone and name.'
),
'Row in file 1 telephone name',
'2 +447700900986',
@@ -54,8 +53,7 @@ def test_upload_contact_list_page(client_request):
(
'Your file has too many columns '
'It needs to have 1 column, called email address or phone number. '
'Right now it has 2 columns called phone number and email address. '
'Skip to file contents'
'Right now it has 2 columns called phone number and email address.'
),
'Row in file 1 phone number email address',
'2 +447700900986 test@example.com',
@@ -67,8 +65,7 @@ def test_upload_contact_list_page(client_request):
""",
(
'Theres a problem with invalid.csv '
'You need to fix 1 email address. '
'Skip to file contents'
'You need to fix 1 email address.'
),
'Row in file 1 email address',
'2 Not a valid email address +447700900986',
@@ -80,8 +77,7 @@ def test_upload_contact_list_page(client_request):
""",
(
'Theres a problem with invalid.csv '
'You need to fix 1 phone number. '
'Skip to file contents'
'You need to fix 1 phone number.'
),
'Row in file 1 phone number',
'2 Must not contain letters or symbols test@example.com',
@@ -94,8 +90,7 @@ def test_upload_contact_list_page(client_request):
(
'Your file has too many columns '
'It needs to have 1 column, called email address or phone number. '
'Right now it has 3 columns called phone number, phone number and PHONE_NUMBER. '
'Skip to file contents'
'Right now it has 3 columns called phone number, phone number and PHONE_NUMBER.'
),
'Row in file 1 phone number phone number PHONE_NUMBER',
'2 +447700900333 +447700900333 +447700900333',
@@ -106,8 +101,7 @@ def test_upload_contact_list_page(client_request):
""",
(
'Your file is missing some rows '
'It needs at least one row of data. '
'Skip to file contents'
'It needs at least one row of data.'
),
'Row in file 1 phone number',
'',
@@ -117,8 +111,7 @@ def test_upload_contact_list_page(client_request):
(
'Your file is missing some rows '
'It needs at least one row of data, in a column called '
'email address or phone number. '
'Skip to file contents'
'email address or phone number.'
),
'Row in file 1 +447700900986',
'',
@@ -128,8 +121,7 @@ def test_upload_contact_list_page(client_request):
(
'Your file is missing some rows '
'It needs at least one row of data, in a column called '
'email address or phone number. '
'Skip to file contents'
'email address or phone number.'
),
'Row in file 1',
'',
@@ -143,8 +135,7 @@ def test_upload_contact_list_page(client_request):
""",
(
'Theres a problem with invalid.csv '
'You need to enter missing data in 1 row. '
'Skip to file contents'
'You need to enter missing data in 1 row.'
),
'Row in file 1 phone number',
(
@@ -158,8 +149,7 @@ def test_upload_contact_list_page(client_request):
""",
(
'Theres a problem with invalid.csv '
'You need to fix 1 phone number. '
'Skip to file contents'
'You need to fix 1 phone number.'
),
'Row in file 1 phone number',
'2 Not enough digits +447700900',
@@ -173,8 +163,7 @@ def test_upload_contact_list_page(client_request):
""",
(
'Theres a problem with invalid.csv '
'You need to fix 2 email addresses. '
'Skip to file contents'
'You need to fix 2 email addresses.'
),
'Row in file 1 email address',
(
@@ -257,8 +246,7 @@ def test_upload_csv_file_shows_error_banner_for_too_many_rows(
assert normalize_spaces(page.select_one('.banner-dangerous').text) == (
'Your file has too many rows '
'Notify can store files up to 50,000 rows in size. '
'Your file has 50,001 rows. '
'Skip to file contents'
'Your file has 50,001 rows.'
)
assert len(page.select('tbody tr')) == 50
assert normalize_spaces(page.select_one('.table-show-more-link').text) == (
@@ -288,8 +276,7 @@ def test_upload_csv_shows_trial_mode_error(
assert normalize_spaces(page.select_one('.banner-dangerous').text) == (
'You cannot save this phone number '
'In trial mode you can only send to yourself and members of your team '
'Skip to file contents'
'In trial mode you can only send to yourself and members of your team'
)
assert page.select_one('.banner-dangerous a')['href'] == url_for(
'main.trial_mode_new'