mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 18:03:12 -04:00
Add a more accurate missing notifications message
Notifications could be missing because: - none have been created yet - they’ve been deleted This commit adds separate error messages for each case, rather than a less helpful generic one.
This commit is contained in:
@@ -480,6 +480,7 @@ def get_job_partials(job, template):
|
|||||||
job=job,
|
job=job,
|
||||||
template=template,
|
template=template,
|
||||||
template_version=job['template_version'],
|
template_version=job['template_version'],
|
||||||
|
service_data_retention_days=service_data_retention_days,
|
||||||
),
|
),
|
||||||
'status': render_template(
|
'status': render_template(
|
||||||
'partials/jobs/status.html',
|
'partials/jobs/status.html',
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
notifications,
|
notifications,
|
||||||
caption=uploaded_file_name,
|
caption=uploaded_file_name,
|
||||||
caption_visible=False,
|
caption_visible=False,
|
||||||
empty_message="No messages to show",
|
empty_message='These messages have been deleted because they were sent more than {} days ago'.format(service_data_retention_days) if job.job_status == 'finished' else 'No messages to show yet…',
|
||||||
field_headings=[
|
field_headings=[
|
||||||
'Recipient',
|
'Recipient',
|
||||||
'Status'
|
'Status'
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ def test_should_show_job_without_notifications(
|
|||||||
job_id=fake_uuid,
|
job_id=fake_uuid,
|
||||||
)
|
)
|
||||||
assert page.select_one('p.hint').text.strip() == 'Report is 50% complete…'
|
assert page.select_one('p.hint').text.strip() == 'Report is 50% complete…'
|
||||||
assert page.select_one('tbody').text.strip() == 'No messages to show'
|
assert page.select_one('tbody').text.strip() == 'No messages to show yet…'
|
||||||
|
|
||||||
|
|
||||||
def test_should_show_old_job(
|
def test_should_show_old_job(
|
||||||
@@ -335,7 +335,9 @@ def test_should_show_old_job(
|
|||||||
)
|
)
|
||||||
assert not page.select('p.hint')
|
assert not page.select('p.hint')
|
||||||
assert not page.select('a[download]')
|
assert not page.select('a[download]')
|
||||||
assert page.select_one('tbody').text.strip() == 'No messages to show'
|
assert page.select_one('tbody').text.strip() == (
|
||||||
|
'These messages have been deleted because they were sent more than 7 days ago'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@freeze_time("2016-01-01 11:09:00.061258")
|
@freeze_time("2016-01-01 11:09:00.061258")
|
||||||
|
|||||||
Reference in New Issue
Block a user