From 4e2b4b5ac7b7a7606df40275cc56305a11de2488 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 20 Feb 2018 11:06:08 +0000 Subject: [PATCH 1/5] Rename endpoint Every endpoint in this file is to do with a service. Putting service in the name is redundant. --- app/main/views/service_settings.py | 2 +- app/templates/views/service-settings.html | 2 +- tests/app/main/views/test_service_settings.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index d39e41058..f56eb68db 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -161,7 +161,7 @@ def service_name_change_confirm(service_id): @main.route("/services//service-settings/request-to-go-live", methods=['GET', 'POST']) @login_required @user_has_permissions('manage_settings', admin_override=True) -def service_request_to_go_live(service_id): +def request_to_go_live(service_id): form = RequestToGoLiveForm() if form.validate_on_submit(): diff --git a/app/templates/views/service-settings.html b/app/templates/views/service-settings.html index d6de69edb..b39a7d850 100644 --- a/app/templates/views/service-settings.html +++ b/app/templates/views/service-settings.html @@ -228,7 +228,7 @@

To remove these restrictions - request to go live. + request to go live.

{% else %}

Your service is live

diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 865c8a18a..d4dde42b4 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -429,7 +429,7 @@ def test_should_show_request_to_go_live( client_request, ): page = client_request.get( - 'main.service_request_to_go_live', service_id=SERVICE_ONE_ID + 'main.request_to_go_live', service_id=SERVICE_ONE_ID ) assert page.h1.text == 'Request to go live' for channel, label in ( @@ -462,7 +462,7 @@ def test_should_redirect_after_request_to_go_live( ): mock_post = mocker.patch('app.main.views.service_settings.deskpro_client.create_ticket') page = client_request.post( - 'main.service_request_to_go_live', + 'main.request_to_go_live', service_id=SERVICE_ONE_ID, _data={ 'mou': 'yes', @@ -505,7 +505,7 @@ def test_should_redirect_after_request_to_go_live( 'main.service_settings', 'main.service_name_change', 'main.service_name_change_confirm', - 'main.service_request_to_go_live', + 'main.request_to_go_live', 'main.archive_service' ]) def test_route_permissions( @@ -536,7 +536,7 @@ def test_route_permissions( 'main.service_settings', 'main.service_name_change', 'main.service_name_change_confirm', - 'main.service_request_to_go_live', + 'main.request_to_go_live', 'main.service_switch_live', 'main.service_switch_research_mode', 'main.archive_service', @@ -564,7 +564,7 @@ def test_route_invalid_permissions( 'main.service_settings', 'main.service_name_change', 'main.service_name_change_confirm', - 'main.service_request_to_go_live', + 'main.request_to_go_live', ]) def test_route_for_platform_admin( mocker, From 7dc278c9596ac7ee70409136ad26113d92b534ea Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 20 Feb 2018 12:15:35 +0000 Subject: [PATCH 2/5] Split into two pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A lot of users aren’t reading or paying attention to the checklist on the request to go live page. We think that we can get more people to read it by putting it on its own page, where users won’t jump straight to filling in the form. This will, later on, let us make this page smarter by automatically detecting if they’ve done the necessary things. --- app/main/views/service_settings.py | 11 ++- .../service-settings/request-to-go-live.html | 71 ++++++------------- .../submit-request-to-go-live.html | 50 +++++++++++++ tests/app/main/views/test_service_settings.py | 20 +++++- 4 files changed, 100 insertions(+), 52 deletions(-) create mode 100644 app/templates/views/service-settings/submit-request-to-go-live.html diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index f56eb68db..572c430c7 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -158,10 +158,17 @@ def service_name_change_confirm(service_id): form=form) -@main.route("/services//service-settings/request-to-go-live", methods=['GET', 'POST']) +@main.route("/services//service-settings/request-to-go-live") @login_required @user_has_permissions('manage_settings', admin_override=True) def request_to_go_live(service_id): + return render_template('views/service-settings/request-to-go-live.html') + + +@main.route("/services//service-settings/submit-request-to-go-live", methods=['GET', 'POST']) +@login_required +@user_has_permissions('manage_settings', admin_override=True) +def submit_request_to_go_live(service_id): form = RequestToGoLiveForm() if form.validate_on_submit(): @@ -204,7 +211,7 @@ def request_to_go_live(service_id): flash('We’ve received your request to go live', 'default') return redirect(url_for('.service_settings', service_id=service_id)) - return render_template('views/service-settings/request-to-go-live.html', form=form) + return render_template('views/service-settings/submit-request-to-go-live.html', form=form) @main.route("/services//service-settings/switch-live") diff --git a/app/templates/views/service-settings/request-to-go-live.html b/app/templates/views/service-settings/request-to-go-live.html index f3bbd98de..ed58e2023 100644 --- a/app/templates/views/service-settings/request-to-go-live.html +++ b/app/templates/views/service-settings/request-to-go-live.html @@ -11,54 +11,29 @@ {% block maincolumn_content %} -

Request to go live

- -

- Before you request to go live, make sure you’ve: -

- - -
-
-

We need permission to process your data before we can make your service live.

- {{ radios(form.mou, option_hints={ - 'no': 'We’ll send you a copy', - 'don’t know': 'We’ll check for you', - }) }} -
- {{ checkbox_group('What kind of messages will you be sending?', [ - form.channel_email, - form.channel_sms, - form.channel_letter - ]) }} -
- {{ textbox(form.start_date, width='1-1') }} - {{ textbox(form.start_volume, width='1-1', hint='For example, ‘1,000 per month’.') }} - {{ textbox(form.peak_volume, width='1-1', hint='For example, ‘Messages will increase to 20,000 per month in January’.') }} -
- {{ checkbox_group('How are you going to send messages?', [ - form.method_one_off, - form.method_upload, - form.method_api - ]) }} -

- Once you’ve completed the tasks needed to set up, we’ll make your service live. We’ll do this within one working day. -

-

- By requesting to go live you’re agreeing to our terms of use. -

- - {{ page_footer('Request to go live') }} -
+

Request to go live

+

+ Before you request to go live, make sure you’ve: +

+ +

+ Next +

{% endblock %} diff --git a/app/templates/views/service-settings/submit-request-to-go-live.html b/app/templates/views/service-settings/submit-request-to-go-live.html new file mode 100644 index 000000000..d3d07609c --- /dev/null +++ b/app/templates/views/service-settings/submit-request-to-go-live.html @@ -0,0 +1,50 @@ +{% extends "withnav_template.html" %} +{% from "components/checkbox.html" import checkbox_group %} +{% from "components/textbox.html" import textbox %} +{% from "components/radios.html" import radios %} +{% from "components/page-footer.html" import page_footer %} +{% from "components/banner.html" import banner_wrapper %} + +{% block service_page_title %} + Request to go live +{% endblock %} + +{% block maincolumn_content %} + +

Request to go live

+ +
+
+

We need permission to process your data before we can make your service live.

+ {{ radios(form.mou, option_hints={ + 'no': 'We’ll send you a copy', + 'don’t know': 'We’ll check for you', + }) }} +
+ {{ checkbox_group('What kind of messages will you be sending?', [ + form.channel_email, + form.channel_sms, + form.channel_letter + ]) }} +
+ {{ textbox(form.start_date, width='1-1') }} + {{ textbox(form.start_volume, width='1-1', hint='For example, ‘1,000 per month’.') }} + {{ textbox(form.peak_volume, width='1-1', hint='For example, ‘Messages will increase to 20,000 per month in January’.') }} +
+ {{ checkbox_group('How are you going to send messages?', [ + form.method_one_off, + form.method_upload, + form.method_api + ]) }} +

+ Once you’ve completed the tasks needed to set up, we’ll make your service live. We’ll do this within one working day. +

+

+ By requesting to go live you’re agreeing to our terms of use. +

+ + {{ page_footer('Request to go live') }} +
+ + +{% endblock %} diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index d4dde42b4..34a0392f6 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -425,13 +425,26 @@ def test_should_raise_duplicate_name_handled( assert mock_verify_password.called -def test_should_show_request_to_go_live( +def test_should_show_request_to_go_live_checklist( client_request, ): page = client_request.get( 'main.request_to_go_live', service_id=SERVICE_ONE_ID ) assert page.h1.text == 'Request to go live' + assert page.select_one('main .button')['href'] == url_for( + 'main.submit_request_to_go_live', + service_id=SERVICE_ONE_ID, + ) + + +def test_should_show_request_to_go_live( + client_request, +): + page = client_request.get( + 'main.submit_request_to_go_live', service_id=SERVICE_ONE_ID + ) + assert page.h1.text == 'Request to go live' for channel, label in ( ('email', 'Emails'), ('sms', 'Text messages'), @@ -462,7 +475,7 @@ def test_should_redirect_after_request_to_go_live( ): mock_post = mocker.patch('app.main.views.service_settings.deskpro_client.create_ticket') page = client_request.post( - 'main.request_to_go_live', + 'main.submit_request_to_go_live', service_id=SERVICE_ONE_ID, _data={ 'mou': 'yes', @@ -506,6 +519,7 @@ def test_should_redirect_after_request_to_go_live( 'main.service_name_change', 'main.service_name_change_confirm', 'main.request_to_go_live', + 'main.submit_request_to_go_live', 'main.archive_service' ]) def test_route_permissions( @@ -537,6 +551,7 @@ def test_route_permissions( 'main.service_name_change', 'main.service_name_change_confirm', 'main.request_to_go_live', + 'main.submit_request_to_go_live', 'main.service_switch_live', 'main.service_switch_research_mode', 'main.archive_service', @@ -565,6 +580,7 @@ def test_route_invalid_permissions( 'main.service_name_change', 'main.service_name_change_confirm', 'main.request_to_go_live', + 'main.submit_request_to_go_live', ]) def test_route_for_platform_admin( mocker, From 8a857d2618b5f885d120307f2a13cf0e45c6f63a Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 20 Feb 2018 12:17:19 +0000 Subject: [PATCH 3/5] Move expectation-setting text to initial page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have tickets from people asking how long the process takes. I suspect that this is because they’re not getting to the bottom of the form before they’re ready to go live. --- app/templates/views/service-settings/request-to-go-live.html | 3 +++ .../views/service-settings/submit-request-to-go-live.html | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/views/service-settings/request-to-go-live.html b/app/templates/views/service-settings/request-to-go-live.html index ed58e2023..9e1665d03 100644 --- a/app/templates/views/service-settings/request-to-go-live.html +++ b/app/templates/views/service-settings/request-to-go-live.html @@ -32,6 +32,9 @@ writing text messages and emails +

+ Once you’ve made the request, we’ll put your service live within one working day. +

Next

diff --git a/app/templates/views/service-settings/submit-request-to-go-live.html b/app/templates/views/service-settings/submit-request-to-go-live.html index d3d07609c..ff4fb472a 100644 --- a/app/templates/views/service-settings/submit-request-to-go-live.html +++ b/app/templates/views/service-settings/submit-request-to-go-live.html @@ -36,9 +36,6 @@ form.method_upload, form.method_api ]) }} -

- Once you’ve completed the tasks needed to set up, we’ll make your service live. We’ll do this within one working day. -

By requesting to go live you’re agreeing to our terms of use.

From 4a6d0d08d400bf3462202b9888c093f87ff0c87d Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 20 Feb 2018 12:18:14 +0000 Subject: [PATCH 4/5] Add grid column to go live checklist page To keep the line length of the text nice and comfortable. --- .../service-settings/request-to-go-live.html | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/app/templates/views/service-settings/request-to-go-live.html b/app/templates/views/service-settings/request-to-go-live.html index 9e1665d03..ed8628485 100644 --- a/app/templates/views/service-settings/request-to-go-live.html +++ b/app/templates/views/service-settings/request-to-go-live.html @@ -10,33 +10,34 @@ {% endblock %} {% block maincolumn_content %} - -

Request to go live

- -

- Before you request to go live, make sure you’ve: -

- -

- Once you’ve made the request, we’ll put your service live within one working day. -

-

- Next -

- +
+
+

Request to go live

+

+ Before you request to go live, make sure you’ve: +

+ +

+ Once you’ve made the request, we’ll put your service live within one working day. +

+

+ Next +

+
+
{% endblock %} From c5b51bc5ecfcd43744b5ccc4717c5b0604c7dae6 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 20 Feb 2018 11:54:28 +0000 Subject: [PATCH 5/5] Link to request to go live from the guidance If we know what service someone has been using, we can take them to the right place. --- app/templates/views/using-notify.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/templates/views/using-notify.html b/app/templates/views/using-notify.html index d23f89520..325666eaa 100644 --- a/app/templates/views/using-notify.html +++ b/app/templates/views/using-notify.html @@ -25,7 +25,13 @@

Trial mode

When you sign up to GOV.UK Notify, you’ll start in trial mode. In trial mode, you can send up to 50 text messages and emails a day. You can only send them to yourself and other people in your team.

You can’t send letters in trial mode.

-

When you request to go live on Notify, we’ll remove these restrictions.

+

When you + {% if current_service and current_service.restricted %} + request to go live + {% else %} + request to go live + {% endif %} + on Notify, we’ll remove these restrictions.

Sending messages

When you send a message, it moves through different states in Notify.