Add a message if there are more than 50 rows

Similar to how we do it on the check page, we should indicate if there
are more results than we can show. No-one’s really complained about the
absence of this, but it can’t hurt.
This commit is contained in:
Chris Hill-Scott
2016-08-02 10:34:27 +01:00
parent 9e6111fd00
commit d0ef913520
3 changed files with 11 additions and 2 deletions

View File

@@ -50,6 +50,12 @@
{% endcall %}
{% endcall %}
{% if more_than_one_page %}
<p class="table-show-more-link">
Only showing the first 50 rows
</p>
{% endif %}
{% if notifications %}
</div>
{% endif %}

View File

@@ -95,6 +95,7 @@ def test_should_show_page_for_one_job(
)
assert csv_link.text == 'Download this report'
assert page.find('span', {'id': 'time-left'}).text == 'Data available for 7 days'
assert page.find('p', {'class': 'table-show-more-link'}).text.strip() == 'Only showing the first 50 rows'
mock_get_notifications.assert_called_with(
service_one['id'],
fake_uuid,

View File

@@ -910,14 +910,16 @@ def mock_get_notifications(mocker, api_user_active):
template={'template_type': set_template_type, 'name': 'name', 'id': 'id', 'version': 1},
rows=rows,
status=set_status,
job=job
job=job,
with_links=True
)
else:
return notification_json(
service_id,
rows=rows,
status=set_status,
job=job
job=job,
with_links=True
)
return mocker.patch(