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:
Chris Hill-Scott
2020-10-13 11:41:22 +01:00
parent f0220fa9fb
commit 698f98389c
3 changed files with 2 additions and 26 deletions

View File

@@ -71,11 +71,6 @@ def get_broadcast_dashboard_partials(service_id):
broadcasts=broadcast_messages.with_status('broadcasting'), broadcasts=broadcast_messages.with_status('broadcasting'),
empty_message='You do not have any live alerts at the moment', 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',
),
) )

View File

@@ -34,12 +34,4 @@
'pending_approval_broadcasts' '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 %} {% endblock %}

View File

@@ -278,7 +278,6 @@ def test_empty_broadcast_dashboard(
] == [ ] == [
'You do not have any live alerts at the moment', 'You do not have any live alerts at the moment',
'You do not have any alerts waiting for approval', '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, 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) == ( assert normalize_spaces(page.select('main h2')[0].text) == (
'Live alerts' 'Live alerts'
) )
@@ -313,16 +314,6 @@ def test_broadcast_dashboard(
'Example template To England and Scotland Prepared by Test User', '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') @freeze_time('2020-02-20 02:20')
def test_broadcast_dashboard_json( def test_broadcast_dashboard_json(
@@ -344,12 +335,10 @@ def test_broadcast_dashboard_json(
assert json_response.keys() == { assert json_response.keys() == {
'pending_approval_broadcasts', 'pending_approval_broadcasts',
'live_broadcasts', 'live_broadcasts',
'previous_broadcasts',
} }
assert 'Prepared by Test User' in json_response['pending_approval_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 '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') @freeze_time('2020-02-20 02:20')