From 6160be9db41377a52653716bb15f83fed5bae490 Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Mon, 11 Nov 2019 08:54:27 +0000 Subject: [PATCH 01/10] Update 401 error content --- app/templates/error/401.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/error/401.html b/app/templates/error/401.html index f6960986e..0e82c7d61 100644 --- a/app/templates/error/401.html +++ b/app/templates/error/401.html @@ -1,9 +1,9 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}Unauthorized{% endblock %} +{% block per_page_title %}You are not authorised to see this page – GOV.UK Notify{% endblock %} {% block maincolumn_content %}
-

401

-

You are not authorized to see this page.

+

You are not authorised to see this page

+

Sign in to GOV.UK Notify and try again.

{% endblock %} From ee1c3d6853f960db3dde60e0d585636a857af73c Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Mon, 11 Nov 2019 08:57:09 +0000 Subject: [PATCH 02/10] Update 403 error content --- app/templates/error/403.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/error/403.html b/app/templates/error/403.html index b6573c393..79304de86 100644 --- a/app/templates/error/403.html +++ b/app/templates/error/403.html @@ -1,13 +1,13 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}403{% endblock %} +{% block per_page_title %}You are not allowed to see this page – GOV.UK Notify{% endblock %} {% block maincolumn_content %}

- 403 + You are not allowed to see this page

- You do not have permission to view this page. + To check your permissions, speak to a member of your team who can manage settings, team and usage.

From e8c53ac2c5ff634839354e5432111ab335a323a2 Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Mon, 11 Nov 2019 09:02:57 +0000 Subject: [PATCH 03/10] Update 404 error content --- app/templates/error/404.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/templates/error/404.html b/app/templates/error/404.html index 341cd7040..a5ef74a26 100644 --- a/app/templates/error/404.html +++ b/app/templates/error/404.html @@ -1,13 +1,19 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}Page could not be found{% endblock %} +{% block per_page_title %}Page not found – GOV.UK Notify{% endblock %} {% block maincolumn_content %}

- Page could not be found + Page not found

- Check you’ve entered the correct web address. + If you typed the web address, check it is correct. +

+

+ If you pasted the web address, check you copied the entire address. +

+

+ If the web address is correct or you selected a link or button, contact us.

From d2c3705d57ea1704a211e196b260821f9addc74d Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Mon, 11 Nov 2019 09:05:15 +0000 Subject: [PATCH 04/10] Update 410 error content --- app/templates/error/410.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/templates/error/410.html b/app/templates/error/410.html index 3e734e10a..a5ef74a26 100644 --- a/app/templates/error/410.html +++ b/app/templates/error/410.html @@ -1,13 +1,19 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}Page not found{% endblock %} +{% block per_page_title %}Page not found – GOV.UK Notify{% endblock %} {% block maincolumn_content %}

- Page could not be found + Page not found

- Check you’ve entered the correct web address. + If you typed the web address, check it is correct. +

+

+ If you pasted the web address, check you copied the entire address. +

+

+ If the web address is correct or you selected a link or button, contact us.

From 0d9f5f5acf313c0d8aaa6b57b46e590c689baf5a Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Mon, 11 Nov 2019 09:07:05 +0000 Subject: [PATCH 05/10] Update 413 error content --- app/templates/error/413.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/error/413.html b/app/templates/error/413.html index 4dfddc603..e82a75b72 100644 --- a/app/templates/error/413.html +++ b/app/templates/error/413.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}File too big{% endblock %} +{% block per_page_title %}File too big – GOV.UK Notify{% endblock %} {% block maincolumn_content %}
From 0c18f3c55af5b972c6505082bb0eaeec6586e4f7 Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Mon, 11 Nov 2019 09:16:39 +0000 Subject: [PATCH 06/10] Update 500 error content --- app/templates/error/500.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/templates/error/500.html b/app/templates/error/500.html index 488db2d7d..433090b8a 100644 --- a/app/templates/error/500.html +++ b/app/templates/error/500.html @@ -1,12 +1,20 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}Server error{% endblock %} +{% block per_page_title %}Sorry, there’s a problem with the service – GOV.UK Notify{% endblock %} {% block maincolumn_content %}

- Sorry, we’re experiencing technical difficulties + Sorry, there’s a problem with GOV.UK Notify

-

Try again later.

+

+ Try again later. +

+

+ You can check our system status page to see if there are any known issues. +

+

+ To report a problem, email notify-support@digital.cabinet-office.gov.uk +

