diff --git a/app/assets/images/tour-next.png b/app/assets/images/tour-next.png deleted file mode 100644 index 1cdfc8218..000000000 Binary files a/app/assets/images/tour-next.png and /dev/null differ diff --git a/app/assets/images/tour/2.png b/app/assets/images/tour/2.png deleted file mode 100644 index 4c4a82dbe..000000000 Binary files a/app/assets/images/tour/2.png and /dev/null differ diff --git a/app/assets/images/tour/2.svg b/app/assets/images/tour/2.svg deleted file mode 100644 index 05987a49d..000000000 --- a/app/assets/images/tour/2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/assets/images/tour/3.png b/app/assets/images/tour/3.png deleted file mode 100644 index 74d8342cb..000000000 Binary files a/app/assets/images/tour/3.png and /dev/null differ diff --git a/app/assets/images/tour/3.svg b/app/assets/images/tour/3.svg deleted file mode 100644 index 52d0f0146..000000000 --- a/app/assets/images/tour/3.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/assets/images/tour/4.png b/app/assets/images/tour/4.png deleted file mode 100644 index 07d917187..000000000 Binary files a/app/assets/images/tour/4.png and /dev/null differ diff --git a/app/assets/images/tour/4.svg b/app/assets/images/tour/4.svg deleted file mode 100644 index ba12e62a2..000000000 --- a/app/assets/images/tour/4.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/assets/stylesheets/_grids.scss b/app/assets/stylesheets/_grids.scss index 4b390feab..5231b67ae 100644 --- a/app/assets/stylesheets/_grids.scss +++ b/app/assets/stylesheets/_grids.scss @@ -10,6 +10,10 @@ @include grid-column(1/6); } +.column-five-sixths { + @include grid-column(5/6); +} + .column-one-eighth { @include grid-column(1/8); } diff --git a/app/assets/stylesheets/components/banner.scss b/app/assets/stylesheets/components/banner.scss index b618cd80c..583026dba 100644 --- a/app/assets/stylesheets/components/banner.scss +++ b/app/assets/stylesheets/components/banner.scss @@ -84,7 +84,7 @@ } &-action { - + display: block; text-align: right; float: right; @@ -115,14 +115,19 @@ background: $govuk-blue; color: $white; margin-top: $gutter; - padding: $gutter * 2; + margin-bottom: $gutter * -3; + padding: $gutter; + height: 475px; + overflow: hidden; + box-shadow: inset 0 -1em 1.6em 0 rgba(0, 0, 0, 0.05); - .heading-large { - margin: 0 0 $gutter 0; + .heading-medium { + @include core-24; } p { - + + margin-top: 0; margin-bottom: $gutter; &:last-child { @@ -137,13 +142,10 @@ a { - @include bold-24; - display: inline-block; - background-image: file-url('tour-next.png'); - background-size: auto 24px; - padding: 0 23px 0 0; - background-position: right 3px; - background-repeat: no-repeat; + @include bold-19; + display: block; + padding: 0 ; + margin: 0 0 $gutter 0; &:link, &:visited { @@ -164,14 +166,17 @@ } - img, - source { - max-width: 100%; - display: block; + th { + padding: inherit 5px; + background: $grey-3; + border-left: 5px solid $grey-3; + border-right: 5px solid $grey-3; } - &-image-flush-bottom { - margin: 40px 0 -60px 0; + tr:last-child { + td { + border: none; + } } } diff --git a/app/assets/stylesheets/components/file-upload.scss b/app/assets/stylesheets/components/file-upload.scss index dc33ad3f9..c4d5b89c8 100644 --- a/app/assets/stylesheets/components/file-upload.scss +++ b/app/assets/stylesheets/components/file-upload.scss @@ -53,6 +53,11 @@ &-alternate-link { display: inline-block; line-height: 35px; + + a { + @include bold-19; + } + } } diff --git a/app/assets/stylesheets/components/sms-message.scss b/app/assets/stylesheets/components/sms-message.scss index 52dd44082..1ce242b2f 100644 --- a/app/assets/stylesheets/components/sms-message.scss +++ b/app/assets/stylesheets/components/sms-message.scss @@ -14,6 +14,7 @@ p { margin: 0; + line-height: 1.6; } p + p { diff --git a/app/assets/stylesheets/components/textbox.scss b/app/assets/stylesheets/components/textbox.scss index ed0964103..2aad83604 100644 --- a/app/assets/stylesheets/components/textbox.scss +++ b/app/assets/stylesheets/components/textbox.scss @@ -16,13 +16,14 @@ &-background, &-foreground, &-mask { - @include core-19; + font-size: 19px; display: block; box-sizing: border-box; position: relative; margin: 0; padding: 4px; overflow: hidden; + line-height: 1.6; } &-background, diff --git a/app/main/__init__.py b/app/main/__init__.py index eb14dda69..b32a6411f 100644 --- a/app/main/__init__.py +++ b/app/main/__init__.py @@ -25,7 +25,6 @@ from app.main.views import ( manage_users, invites, all_services, - tour, feedback, providers, platform_admin diff --git a/app/main/views/add_service.py b/app/main/views/add_service.py index 44ede2ec0..71e9eee58 100644 --- a/app/main/views/add_service.py +++ b/app/main/views/add_service.py @@ -44,11 +44,29 @@ def add_service(): email_from=email_from) session['service_id'] = service_id - services = service_api_client.get_services({'user_id': session['user_id']}).get('data', []) - if (len(services) > 1): + if (len(service_api_client.get_services({'user_id': session['user_id']}).get('data', [])) > 1): return redirect(url_for('main.service_dashboard', service_id=service_id)) - else: - return redirect(url_for('main.tour', page=1)) + + example_sms_template = service_api_client.create_service_template( + 'Example text message template', + 'sms', + 'Hey ((name)), I’m trying out Notify. Today is ((day of week)) and my favourite colour is ((colour)).', + service_id + ) + example_email_template = service_api_client.create_service_template( + 'Example email template', + 'email', + 'Hey ((name)),\n\nI’m trying out Notify. Today is ((day of week)) and my favourite colour is ((colour)).', + service_id, + 'Trying out Notify' + ) + + return redirect(url_for( + 'main.send_test', + service_id=service_id, + template_id=example_sms_template['data']['id'], + help=1 + )) else: return render_template( 'views/add-service.html', diff --git a/app/main/views/dashboard.py b/app/main/views/dashboard.py index c04952809..685d5d400 100644 --- a/app/main/views/dashboard.py +++ b/app/main/views/dashboard.py @@ -45,7 +45,6 @@ def service_dashboard(service_id): if session.get('invited_user'): session.pop('invited_user', None) session['service_id'] = service_id - return redirect(url_for("main.tour", page=1)) return render_template( 'views/dashboard/dashboard.html', diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index 90f7623c7..7ac4cbe2e 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -97,6 +97,10 @@ def view_job(service_id, job_id): uploaded_at=job['created_at'], finished_at=job['updated_at'] if finished else None, uploaded_file_name=job['original_file_name'], + first_email_template=[ + template for template in service_api_client.get_service_templates(service_id)['data'] + if template['template_type'] == 'email' + ][0] if request.args.get('help') else None, template=Template( template, prefix=current_service['name'] diff --git a/app/main/views/send.py b/app/main/views/send.py index 0a95f8854..0bf0f9270 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -180,7 +180,8 @@ def send_test(service_id, template_id): upload_id=upload_id, service_id=service_id, template_type=template.template_type, - from_test=True + from_test=True, + help=2 if request.args.get('help') else 0 )) return render_template( @@ -246,7 +247,9 @@ def check_messages(service_id, template_type, upload_id): ) if request.args.get('from_test') and len(template.placeholders): - back_link = url_for('.send_test', service_id=service_id, template_id=template.id) + back_link = url_for( + '.send_test', service_id=service_id, template_id=template.id, help=1 if request.args.get('help') else 0 + ) else: back_link = url_for('.send_messages', service_id=service_id, template_id=template.id) @@ -312,5 +315,5 @@ def start_job(service_id, upload_id): ) return redirect( - url_for('main.view_job', job_id=upload_id, service_id=service_id) + url_for('main.view_job', job_id=upload_id, service_id=service_id, help=request.form.get('help')) ) diff --git a/app/main/views/tour.py b/app/main/views/tour.py deleted file mode 100644 index dab5c9666..000000000 --- a/app/main/views/tour.py +++ /dev/null @@ -1,21 +0,0 @@ -from flask import render_template - -from app.main import main - - -headings = [ - 'Trial mode', - 'Start with templates', - 'Add recipients', - 'Send your messages', -] - - -@main.route("/tour/") -def tour(page): - return render_template( - 'views/tour/{}.html'.format(page), - current_page=page, - next_page=(page + 1), - heading=headings[page - 1] - ) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index c11dd9d72..2789e3302 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -90,7 +90,6 @@

Help

+{% endif %} diff --git a/app/templates/partials/jobs/notifications.html b/app/templates/partials/jobs/notifications.html index ee0b4dc75..4c0159efa 100644 --- a/app/templates/partials/jobs/notifications.html +++ b/app/templates/partials/jobs/notifications.html @@ -17,14 +17,10 @@ caption_visible=False, empty_message="No messages to show yet", field_headings=[ - '1', 'Recipient', right_aligned_field_heading('Status') ] ) %} - {% call field() %} - {{ item.job_row_number + 2 }} - {% endcall %} {% call field() %} {{ item.to }} {% endcall %} diff --git a/app/templates/partials/jobs/status.html b/app/templates/partials/jobs/status.html index 38d880dff..1890b6449 100644 --- a/app/templates/partials/jobs/status.html +++ b/app/templates/partials/jobs/status.html @@ -6,15 +6,7 @@ aria-live="polite" {% endif %} > - - {% if finished_at %} -

- Finished {{ finished_at|format_datetime }} -

- {% else %} -

- Started {{ uploaded_at|format_datetime }} -

- {% endif %} - Uploaded by {{ created_by }} +

+ Sent by {{ created_by }} on {{ uploaded_at|format_datetime_short }} +

diff --git a/app/templates/views/check.html b/app/templates/views/check.html index 021fe348e..dd71f4cf6 100644 --- a/app/templates/views/check.html +++ b/app/templates/views/check.html @@ -122,6 +122,7 @@ {% else %} diff --git a/app/templates/views/edit-email-template.html b/app/templates/views/edit-email-template.html index 71f286db1..ab0492963 100644 --- a/app/templates/views/edit-email-template.html +++ b/app/templates/views/edit-email-template.html @@ -27,9 +27,9 @@ ) }}
-
diff --git a/app/templates/views/edit-sms-template.html b/app/templates/views/edit-sms-template.html index f7a39744a..ee4778fa9 100644 --- a/app/templates/views/edit-sms-template.html +++ b/app/templates/views/edit-sms-template.html @@ -26,9 +26,9 @@ ) }}
-
diff --git a/app/templates/views/send-test.html b/app/templates/views/send-test.html index c6b28b1d7..0731ae2c4 100644 --- a/app/templates/views/send-test.html +++ b/app/templates/views/send-test.html @@ -11,8 +11,11 @@ {% block maincolumn_content %} - -

