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,