From d0fa640642f044f9239b3544a9875c3997c82f06 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Mon, 11 Nov 2019 10:06:51 +0000 Subject: [PATCH 01/10] Update footer links to include new categories --- app/templates/admin_template.html | 49 ++++++++++++++++++------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index 4d705ad73..4398a1900 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -1,6 +1,5 @@ {% extends "template.njk" %} {% from "components/banner.html" import banner %} -{% from "components/notify-footer.html" import notify_footer %} {% block headIcons %} @@ -147,35 +146,29 @@ {% set meta_suffix = 'Built by the Government Digital Service' %} {% endif %} - {{ notify_footer({ + {{ govukFooter({ "classes": "js-footer", "navigation": [ { + "title": "Support", "columns": 1, "items": [ { "href": url_for('main.support'), - "text": "Support" + "text": "24-hour online support" }, { "href": "https://status.notifications.service.gov.uk", "text": "System status" }, - { - "href": "https://www.gov.uk/performance/govuk-notify", - "text": "Performance" - }, { "href": "https://ukgovernmentdigital.slack.com/messages/C0E1ADVPC", - "text": "Slack channel" - }, - { - "href": "https://gds.blog.gov.uk/category/notify/", - "text": "Blog" + "text": "Chat to us on Slack" } ] }, { + "title": "About Notify", "columns": 1, "items": [ { @@ -186,14 +179,6 @@ "href": url_for("main.roadmap"), "text": "Roadmap" }, - { - "href": url_for("main.trial_mode_new"), - "text": "Trial mode" - }, - { - "href": url_for("main.message_status"), - "text": "Message status" - }, { "href": url_for("main.security"), "text": "Security" @@ -201,10 +186,19 @@ { "href": url_for("main.terms"), "text": "Terms of use" + }, + { + "href": "https://www.gov.uk/performance/govuk-notify", + "text": "Performance" + }, + { + "href": "https://gds.blog.gov.uk/category/notify/", + "text": "Blog" } ] }, { + "title": "Pricing and payment", "columns": 1, "items": [ { @@ -218,11 +212,24 @@ ] }, { + "title": "Using Notify", "columns": 1, "items": [ + { + "href": url_for("main.get_started"), + "text": "Get started" + }, + { + "href": url_for("main.trial_mode_new"), + "text": "Trial mode" + }, + { + "href": url_for("main.message_status"), + "text": "Message status" + }, { "href": url_for("main.documentation"), - "text": "Documentation" + "text": "API documentation" } ] } From 4ca2e06e6c2c4d6977e28b49f25b836bb12dbc41 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Mon, 11 Nov 2019 10:07:42 +0000 Subject: [PATCH 02/10] Remove redundant custom footer component Now the footer links have headings we don't need this. --- app/templates/components/notify-footer.html | 90 --------------------- 1 file changed, 90 deletions(-) delete mode 100644 app/templates/components/notify-footer.html diff --git a/app/templates/components/notify-footer.html b/app/templates/components/notify-footer.html deleted file mode 100644 index ccb8f2301..000000000 --- a/app/templates/components/notify-footer.html +++ /dev/null @@ -1,90 +0,0 @@ -{% macro notify_footer(params) %} - -
-
- {% if params.navigation %} - - - {% endif %} - -
-
- -{% endmacro %} From 62fbc07bff447364f3d0969f9b6c2cb3e44b7fa4 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Mon, 30 Dec 2019 14:08:28 +0000 Subject: [PATCH 03/10] Use `--end` class for header nav Uses `govuk-header__navigation--end` class which does away with the need for a custom override. Based on suggestion by @quis: https://github.com/alphagov/notifications-admin/pull/3181#discussion_r361977771 --- app/assets/stylesheets/govuk-frontend/overrides.scss | 11 ----------- app/templates/admin_template.html | 3 ++- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/govuk-frontend/overrides.scss b/app/assets/stylesheets/govuk-frontend/overrides.scss index 4269c4181..6b703f1fe 100644 --- a/app/assets/stylesheets/govuk-frontend/overrides.scss +++ b/app/assets/stylesheets/govuk-frontend/overrides.scss @@ -1,16 +1,5 @@ // Overrides for certain GOV.UK Frontend styles to make its components match this application's design -// Notify's header navigation aligns to the right -.govuk-header__navigation { - text-align: right; - - // reset the alignment of each item to left-to-right - .govuk-header__navigation-item { - text-align: left; - } - -} - // Additional padding-bottom override, following the GOV.UK Frontend spacing scale: // https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale .govuk-\!-padding-bottom-12 { diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index 4398a1900..9a00bbad2 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -124,7 +124,8 @@ {{ govukHeader({ "homepageUrl": url_for('main.show_accounts_or_dashboard'), "productName": "Notify", - "navigation": navigation + "navigation": navigation, + "navigationClasses": "govuk-header__navigation--end" }) }} {% endblock %} From 8291378ee2032dc799c33120939feb098540def7 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Mon, 30 Dec 2019 14:17:23 +0000 Subject: [PATCH 04/10] Reduce size of footer column headings --- app/assets/stylesheets/govuk-frontend/overrides.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/govuk-frontend/overrides.scss b/app/assets/stylesheets/govuk-frontend/overrides.scss index 6b703f1fe..5fc2cfa4c 100644 --- a/app/assets/stylesheets/govuk-frontend/overrides.scss +++ b/app/assets/stylesheets/govuk-frontend/overrides.scss @@ -37,3 +37,8 @@ } } + +// Make column headings smaller to prevent wrapping +.govuk-footer__heading { + @include govuk-font($size: 19, $weight: bold); +} From aa2c095704732b7487836d7389028008513ed406 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Mon, 30 Dec 2019 14:24:44 +0000 Subject: [PATCH 05/10] Update link to support --- app/templates/admin_template.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index 9a00bbad2..feefab8da 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -156,7 +156,7 @@ "items": [ { "href": url_for('main.support'), - "text": "24-hour online support" + "text": "Contact support" }, { "href": "https://status.notifications.service.gov.uk", From 6b27a9e7a38534d46dc68b55b80842f6906b1e7b Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Mon, 30 Dec 2019 15:15:02 +0000 Subject: [PATCH 06/10] Turn off 'Get started' link when signed out --- app/templates/admin_template.html | 67 ++++++++++++++++++++---------- app/templates/views/signedout.html | 2 + 2 files changed, 47 insertions(+), 22 deletions(-) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index feefab8da..e79f170ea 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -147,6 +147,50 @@ {% set meta_suffix = 'Built by the Government Digital Service' %} {% endif %} + {% if signed_out %} + {% set using_notify_links = { + "title": "Using Notify", + "columns": 1, + "items": [ + { + "href": url_for("main.get_started"), + "text": "Get started" + }, + { + "href": url_for("main.trial_mode_new"), + "text": "Trial mode" + }, + { + "href": url_for("main.message_status"), + "text": "Message status" + }, + { + "href": url_for("main.documentation"), + "text": "API documentation" + } + ] + } %} + {% else %} + {% set using_notify_links = { + "title": "Using Notify", + "columns": 1, + "items": [ + { + "href": url_for("main.trial_mode_new"), + "text": "Trial mode" + }, + { + "href": url_for("main.message_status"), + "text": "Message status" + }, + { + "href": url_for("main.documentation"), + "text": "API documentation" + } + ] + } %} + {% endif %} + {{ govukFooter({ "classes": "js-footer", "navigation": [ @@ -212,28 +256,7 @@ } ] }, - { - "title": "Using Notify", - "columns": 1, - "items": [ - { - "href": url_for("main.get_started"), - "text": "Get started" - }, - { - "href": url_for("main.trial_mode_new"), - "text": "Trial mode" - }, - { - "href": url_for("main.message_status"), - "text": "Message status" - }, - { - "href": url_for("main.documentation"), - "text": "API documentation" - } - ] - } + using_notify_links ], "meta": { "items": meta_items, diff --git a/app/templates/views/signedout.html b/app/templates/views/signedout.html index ea9e7db75..6b3a4a44a 100644 --- a/app/templates/views/signedout.html +++ b/app/templates/views/signedout.html @@ -1,5 +1,7 @@ {% extends "fullwidth_template.html" %} +{% set signed_out = True %} + {% block meta %} {% endblock %} From 8a597437463872dbbcedec7b9677c0cceee21d4f Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Mon, 30 Dec 2019 16:27:15 +0000 Subject: [PATCH 07/10] Remove signed_out template variable Turns out there's no need for it: https://github.com/alphagov/notifications-admin/pull/3181#discussion_r362020673 --- app/templates/admin_template.html | 10 +++++----- app/templates/views/signedout.html | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index e79f170ea..61afa8562 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -147,15 +147,11 @@ {% set meta_suffix = 'Built by the Government Digital Service' %} {% endif %} - {% if signed_out %} + {% if current_user.is_authenticated %} {% set using_notify_links = { "title": "Using Notify", "columns": 1, "items": [ - { - "href": url_for("main.get_started"), - "text": "Get started" - }, { "href": url_for("main.trial_mode_new"), "text": "Trial mode" @@ -175,6 +171,10 @@ "title": "Using Notify", "columns": 1, "items": [ + { + "href": url_for("main.get_started"), + "text": "Get started" + }, { "href": url_for("main.trial_mode_new"), "text": "Trial mode" diff --git a/app/templates/views/signedout.html b/app/templates/views/signedout.html index 6b3a4a44a..ea9e7db75 100644 --- a/app/templates/views/signedout.html +++ b/app/templates/views/signedout.html @@ -1,7 +1,5 @@ {% extends "fullwidth_template.html" %} -{% set signed_out = True %} - {% block meta %} {% endblock %} From f7d115d0defc2b43bcc7c4c762fe64d09c77cf22 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Tue, 31 Dec 2019 10:02:13 +0000 Subject: [PATCH 08/10] Revert "Remove signed_out template variable" This reverts commit 8a597437463872dbbcedec7b9677c0cceee21d4f. --- app/templates/admin_template.html | 10 +++++----- app/templates/views/signedout.html | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index 61afa8562..e79f170ea 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -147,11 +147,15 @@ {% set meta_suffix = 'Built by the Government Digital Service' %} {% endif %} - {% if current_user.is_authenticated %} + {% if signed_out %} {% set using_notify_links = { "title": "Using Notify", "columns": 1, "items": [ + { + "href": url_for("main.get_started"), + "text": "Get started" + }, { "href": url_for("main.trial_mode_new"), "text": "Trial mode" @@ -171,10 +175,6 @@ "title": "Using Notify", "columns": 1, "items": [ - { - "href": url_for("main.get_started"), - "text": "Get started" - }, { "href": url_for("main.trial_mode_new"), "text": "Trial mode" diff --git a/app/templates/views/signedout.html b/app/templates/views/signedout.html index ea9e7db75..6b3a4a44a 100644 --- a/app/templates/views/signedout.html +++ b/app/templates/views/signedout.html @@ -1,5 +1,7 @@ {% extends "fullwidth_template.html" %} +{% set signed_out = True %} + {% block meta %} {% endblock %} From 0375af3441d2150f35b9674f7d66ce99bad06a1c Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Tue, 31 Dec 2019 10:02:45 +0000 Subject: [PATCH 09/10] Revert "Turn off 'Get started' link when signed out" This reverts commit 6b27a9e7a38534d46dc68b55b80842f6906b1e7b. --- app/templates/admin_template.html | 67 ++++++++++-------------------- app/templates/views/signedout.html | 2 - 2 files changed, 22 insertions(+), 47 deletions(-) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index e79f170ea..feefab8da 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -147,50 +147,6 @@ {% set meta_suffix = 'Built by the Government Digital Service' %} {% endif %} - {% if signed_out %} - {% set using_notify_links = { - "title": "Using Notify", - "columns": 1, - "items": [ - { - "href": url_for("main.get_started"), - "text": "Get started" - }, - { - "href": url_for("main.trial_mode_new"), - "text": "Trial mode" - }, - { - "href": url_for("main.message_status"), - "text": "Message status" - }, - { - "href": url_for("main.documentation"), - "text": "API documentation" - } - ] - } %} - {% else %} - {% set using_notify_links = { - "title": "Using Notify", - "columns": 1, - "items": [ - { - "href": url_for("main.trial_mode_new"), - "text": "Trial mode" - }, - { - "href": url_for("main.message_status"), - "text": "Message status" - }, - { - "href": url_for("main.documentation"), - "text": "API documentation" - } - ] - } %} - {% endif %} - {{ govukFooter({ "classes": "js-footer", "navigation": [ @@ -256,7 +212,28 @@ } ] }, - using_notify_links + { + "title": "Using Notify", + "columns": 1, + "items": [ + { + "href": url_for("main.get_started"), + "text": "Get started" + }, + { + "href": url_for("main.trial_mode_new"), + "text": "Trial mode" + }, + { + "href": url_for("main.message_status"), + "text": "Message status" + }, + { + "href": url_for("main.documentation"), + "text": "API documentation" + } + ] + } ], "meta": { "items": meta_items, diff --git a/app/templates/views/signedout.html b/app/templates/views/signedout.html index 6b3a4a44a..ea9e7db75 100644 --- a/app/templates/views/signedout.html +++ b/app/templates/views/signedout.html @@ -1,7 +1,5 @@ {% extends "fullwidth_template.html" %} -{% set signed_out = True %} - {% block meta %} {% endblock %} From 59e40d4c3c025ee5c25ba61dd18903d36110392c Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Tue, 31 Dec 2019 10:29:56 +0000 Subject: [PATCH 10/10] Make dashboard test more specific It was picking up the 'Get started' text from the new link in the footer. --- tests/app/main/views/test_dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app/main/views/test_dashboard.py b/tests/app/main/views/test_dashboard.py index 65131cc6d..7d0ebc05c 100644 --- a/tests/app/main/views/test_dashboard.py +++ b/tests/app/main/views/test_dashboard.py @@ -181,7 +181,7 @@ def test_get_started_is_hidden_once_templates_exist( ) mock_get_service_templates.assert_called_once_with(SERVICE_ONE_ID) - assert 'Get started' not in page.text + assert not page.find('h2', string='Get started') def test_inbound_messages_not_visible_to_service_without_permissions(