Send a test

+ {% if request.args['help'] %} +

Example text message

+ {% else %} +

Send a test

+ {% endif %} {% if 'sms' == template.template_type %}
@@ -36,7 +39,7 @@
{% call(item, row_number) list_table( example, - caption="Fill in your {}".format('field' if template.placeholders|length == 1 else 'fields'), + caption="Fill in the {}".format('field' if template.placeholders|length == 1 else 'fields'), field_headings=[ '{}'.format(recipient_column)|safe ] + template.placeholders_as_markup|list @@ -53,7 +56,9 @@ {% endfor %} {% endcall %} - {{ page_footer("Check and confirm", back_link=url_for('.send_messages', service_id=current_service.id, template_id=template.id)) }} + {{ page_footer("Check and confirm", back_link=( + url_for('.send_messages', service_id=current_service.id, template_id=template.id)) if not request.args['help'] else None + ) }}
{% endblock %} diff --git a/app/templates/views/tour/1.html b/app/templates/views/tour/1.html deleted file mode 100644 index 1474c8825..000000000 --- a/app/templates/views/tour/1.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "withoutnav_template.html" %} -{% from "components/textbox.html" import textbox %} -{% from "components/page-footer.html" import page_footer %} -{% from "components/banner.html" import banner_wrapper %} - -{% block page_title %} - {{heading}} – GOV.UK Notify -{% endblock %} - -{% block maincolumn_content %} - - {% call banner_wrapper(type='tour') %} -

{{ heading }}

-

- To start off with, you can only send messages to yourself. -

-

- We can remove these restrictions when you’re ready. -

- - Next - - {% endcall %} - -{% endblock %} diff --git a/app/templates/views/tour/2.html b/app/templates/views/tour/2.html deleted file mode 100644 index fd321e927..000000000 --- a/app/templates/views/tour/2.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends "withoutnav_template.html" %} -{% from "components/textbox.html" import textbox %} -{% from "components/page-footer.html" import page_footer %} -{% from "components/banner.html" import banner_wrapper %} - -{% block page_title %} - {{heading}} – GOV.UK Notify -{% endblock %} - -{% block maincolumn_content %} - - {% call banner_wrapper(type='tour') %} -

