Add some more content to the empty page state

We think that we need to make it clear what the difference between
uploading a letter and uploading a spreadsheet is, and where you go to
do each.

We get some confusion about uploading being behind the ‘Send’ button on
the template page. There’s some concern that launching the upload page
will increase this confusion, unless we head it off with some messaging.
This commit is contained in:
Chris Hill-Scott
2020-02-27 14:20:31 +00:00
parent ee8436ca85
commit e638b68af1
2 changed files with 19 additions and 10 deletions

View File

@@ -18,11 +18,17 @@
{% include 'views/dashboard/_jobs.html' %}
{% endif %}
{% if not jobs and not show_scheduled_jobs %}
{#
`_jobs.html` will show the You have no jobs message when
passed an empty list of jobs
#}
{% include 'views/dashboard/_jobs.html' %}
<p>
You have not uploaded any files yet.
</p>
{% if current_service.has_permission('upload_letters') %}
<p>
Upload a letter and Notify will print, pack and post it for you.
</p>
{% endif %}
<p>
To upload a list of contact details, first <a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.choose_template', service_id=current_service.id) }}">choose a template</a>.
</p>
{% endif %}
{{ previous_next_navigation(prev_page, next_page) }}
{% if current_service.can_upload_letters and current_user.has_permissions('send_messages') %}

View File

@@ -39,10 +39,13 @@ def test_no_upload_letters_button_without_permission(
@pytest.mark.parametrize('extra_permissions, expected_empty_message', (
(['letter'], (
'You have not uploaded any files yet'
'You have not uploaded any files yet. '
'To upload a list of contact details, first choose a template.'
)),
(['letter', 'upload_letters'], (
'Upload a letter and Notify will print, pack and post it for you.'
'You have not uploaded any files yet. '
'Upload a letter and Notify will print, pack and post it for you. '
'To upload a list of contact details, first choose a template.'
)),
))
def test_get_upload_hub_with_no_uploads(
@@ -56,9 +59,9 @@ def test_get_upload_hub_with_no_uploads(
mocker.patch('app.job_api_client.get_jobs', return_value={'data': []})
service_one['permissions'] += extra_permissions
page = client_request.get('main.uploads', service_id=SERVICE_ONE_ID)
assert normalize_spaces(
page.select_one('.table-empty-message').text
) == expected_empty_message
assert normalize_spaces(' '.join(
paragraph.text for paragraph in page.select('main p')
)) == expected_empty_message
assert not page.select('.file-list-filename')