{% endblock %} From 894fc6eacf77cae9c15e3daacc3870f8eb2e553b Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Mon, 11 Nov 2019 09:43:35 +0000 Subject: [PATCH 07/10] Update page title --- app/templates/error/400.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/error/400.html b/app/templates/error/400.html index ce9c4f2bc..77e546877 100644 --- a/app/templates/error/400.html +++ b/app/templates/error/400.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}Bad Request{% endblock %} +{% block per_page_title %}Bad Request – GOV.UK Notify{% endblock %} {% block maincolumn_content %}
From 74e280ce5154cabae082e6dc0b1999a94be0e7e1 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Tue, 12 Nov 2019 17:02:38 +0000 Subject: [PATCH 08/10] Fix reference to `main.support` in views --- app/templates/error/404.html | 2 +- app/templates/error/410.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/error/404.html b/app/templates/error/404.html index a5ef74a26..87bb4f3bc 100644 --- a/app/templates/error/404.html +++ b/app/templates/error/404.html @@ -13,7 +13,7 @@ If you pasted the web address, check you copied the entire address.

- If the web address is correct or you selected a link or button, contact us. + If the web address is correct or you selected a link or button, contact us.

diff --git a/app/templates/error/410.html b/app/templates/error/410.html index a5ef74a26..87bb4f3bc 100644 --- a/app/templates/error/410.html +++ b/app/templates/error/410.html @@ -13,7 +13,7 @@ If you pasted the web address, check you copied the entire address.

- If the web address is correct or you selected a link or button, contact us. + If the web address is correct or you selected a link or button, contact us.

