mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 01:18:24 -04:00
Replace blue boxes with total + delivery estimate
The sending/failed/delivered thing: - doesn’t map to the actual states of letters - doesn’t respond quickly enough to give you feedback that something is happening (because "sending" doesn’t even go to "probably delivered" for a few days) This commit replaces these 4 boxes with some more useful information: - one number – how many letters were in the job in total - when we estimate that the letters will be delivered
This commit is contained in:
@@ -40,6 +40,7 @@ from app.utils import (
|
||||
FAILURE_STATUSES,
|
||||
SENDING_STATUSES,
|
||||
DELIVERED_STATUSES,
|
||||
get_letter_timings,
|
||||
)
|
||||
from app.statistics_utils import add_rate_to_job
|
||||
|
||||
@@ -353,12 +354,22 @@ def get_job_partials(job):
|
||||
template_id=job['template'],
|
||||
version=job['template_version']
|
||||
)['data']
|
||||
return {
|
||||
'counts': render_template(
|
||||
|
||||
if template['template_type'] == 'letter':
|
||||
counts = render_template(
|
||||
'partials/jobs/count-letters.html',
|
||||
total=job.get('notification_count', 0),
|
||||
delivery_estimate=get_letter_timings(job['created_at']).earliest_delivery,
|
||||
)
|
||||
else:
|
||||
counts = render_template(
|
||||
'partials/count.html',
|
||||
counts=_get_job_counts(job),
|
||||
status=filter_args['status']
|
||||
),
|
||||
)
|
||||
|
||||
return {
|
||||
'counts': counts,
|
||||
'notifications': render_template(
|
||||
'partials/jobs/notifications.html',
|
||||
notifications=list(
|
||||
|
||||
23
app/templates/partials/jobs/count-letters.html
Normal file
23
app/templates/partials/jobs/count-letters.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% from 'components/big-number.html' import big_number %}
|
||||
{% from 'components/message-count-label.html' import message_count_label %}
|
||||
|
||||
<div class="grid-row bottom-gutter-2-3">
|
||||
<div class="column-half">
|
||||
<div class="keyline-block">
|
||||
{{ big_number(
|
||||
total,
|
||||
message_count_label(total, 'letter', suffix='')|capitalize,
|
||||
smaller=True
|
||||
)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-half">
|
||||
<div class="keyline-block">
|
||||
{{ big_number(
|
||||
delivery_estimate|string|format_date_short,
|
||||
'Estimated delivery date',
|
||||
smaller=True
|
||||
)}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user