mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-23 09:29:14 -04:00
Merge pull request #1006 from alphagov/request-to-go-live-improvements
Make certain questions on request to go live radio buttons
This commit is contained in:
@@ -384,26 +384,47 @@ class Feedback(Form):
|
||||
|
||||
|
||||
class RequestToGoLiveForm(Form):
|
||||
channel = StringField(
|
||||
'Are you sending emails or text messages or both?',
|
||||
validators=[DataRequired(message='Can’t be empty')]
|
||||
mou = RadioField(
|
||||
(
|
||||
'Has your organisation accepted the GOV.UK Notify data sharing and financial '
|
||||
'agreement (Memorandum of Understanding)?'
|
||||
),
|
||||
choices=[
|
||||
('yes', 'Yes'),
|
||||
('no', 'No – we’ll send you a copy'),
|
||||
('don’t know', 'I don’t know – we’ll check for you')
|
||||
],
|
||||
validators=[DataRequired()]
|
||||
)
|
||||
channel = RadioField(
|
||||
'What kind of messages will you be sending?',
|
||||
choices=[
|
||||
('emails', 'Emails'),
|
||||
('text messages', 'Text messages'),
|
||||
('emails and text messages', 'Both')
|
||||
],
|
||||
validators=[DataRequired()]
|
||||
)
|
||||
start_date = StringField(
|
||||
'When will you be ready to start sending messages?',
|
||||
validators=[DataRequired(message='Can’t be empty')]
|
||||
)
|
||||
start_volume = StringField(
|
||||
'How many messages do you expect to send per month to start with? Give an estimate in numbers.',
|
||||
'How many messages do you expect to send to start with?',
|
||||
validators=[DataRequired(message='Can’t be empty')]
|
||||
)
|
||||
peak_volume = StringField(
|
||||
'Will the number of messages a month increase and when will that start? Give an estimate.',
|
||||
'Will the number of messages increase and when will that start?',
|
||||
validators=[DataRequired(message='Can’t be empty')]
|
||||
)
|
||||
upload_or_api = StringField(
|
||||
'Are you uploading a list of contacts that you’re sending your message to, ' +
|
||||
'or are you integrating your system with ours?',
|
||||
validators=[DataRequired(message='Can’t be empty')]
|
||||
upload_or_api = RadioField(
|
||||
'How are you going to send messages?',
|
||||
choices=[
|
||||
('File upload', 'Upload a spreadsheet of recipients'),
|
||||
('API', 'Integrate with the GOV.UK Notify API'),
|
||||
('API and file upload', 'Both')
|
||||
],
|
||||
validators=[DataRequired()]
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -112,11 +112,13 @@ def service_request_to_go_live(service_id):
|
||||
'subject': 'Request to go live',
|
||||
'message': (
|
||||
'On behalf of {} ({})\n\nExpected usage\n---'
|
||||
'\nMOU in place: {}'
|
||||
'\nChannel: {}\nStart date: {}\nStart volume: {}'
|
||||
'\nPeak volume: {}\nUpload or API: {}'
|
||||
).format(
|
||||
current_service['name'],
|
||||
url_for('main.service_dashboard', service_id=current_service['id'], _external=True),
|
||||
form.mou.data,
|
||||
form.channel.data,
|
||||
form.start_date.data,
|
||||
form.start_volume.data,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% 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 %}
|
||||
|
||||
@@ -11,19 +12,10 @@
|
||||
|
||||
<h1 class="heading-large">Request to go live</h1>
|
||||
|
||||
{% call banner_wrapper(type='warning') %}
|
||||
<h2 class="heading-medium">You must accept the GOV.UK Notify data sharing and financial agreement (Memorandum of Understanding) before we can process data for you.</h2>
|
||||
|
||||
<p>
|
||||
<a href="{{ url_for('main.feedback') }}">Contact the Notify team</a> to get a copy of the agreement or to find out if your organisation has already accepted it.
|
||||
</p>
|
||||
{% endcall %}
|
||||
|
||||
<p>
|
||||
Before you request to go live, make sure you’ve:
|
||||
</p>
|
||||
<ul class="list list-bullet">
|
||||
<li>accepted our data sharing and financial agreement</li>
|
||||
<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>
|
||||
@@ -39,17 +31,23 @@
|
||||
</ul>
|
||||
|
||||
<form method="post">
|
||||
{{ textbox(form.channel, width='1-1') }}
|
||||
{{ textbox(form.start_date, width='1-1') }}
|
||||
{{ textbox(form.start_volume, width='1-1') }}
|
||||
{{ textbox(form.peak_volume, width='1-1') }}
|
||||
{{ textbox(form.upload_or_api, width='1-1') }}
|
||||
<div class="form-group">
|
||||
<p>We need permission to process your data before we can make your service live.</p>
|
||||
{{ radios(form.mou) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ radios(form.channel) }}
|
||||
{{ textbox(form.start_date, width='1-1') }}
|
||||
{{ textbox(form.start_volume, width='1-1', hint='For example, ‘1000 a month’.') }}
|
||||
{{ textbox(form.peak_volume, width='1-1', hint='For example, ‘Messages will increase to 20,000 a month in January’.') }}
|
||||
{{ radios(form.upload_or_api) }}
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Once you’ve completed the tasks needed to set up, we’ll make your service live. We’ll do this within one working day.
|
||||
</p>
|
||||
<p>
|
||||
By requesting to go live you are agreeing to our terms of use.
|
||||
By requesting to go live you’re agreeing to our <a href="{{ url_for('.terms') }}">terms of use</a>.
|
||||
</p>
|
||||
|
||||
{{ page_footer('Request to go live') }}
|
||||
|
||||
@@ -315,11 +315,12 @@ def test_should_redirect_after_request_to_go_live(
|
||||
response = client.post(
|
||||
url_for('main.service_request_to_go_live', service_id='6ce466d0-fd6a-11e5-82f5-e0accb9d11a6'),
|
||||
data={
|
||||
'channel': 'Email',
|
||||
'mou': 'yes',
|
||||
'channel': 'emails',
|
||||
'start_date': '01/01/2017',
|
||||
'start_volume': '100,000',
|
||||
'peak_volume': '2,000,000',
|
||||
'upload_or_api': 'api'
|
||||
'upload_or_api': 'API'
|
||||
},
|
||||
follow_redirects=True
|
||||
)
|
||||
@@ -338,11 +339,11 @@ def test_should_redirect_after_request_to_go_live(
|
||||
)
|
||||
|
||||
returned_message = mock_post.call_args[1]['data']['message']
|
||||
assert 'Email' in returned_message
|
||||
assert 'emails' in returned_message
|
||||
assert '01/01/2017' in returned_message
|
||||
assert '100,000' in returned_message
|
||||
assert '2,000,000' in returned_message
|
||||
assert 'api' in returned_message
|
||||
assert 'API' in returned_message
|
||||
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
flash_banner = page.find('div', class_='banner-default').string.strip()
|
||||
@@ -377,11 +378,12 @@ def test_log_error_on_request_to_go_live(
|
||||
resp = client.post(
|
||||
url_for('main.service_request_to_go_live', service_id='6ce466d0-fd6a-11e5-82f5-e0accb9d11a6'),
|
||||
data={
|
||||
'channel': 'channel',
|
||||
'mou': 'yes',
|
||||
'channel': 'emails',
|
||||
'start_date': 'start_date',
|
||||
'start_volume': 'start_volume',
|
||||
'peak_volume': 'peak_volume',
|
||||
'upload_or_api': 'upload_or_api'
|
||||
'upload_or_api': 'API'
|
||||
}
|
||||
)
|
||||
mock_logger.assert_called_with(
|
||||
|
||||
Reference in New Issue
Block a user