From 272c6a3c919ffb72f032843605eb3817fbf1537d Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Tue, 12 Nov 2019 17:06:06 +0000 Subject: [PATCH 09/10] Update tests with new error message content --- tests/app/main/test_errorhandlers.py | 4 ++-- tests/app/main/views/accounts/test_choose_accounts.py | 4 ++-- tests/app/main/views/test_accept_invite.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/app/main/test_errorhandlers.py b/tests/app/main/test_errorhandlers.py index 1b36bcbbc..aecff59aa 100644 --- a/tests/app/main/test_errorhandlers.py +++ b/tests/app/main/test_errorhandlers.py @@ -9,7 +9,7 @@ def test_bad_url_returns_page_not_found(client): response = client.get('/bad_url') assert response.status_code == 404 page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') - assert page.h1.string.strip() == 'Page could not be found' + assert page.h1.string.strip() == 'Page not found' def test_load_service_before_request_handles_404(client_request, mocker): @@ -35,7 +35,7 @@ def test_malformed_token_returns_page_not_found(logged_in_client, url): assert response.status_code == 404 page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') - assert page.h1.string.strip() == 'Page could not be found' + assert page.h1.string.strip() == 'Page not found' flash_banner = page.find('div', class_='banner-dangerous').string.strip() assert flash_banner == "There’s something wrong with the link you’ve used." diff --git a/tests/app/main/views/accounts/test_choose_accounts.py b/tests/app/main/views/accounts/test_choose_accounts.py index bc3c3b69b..7024ff34c 100644 --- a/tests/app/main/views/accounts/test_choose_accounts.py +++ b/tests/app/main/views/accounts/test_choose_accounts.py @@ -247,8 +247,8 @@ def test_choose_account_should_not_show_back_to_service_link_if_service_archived )), (service_two, 403, ( # Page has no ‘back to’ link - '403 ' - 'You do not have permission to view this page.' + 'You are not allowed to see this page ' + 'To check your permissions, speak to a member of your team who can manage settings, team and usage.' )), )) def test_should_not_show_back_to_service_if_user_doesnt_belong_to_service( diff --git a/tests/app/main/views/test_accept_invite.py b/tests/app/main/views/test_accept_invite.py index c1bc31804..e46e7a83f 100644 --- a/tests/app/main/views/test_accept_invite.py +++ b/tests/app/main/views/test_accept_invite.py @@ -415,7 +415,7 @@ def test_signed_in_existing_user_cannot_use_anothers_invite( _follow_redirects=True, _expected_status=403, ) - assert page.h1.string.strip() == '403' + assert page.h1.string.strip() == 'You are not allowed to see this page' flash_banners = page.find_all('div', class_='banner-dangerous') assert len(flash_banners) == 1 banner_contents = flash_banners[0].text.strip() From 0361fb69912a6f296fd2cfb5208da3a0813d4c25 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 18 Nov 2019 17:04:38 +0000 Subject: [PATCH 10/10] =?UTF-8?q?Fix=20duplicated=20=E2=80=98GOV.UK=20Noti?= =?UTF-8?q?fy=E2=80=99=20in=20page=20titles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `per_page_title` block appends ‘– GOV.UK Notify’ – there’s no need to hard code it (see https://github.com/alphagov/notifications-admin/blob/e4b040b380b91d95806b11d79d763b3b4e7af046/app/templates/admin_template.html#L15) --- app/templates/error/400.html | 2 +- app/templates/error/401.html | 2 +- app/templates/error/403.html | 2 +- app/templates/error/404.html | 2 +- app/templates/error/410.html | 2 +- app/templates/error/413.html | 2 +- app/templates/error/500.html | 2 +- tests/app/main/test_errorhandlers.py | 4 ++++ 8 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/templates/error/400.html b/app/templates/error/400.html index 77e546877..f874031c1 100644 --- a/app/templates/error/400.html +++ b/app/templates/error/400.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}Bad Request – GOV.UK Notify{% endblock %} +{% block per_page_title %}Bad request{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/401.html b/app/templates/error/401.html index 0e82c7d61..c5f513027 100644 --- a/app/templates/error/401.html +++ b/app/templates/error/401.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}You are not authorised to see this page – GOV.UK Notify{% endblock %} +{% block per_page_title %}You are not authorised to see this page{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/403.html b/app/templates/error/403.html index 79304de86..552188430 100644 --- a/app/templates/error/403.html +++ b/app/templates/error/403.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}You are not allowed to see this page – GOV.UK Notify{% endblock %} +{% block per_page_title %}You are not allowed to see this page{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/404.html b/app/templates/error/404.html index 87bb4f3bc..acb43af52 100644 --- a/app/templates/error/404.html +++ b/app/templates/error/404.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}Page not found – GOV.UK Notify{% endblock %} +{% block per_page_title %}Page not found{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/410.html b/app/templates/error/410.html index 87bb4f3bc..acb43af52 100644 --- a/app/templates/error/410.html +++ b/app/templates/error/410.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}Page not found – GOV.UK Notify{% endblock %} +{% block per_page_title %}Page not found{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/413.html b/app/templates/error/413.html index e82a75b72..4dfddc603 100644 --- a/app/templates/error/413.html +++ b/app/templates/error/413.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}File too big – GOV.UK Notify{% endblock %} +{% block per_page_title %}File too big{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/500.html b/app/templates/error/500.html index 433090b8a..0d3109996 100644 --- a/app/templates/error/500.html +++ b/app/templates/error/500.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block per_page_title %}Sorry, there’s a problem with the service – GOV.UK Notify{% endblock %} +{% block per_page_title %}Sorry, there’s a problem with the service{% endblock %} {% block maincolumn_content %}
diff --git a/tests/app/main/test_errorhandlers.py b/tests/app/main/test_errorhandlers.py index aecff59aa..6c52612bb 100644 --- a/tests/app/main/test_errorhandlers.py +++ b/tests/app/main/test_errorhandlers.py @@ -10,6 +10,7 @@ def test_bad_url_returns_page_not_found(client): assert response.status_code == 404 page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') assert page.h1.string.strip() == 'Page not found' + assert page.title.string.strip() == 'Page not found – GOV.UK Notify' def test_load_service_before_request_handles_404(client_request, mocker): @@ -38,6 +39,7 @@ def test_malformed_token_returns_page_not_found(logged_in_client, url): assert page.h1.string.strip() == 'Page not found' flash_banner = page.find('div', class_='banner-dangerous').string.strip() assert flash_banner == "There’s something wrong with the link you’ve used." + assert page.title.string.strip() == 'Page not found – GOV.UK Notify' def test_csrf_returns_400(logged_in_client, mocker): @@ -50,6 +52,7 @@ def test_csrf_returns_400(logged_in_client, mocker): assert response.status_code == 400 page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') assert page.h1.string.strip() == 'Something went wrong, please go back and try again.' + assert page.title.string.strip() == 'Bad request – GOV.UK Notify' def test_csrf_redirects_to_sign_in_page_if_not_signed_in(client, mocker): @@ -68,3 +71,4 @@ def test_405_returns_something_went_wrong_page(client, mocker): assert response.status_code == 405 page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') assert page.h1.string.strip() == 'Something went wrong, please go back and try again.' + assert page.title.string.strip() == 'Bad request – GOV.UK Notify'