{{ heading }}

-

- Set up a template like this: -

-

- - - A screenshot of a spreadsheet containing data about three people - -

- - Next - - {% endcall %} - -{% endblock %} diff --git a/app/templates/views/tour/3.html b/app/templates/views/tour/3.html deleted file mode 100644 index c6138148b..000000000 --- a/app/templates/views/tour/3.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends "withoutnav_template.html" %} -{% from "components/textbox.html" import textbox %} -{% from "components/page-footer.html" import page_footer %} -{% from "components/banner.html" import banner_wrapper %} - -{% block page_title %} - {{heading}} – GOV.UK Notify -{% endblock %} - -{% block maincolumn_content %} - - {% call banner_wrapper(type='tour') %} -

{{ heading }}

-

- Add recipients by uploading a .csv spreadsheet: -

-

- - - A screenshot of a spreadsheet containing data about three people - -

-

- Developers, you can add data automatically using an API -

- - Next - - {% endcall %} - -{% endblock %} diff --git a/app/templates/views/tour/4.html b/app/templates/views/tour/4.html deleted file mode 100644 index 2b845d0fa..000000000 --- a/app/templates/views/tour/4.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "withoutnav_template.html" %} -{% from "components/textbox.html" import textbox %} -{% from "components/page-footer.html" import page_footer %} -{% from "components/banner.html" import banner_wrapper %} - -{% block page_title %} - {{ heading }} – GOV.UK Notify -{% endblock %} - -{% block maincolumn_content %} - - {% call banner_wrapper(type='tour') %} -

