mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-14 02:09:44 -04:00
Remove previous broadcasts from the dashboard
Since they have their own page now they don’t need to also appear on the dashboard.
This commit is contained in:
@@ -71,11 +71,6 @@ def get_broadcast_dashboard_partials(service_id):
|
||||
broadcasts=broadcast_messages.with_status('broadcasting'),
|
||||
empty_message='You do not have any live alerts at the moment',
|
||||
),
|
||||
previous_broadcasts=render_template(
|
||||
'views/broadcast/partials/dashboard-table.html',
|
||||
broadcasts=broadcast_messages.with_status('cancelled', 'completed'),
|
||||
empty_message='You do not have any previous alerts',
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -34,12 +34,4 @@
|
||||
'pending_approval_broadcasts'
|
||||
) }}
|
||||
|
||||
<h2 class="heading-medium govuk-!-margin-bottom-2">Previous alerts</h2>
|
||||
|
||||
{{ ajax_block(
|
||||
partials,
|
||||
url_for('.broadcast_dashboard_updates', service_id=current_service.id),
|
||||
'previous_broadcasts'
|
||||
) }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -278,7 +278,6 @@ def test_empty_broadcast_dashboard(
|
||||
] == [
|
||||
'You do not have any live alerts at the moment',
|
||||
'You do not have any alerts waiting for approval',
|
||||
'You do not have any previous alerts',
|
||||
]
|
||||
|
||||
|
||||
@@ -295,6 +294,8 @@ def test_broadcast_dashboard(
|
||||
service_id=SERVICE_ONE_ID,
|
||||
)
|
||||
|
||||
assert len(page.select('table')) == len(page.select('main h2')) == 2
|
||||
|
||||
assert normalize_spaces(page.select('main h2')[0].text) == (
|
||||
'Live alerts'
|
||||
)
|
||||
@@ -313,16 +314,6 @@ def test_broadcast_dashboard(
|
||||
'Example template To England and Scotland Prepared by Test User',
|
||||
]
|
||||
|
||||
assert normalize_spaces(page.select('main h2')[2].text) == (
|
||||
'Previous alerts'
|
||||
)
|
||||
assert [
|
||||
normalize_spaces(row.text) for row in page.select('table')[2].select('tbody tr')
|
||||
] == [
|
||||
'Example template To England and Scotland Stopped 10 February at 2:20am',
|
||||
'Example template To England and Scotland Finished yesterday at 8:20pm',
|
||||
]
|
||||
|
||||
|
||||
@freeze_time('2020-02-20 02:20')
|
||||
def test_broadcast_dashboard_json(
|
||||
@@ -344,12 +335,10 @@ def test_broadcast_dashboard_json(
|
||||
assert json_response.keys() == {
|
||||
'pending_approval_broadcasts',
|
||||
'live_broadcasts',
|
||||
'previous_broadcasts',
|
||||
}
|
||||
|
||||
assert 'Prepared by Test User' in json_response['pending_approval_broadcasts']
|
||||
assert 'Live until tomorrow at 2:20am' in json_response['live_broadcasts']
|
||||
assert 'Finished yesterday at 8:20pm' in json_response['previous_broadcasts']
|
||||
|
||||
|
||||
@freeze_time('2020-02-20 02:20')
|
||||
|
||||
Reference in New Issue
Block a user