mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 00:33:58 -04:00
Group uploaded letters by day of printing
Some teams have started uploading quite a lot of letters (in the hundreds per week). They’re also uploading CSVs of emails. This means the uploads page ends up quite jumbled. This is because: - there’s just a lot of items to scan through - conceptually it’s a bit odd to have batches of things displayed alongside individual things on the same page So instead we’re going to start grouping together uploaded letters. This will be by the date on which we ‘start’ printing them, or in other words the time at which they can no longer be cancelled. This feels like a natural grouping, and it matches what we know about people’s mental models of ‘batches’ and ‘runs’ when talking about printing. This grouping will be done in the API, so all this commit need to do is: - be ready to display this new type of pseudo-job - link to the page that displays all the uploaded letters for a given print day
This commit is contained in:
@@ -91,6 +91,7 @@ def test_get_upload_hub_with_no_uploads(
|
||||
assert not page.select('.file-list-filename')
|
||||
|
||||
|
||||
@freeze_time('2017-10-10 10:10:10')
|
||||
def test_get_upload_hub_page(
|
||||
mocker,
|
||||
client_request,
|
||||
@@ -108,28 +109,41 @@ def test_get_upload_hub_page(
|
||||
|
||||
uploads = page.select('tbody tr')
|
||||
|
||||
assert len(uploads) == 3
|
||||
|
||||
assert normalize_spaces(uploads[0].text.strip()) == (
|
||||
'Uploaded letters '
|
||||
'Printing today at 5:30pm '
|
||||
'33 letters'
|
||||
)
|
||||
assert uploads[0].select_one('a.file-list-filename-large')['href'] == url_for(
|
||||
'main.uploaded_letters',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
letter_print_day='2017-10-10',
|
||||
)
|
||||
|
||||
assert normalize_spaces(uploads[1].text.strip()) == (
|
||||
'some.csv '
|
||||
'Sent 1 January 2016 at 11:09am '
|
||||
'0 sending 8 delivered 2 failed'
|
||||
)
|
||||
assert uploads[0].select_one('a.file-list-filename-large')['href'] == (
|
||||
assert uploads[1].select_one('a.file-list-filename-large')['href'] == (
|
||||
'/services/{}/jobs/job_id_1'.format(SERVICE_ONE_ID)
|
||||
)
|
||||
|
||||
assert normalize_spaces(uploads[1].text.strip()) == (
|
||||
assert normalize_spaces(uploads[2].text.strip()) == (
|
||||
'some.pdf '
|
||||
'Sent 1 January 2016 at 11:09am '
|
||||
'Firstname Lastname '
|
||||
'123 Example Street'
|
||||
)
|
||||
assert normalize_spaces(str(uploads[1].select_one('.govuk-body'))) == (
|
||||
assert normalize_spaces(str(uploads[2].select_one('.govuk-body'))) == (
|
||||
'<p class="govuk-body letter-recipient-summary"> '
|
||||
'Firstname Lastname<br/> '
|
||||
'123 Example Street<br/> '
|
||||
'</p>'
|
||||
)
|
||||
assert uploads[1].select_one('a.file-list-filename-large')['href'] == (
|
||||
assert uploads[2].select_one('a.file-list-filename-large')['href'] == (
|
||||
'/services/{}/notification/letter_id_1'.format(SERVICE_ONE_ID)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user