{{ heading }}

-

- Notify merges your data with the template and sends the messages -

- - Next - - - {% endcall %} - -{% endblock %} diff --git a/tests/app/main/views/test_add_service.py b/tests/app/main/views/test_add_service.py index 122fcd8d7..fa0993127 100644 --- a/tests/app/main/views/test_add_service.py +++ b/tests/app/main/views/test_add_service.py @@ -1,5 +1,5 @@ from flask import url_for, session - +from unittest.mock import ANY import app @@ -17,6 +17,7 @@ def test_get_should_render_add_service_template(app_, def test_should_add_service_and_redirect_to_tour_when_no_services(app_, mocker, mock_create_service, + mock_create_service_template, mock_get_services_with_no_services, api_user_active): with app_.test_request_context(): @@ -34,14 +35,22 @@ def test_should_add_service_and_redirect_to_tour_when_no_services(app_, user_id=api_user_active.id, email_from='testing.the.post' ) + assert len(mock_create_service_template.call_args_list) == 2 assert session['service_id'] == 101 assert response.status_code == 302 - assert response.location == url_for('main.tour', page=1, _external=True) + assert response.location == url_for( + 'main.send_test', + service_id=101, + template_id="Example text message template", + help=1, + _external=True + ) def test_should_add_service_and_redirect_to_dashboard_when_existing_service(app_, mocker, mock_create_service, + mock_create_service_template, mock_get_services, api_user_active): with app_.test_request_context(): @@ -59,6 +68,7 @@ def test_should_add_service_and_redirect_to_dashboard_when_existing_service(app_ user_id=api_user_active.id, email_from='testing.the.post' ) + assert len(mock_create_service_template.call_args_list) == 0 assert session['service_id'] == 101 assert response.status_code == 302 assert response.location == url_for('main.service_dashboard', service_id=101, _external=True) diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index 5d0df8d48..3326d0f92 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -70,7 +70,7 @@ def test_should_show_updates_for_one_job_as_json( assert 'queued' in content['counts'] assert 'Recipient' in content['notifications'] assert 'Status' in content['notifications'] - assert 'Started' in content['status'] + assert 'Sent by Test User' in content['status'] assert job_json['status'] in content['status'] diff --git a/tests/app/main/views/test_tour.py b/tests/app/main/views/test_tour.py deleted file mode 100644 index 5ab155bbc..000000000 --- a/tests/app/main/views/test_tour.py +++ /dev/null @@ -1,17 +0,0 @@ -import pytest -from flask import url_for - - -@pytest.mark.parametrize("page", range(1, 5)) -def test_should_render_tour_pages( - app_, - api_user_active, - mocker, - mock_get_service, - page -): - with app_.test_request_context(): - with app_.test_client() as client: - response = client.get(url_for('main.tour', page=page)) - assert response.status_code == 200 - assert 'Next' in response.get_data(as_text=True)