Split into two pages

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.
This commit is contained in:
Chris Hill-Scott
2018-02-20 12:15:35 +00:00
parent 4e2b4b5ac7
commit 7dc278c959
4 changed files with 100 additions and 52 deletions

View File

@@ -158,10 +158,17 @@ def service_name_change_confirm(service_id):
form=form)
@main.route("/services/<service_id>/service-settings/request-to-go-live", methods=['GET', 'POST'])
@main.route("/services/<service_id>/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_id>/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('Weve 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_id>/service-settings/switch-live")

View File

@@ -11,54 +11,29 @@
{% block maincolumn_content %}
<h1 class="heading-large">Request to go live</h1>
<p>
Before you request to go live, make sure youve:
</p>
<ul class="list list-bullet bottom-gutter">
<li>read our <a href="{{ url_for('.terms') }}">terms of use</a></li>
<li>added <a href="{{ url_for('main.manage_users', service_id=current_service.id) }}">team members</a> to your account</li>
<li>
specified your reply to email address or text message sender in your
<a href="{{ url_for('main.service_settings', service_id=current_service.id) }}">settings</a> page</li>
<li>
added the templates you want to start with, making sure they follow the GOV.UK Service Manual standards for
<a href="https://www.gov.uk/service-manual/design/sending-emails-and-text-messages">writing text messages and emails</a></li>
</ul>
<form method="post">
<div class="form-group">
<p>We need permission to process your data before we can make your service live.</p>
{{ radios(form.mou, option_hints={
'no': 'Well send you a copy',
'dont know': 'Well check for you',
}) }}
</div>
{{ checkbox_group('What kind of messages will you be sending?', [
form.channel_email,
form.channel_sms,
form.channel_letter
]) }}
<div class="form-group">
{{ 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.') }}
</div>
{{ checkbox_group('How are you going to send messages?', [
form.method_one_off,
form.method_upload,
form.method_api
]) }}
<p>
Once youve completed the tasks needed to set up, well make your service live. Well do this within one working day.
</p>
<p>
By requesting to go live youre agreeing to our <a href="{{ url_for('.terms') }}">terms of use</a>.
</p>
{{ page_footer('Request to go live') }}
</form>
<h1 class="heading-large">Request to go live</h1>
<p>
Before you request to go live, make sure youve:
</p>
<ul class="list list-bullet bottom-gutter">
<li>
read our <a href="{{ url_for('.terms') }}">terms of use</a>
</li>
<li>
added <a href="{{ url_for('main.manage_users', service_id=current_service.id) }}">team members</a> to your account
</li>
<li>
specified your reply to email address or text message sender in your
<a href="{{ url_for('main.service_settings', service_id=current_service.id) }}">settings</a> page
</li>
<li>
added the templates you want to start with, making sure they follow the GOV.UK Service Manual standards for
<a href="https://www.gov.uk/service-manual/design/sending-emails-and-text-messages">writing text messages and emails</a>
</li>
</ul>
<p>
<a href="{{ url_for('main.submit_request_to_go_live', service_id=current_service.id) }}" class="button">Next</a>
</p>
{% endblock %}

View File

@@ -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 %}
<h1 class="heading-large">Request to go live</h1>
<form method="post">
<div class="form-group">
<p>We need permission to process your data before we can make your service live.</p>
{{ radios(form.mou, option_hints={
'no': 'Well send you a copy',
'dont know': 'Well check for you',
}) }}
</div>
{{ checkbox_group('What kind of messages will you be sending?', [
form.channel_email,
form.channel_sms,
form.channel_letter
]) }}
<div class="form-group">
{{ 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.') }}
</div>
{{ checkbox_group('How are you going to send messages?', [
form.method_one_off,
form.method_upload,
form.method_api
]) }}
<p>
Once youve completed the tasks needed to set up, well make your service live. Well do this within one working day.
</p>
<p>
By requesting to go live youre agreeing to our <a href="{{ url_for('.terms') }}">terms of use</a>.
</p>
{{ page_footer('Request to go live') }}
</form>
{% endblock %}

View File

@@ -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,