Add broadcasts to the dashboard

Shows current and previous broadcasts. Does not add a page for viewing
an individual broadcast.

Broadcasts are split into live and previous.

Draft broadcasts are excluded from the dashboard.
This commit is contained in:
Chris Hill-Scott
2020-07-09 15:48:56 +01:00
parent 78bda9d267
commit 6b822f9fde
7 changed files with 237 additions and 36 deletions

View File

@@ -635,3 +635,44 @@ def assert_url_expected(actual, expected):
def find_element_by_tag_and_partial_text(page, tag, string):
return [e for e in page.find_all(tag) if string in e.text][0]
def broadcast_message_json(
*,
id_,
service_id,
template_id,
status,
created_by_id,
starts_at=None,
finishes_at=None,
cancelled_at=None,
):
return {
'id': id_,
'service_id': service_id,
'template_id': template_id,
'template_version': 123,
'template_name': 'Example template',
'personalisation': {},
'areas': [
'england', 'scotland',
],
'status': status,
'starts_at': starts_at,
'finishes_at': finishes_at,
'created_at': None,
'approved_at': None,
'cancelled_at': cancelled_at,
'updated_at': None,
'created_by_id': created_by_id,
'approved_by_id': None,
'cancelled_by_id': None,
}