From 6233e3590227fd763a891ccf18aba33942577d68 Mon Sep 17 00:00:00 2001 From: stvnrlly Date: Mon, 12 Dec 2022 15:15:50 -0500 Subject: [PATCH] more accurate css classes --- app/templates/views/notifications.html | 3 +-- app/templates/views/organisations/organisation/index.html | 8 ++++---- app/templates/views/platform-admin/_global_stats.html | 4 ++-- app/templates/views/platform-admin/index.html | 4 ++-- tests/app/main/views/organisations/test_organisations.py | 4 ++-- tests/app/main/views/test_platform_admin.py | 6 +++--- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/templates/views/notifications.html b/app/templates/views/notifications.html index de92c1649..ec1f9a33d 100644 --- a/app/templates/views/notifications.html +++ b/app/templates/views/notifications.html @@ -5,9 +5,8 @@ {% from "components/form.html" import form_wrapper %} {% from "components/button/macro.njk" import govukButton %} -{% set title_status = '' %} {% set page_title = ( - (title_status + 99|message_count_label(message_type, suffix='')) | capitalize + (99|message_count_label(message_type, suffix='')) | capitalize if current_user.has_permissions('view_activity') else 'Sent messages' ) %} diff --git a/app/templates/views/organisations/organisation/index.html b/app/templates/views/organisations/organisation/index.html index cc76f8e35..edf2f0932 100644 --- a/app/templates/views/organisations/organisation/index.html +++ b/app/templates/views/organisations/organisation/index.html @@ -17,7 +17,7 @@
-
+

Emails

{{ big_number( @@ -27,7 +27,7 @@ ) }}
-
+

Text messages

{{ big_number( @@ -59,14 +59,14 @@ {{ service.service_name }}
-
+
{{ big_number( service.emails_sent, label=service.emails_sent|message_count_label('email'), smallest=True ) }}
-
+
{% if service.sms_cost %} {{ big_number( service.sms_cost, diff --git a/app/templates/views/platform-admin/_global_stats.html b/app/templates/views/platform-admin/_global_stats.html index 8dfefdedc..55f2601a9 100644 --- a/app/templates/views/platform-admin/_global_stats.html +++ b/app/templates/views/platform-admin/_global_stats.html @@ -1,7 +1,7 @@ {% from "components/big-number.html" import big_number_with_status %}
-
+
{{ big_number_with_status( global_stats.email.delivered + global_stats.email.failed, global_stats.email.delivered|message_count_label('email'), @@ -11,7 +11,7 @@ smaller=True ) }}
-
+
{{ big_number_with_status( global_stats.sms.delivered + global_stats.sms.failed, global_stats.sms.delivered|message_count_label('sms'), diff --git a/app/templates/views/platform-admin/index.html b/app/templates/views/platform-admin/index.html index 2af3af366..b005cfd78 100644 --- a/app/templates/views/platform-admin/index.html +++ b/app/templates/views/platform-admin/index.html @@ -32,7 +32,7 @@
{% for noti_type in global_stats %} -
+
{{ big_number_simple( noti_type.black_box.number, noti_type.black_box.number|message_count_label(noti_type.black_box.notification_type) @@ -53,7 +53,7 @@
{% for noti_type in global_stats %} -
+
{{ "{:,}".format(noti_type.test_data.number) }} {{ noti_type.test_data.label }} diff --git a/tests/app/main/views/organisations/test_organisations.py b/tests/app/main/views/organisations/test_organisations.py index 8e606be36..8d24f94bd 100644 --- a/tests/app/main/views/organisations/test_organisations.py +++ b/tests/app/main/views/organisations/test_organisations.py @@ -469,7 +469,7 @@ def test_organisation_services_shows_live_services_and_usage( mock.assert_called_once_with(ORGANISATION_ID, 2019) services = page.select('main h3') - usage_rows = page.select('main .govuk-grid-column-one-third') + usage_rows = page.select('main .govuk-grid-column-one-half') assert len(services) == 2 # Totals @@ -510,7 +510,7 @@ def test_organisation_services_shows_live_services_and_usage_with_count_of_1( client_request.login(active_user_with_permissions) page = client_request.get('.organisation_dashboard', org_id=ORGANISATION_ID) - usage_rows = page.select('main .govuk-grid-column-one-third') + usage_rows = page.select('main .govuk-grid-column-one-half') # Totals assert normalize_spaces(usage_rows[0].text) == "Emails 1 sent" diff --git a/tests/app/main/views/test_platform_admin.py b/tests/app/main/views/test_platform_admin.py index 918c80d7b..e0179980c 100644 --- a/tests/app/main/views/test_platform_admin.py +++ b/tests/app/main/views/test_platform_admin.py @@ -629,16 +629,16 @@ def test_platform_admin_displays_stats_in_right_boxes_and_with_correct_styling( # Email permanent failure status box - number is correct assert '3 permanent failures' in page.find_all( - 'div', class_='govuk-grid-column-one-third' + 'div', class_='govuk-grid-column-one-half' )[0].find(string=re.compile('permanent')) # Email complaints status box - link exists and number is correct assert page.find('a', string='15 complaints') # SMS total box - number is correct assert page.find_all('span', class_='big-number-number')[1].text.strip() == '168' # Test SMS box - number is correct - assert '5' in page.find_all('div', class_='govuk-grid-column-one-third')[3].text + assert '5' in page.find_all('div', class_='govuk-grid-column-one-half')[3].text # SMS technical failure status box - number is correct and failure class is used - assert '1 technical failures' in page.find_all('div', class_='govuk-grid-column-one-third')[1].find( + assert '1 technical failures' in page.find_all('div', class_='govuk-grid-column-one-half')[1].find( 'div', class_='big-number-status-failing').text