mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 17:45:32 -04:00
Show rejected broadcasts on ‘Previous alerts’ page
Two reasons to not hide rejected broadcasts: - if a broadcast was rejected by mistake then it’s useful to have an audit of who did that - it means you can still see old broadcasts without having to leave in pending-approval, which is dangerous because they might accidentally be approved
This commit is contained in:
@@ -48,7 +48,11 @@ def broadcast_dashboard(service_id):
|
||||
def broadcast_dashboard_previous(service_id):
|
||||
return render_template(
|
||||
'views/broadcast/previous-broadcasts.html',
|
||||
broadcasts=BroadcastMessages(service_id).with_status('cancelled', 'completed'),
|
||||
broadcasts=BroadcastMessages(service_id).with_status(
|
||||
'cancelled',
|
||||
'completed',
|
||||
'rejected',
|
||||
),
|
||||
empty_message='You do not have any previous alerts',
|
||||
view_broadcast_endpoint='.view_previous_broadcast',
|
||||
)
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
<p class="govuk-body govuk-!-margin-bottom-0 govuk-hint">
|
||||
Waiting for approval
|
||||
</p>
|
||||
{% elif item.status == 'rejected' %}
|
||||
<p class="govuk-body govuk-!-margin-bottom-0 govuk-hint">
|
||||
Rejected {{ item.updated_at|format_datetime_relative }}
|
||||
</p>
|
||||
{% elif item.status == 'broadcasting' %}
|
||||
<p class="govuk-body govuk-!-margin-bottom-0 live-broadcast">
|
||||
Live since {{ item.starts_at|format_datetime_relative }}
|
||||
|
||||
@@ -420,6 +420,7 @@ def test_previous_broadcasts_page(
|
||||
normalize_spaces(row.text)
|
||||
for row in page.select('.ajax-block-container')[0].select('.file-list')
|
||||
] == [
|
||||
'Example template This is a test Rejected today at 1:20am England Scotland',
|
||||
'Example template This is a test Broadcast yesterday at 2:20pm England Scotland',
|
||||
'Example template This is a test Broadcast yesterday at 2:20am England Scotland',
|
||||
]
|
||||
|
||||
@@ -4420,6 +4420,13 @@ def mock_get_broadcast_messages(
|
||||
datetime.utcnow() - timedelta(days=10)
|
||||
).isoformat(),
|
||||
),
|
||||
partial_json(
|
||||
id_=uuid4(),
|
||||
status='rejected',
|
||||
updated_at=(
|
||||
datetime.utcnow() - timedelta(hours=1)
|
||||
).isoformat(),
|
||||
),
|
||||
]
|
||||
|
||||
return mocker.patch(
|
||||
|
||||
Reference in New Issue
Block a user