Show usage count on uploads page

Because we’re be grouping jobs under their parent contact lists it’s
good to have some information ‘scent’ to help people find their jobs,
ie by clicking into a contact list. It also lets you see which list have
been used more than others, maybe because the update hasn’t been sent
to that group of people yet.

The hint text under uploads always says when they were used. For contact
lists this is a bit more complicated, since they can:
- never have been used
- been used multiple times

This commit makes use of the new fields being returned by the API to say
determine when these messages are relevant. They also let us
differentiate between a contact list that’s never been used, and one
that has been used, but not recently enough to show any jobs against it.
This commit is contained in:
Chris Hill-Scott
2020-05-12 17:52:13 +01:00
parent 423875011c
commit 45b60e9555
6 changed files with 49 additions and 16 deletions

View File

@@ -338,6 +338,7 @@ def test_uploads_page_shows_contact_lists_first(
mock_get_no_uploads,
mock_get_jobs,
mock_get_contact_lists,
mock_get_service_data_retention,
):
page = client_request.get('main.uploads', service_id=SERVICE_ONE_ID)
@@ -349,14 +350,19 @@ def test_uploads_page_shows_contact_lists_first(
),
(
'phone number list.csv '
'Uploaded 13 March at 1:00pm '
'Used twice in the last 7 days '
'123 saved phone numbers'
),
(
'EmergencyContactList.xls '
'Uploaded 13 March at 10:59am '
'Not used in the last 7 days '
'100 saved email addresses'
),
(
'UnusedList.tsv '
'Not used yet '
'1 saved phone number'
),
(
'even_later.csv '
'Sending 1 January 2016 at 11:09pm '