mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 11:23:48 -05:00
Merge pull request #2324 from alphagov/state_postage
Display postage on letter notification page
This commit is contained in:
@@ -91,6 +91,7 @@ def view_notification(service_id, notification_id):
|
||||
help=get_help_argument(),
|
||||
estimated_letter_delivery_date=get_letter_timings(notification['created_at']).earliest_delivery,
|
||||
notification_id=notification['id'],
|
||||
postage=notification['postage'],
|
||||
can_receive_inbound=(current_service.has_permission('inbound_sms')),
|
||||
is_precompiled_letter=notification['template']['is_precompiled_letter']
|
||||
)
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
</p>
|
||||
|
||||
{% if template.template_type == 'letter' %}
|
||||
<p>
|
||||
Postage: {{ postage }} class
|
||||
</p>
|
||||
<p>
|
||||
Estimated delivery date: {{ estimated_letter_delivery_date|string|format_date_short }}
|
||||
</p>
|
||||
|
||||
@@ -369,6 +369,7 @@ def notification_json(
|
||||
reply_to_text=None,
|
||||
client_reference=None,
|
||||
created_by_name=None,
|
||||
postage=None,
|
||||
):
|
||||
if template is None:
|
||||
template = template_json(service_id, str(generate_uuid()), type_=template_type)
|
||||
@@ -388,6 +389,8 @@ def notification_json(
|
||||
if status is None:
|
||||
status = 'delivered'
|
||||
links = {}
|
||||
if template_type == 'letter':
|
||||
postage = 'second'
|
||||
|
||||
if with_links:
|
||||
links = {
|
||||
@@ -415,6 +418,7 @@ def notification_json(
|
||||
'service': service_id,
|
||||
'template_version': template['version'],
|
||||
'personalisation': personalisation or {},
|
||||
'postage': postage,
|
||||
'notification_type': template_type,
|
||||
'reply_to_text': reply_to_text,
|
||||
'client_reference': client_reference,
|
||||
|
||||
@@ -157,6 +157,9 @@ def test_notification_page_shows_page_for_letter_notification(
|
||||
'sample template sent by Test User on 1 January at 1:01am'
|
||||
)
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(2)')[0].text) == (
|
||||
'Postage: second class'
|
||||
)
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(3)')[0].text) == (
|
||||
'Estimated delivery date: 6 January'
|
||||
)
|
||||
assert page.select('p.notification-status') == []
|
||||
|
||||
Reference in New Issue
Block a user