From e6f49825e5fdfd798ca2f2622f12342dfd15dbf8 Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Tue, 16 Jun 2020 15:19:51 +0100 Subject: [PATCH 1/8] Create a separate page for Create service journey for local org users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This page has a special hint text that will help local org users name their services well. Add new hint text – old hint text left intact --- app/templates/views/add-service-local.html | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 app/templates/views/add-service-local.html diff --git a/app/templates/views/add-service-local.html b/app/templates/views/add-service-local.html new file mode 100644 index 000000000..7db2fd733 --- /dev/null +++ b/app/templates/views/add-service-local.html @@ -0,0 +1,38 @@ +{% extends "withoutnav_template.html" %} +{% from "components/radios.html" import radios %} +{% from "components/textbox.html" import textbox %} +{% from "components/page-header.html" import page_header %} +{% from "components/page-footer.html" import page_footer %} +{% from "components/form.html" import form_wrapper %} + +{% block per_page_title %} + About your service +{% endblock %} + +{% block maincolumn_content %} + +
+
+ + {{ page_header('About your service') }} + +

Give your service a name that tells users what your messages are about, as well as who they’re from. For example:

+
    +
  • School admissions - {{ current_user.default_organisation.name }}
  • +
  • Electoral services - {{ current_user.default_organisation.name }}
  • +
  • Blue Badge - {{ current_user.default_organisation.name }}
  • +
+

You should only use an acronym if your users are already familiar with it.

+ + {% call form_wrapper() %} + + {{ textbox(form.name, hint="You can change this later") }} + + {{ page_footer('Add service') }} + + {% endcall %} + +
+
+ +{% endblock %} From e15c6705855e6a0aae9301b92a03404d6d062084 Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Tue, 16 Jun 2020 15:29:52 +0100 Subject: [PATCH 2/8] Create a separate page for service name changing for local services MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This new page has a special hint text that will help local authorities name their services well. Add new hint text – old hint text left intact for now --- .../views/service-settings/name-local.html | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 app/templates/views/service-settings/name-local.html diff --git a/app/templates/views/service-settings/name-local.html b/app/templates/views/service-settings/name-local.html new file mode 100644 index 000000000..49304786b --- /dev/null +++ b/app/templates/views/service-settings/name-local.html @@ -0,0 +1,44 @@ + +{% extends "withnav_template.html" %} +{% from "components/textbox.html" import textbox %} +{% from "components/page-header.html" import page_header %} +{% from "components/page-footer.html" import page_footer %} +{% from "components/form.html" import form_wrapper %} + +{% block service_page_title %} + Change your service name +{% endblock %} + +{% block maincolumn_content %} + + {{ page_header( + 'Change your service name', + back_link=url_for('main.service_settings', service_id=current_service.id) + ) }} + +

Your service name should tell users what the message is about as well as who it’s from. For example:

+ +

You should only use an acronym if your users are already familiar with it.

+ +
+ {% if current_service.prefix_sms %} +

Users will see your service name:

+
    +
  • at the start of every text message
  • +
  • as your email sender name
  • +
+ {% else %} +

Users will see your service name as your email sender name.

+ {% endif %} +
+ + {% call form_wrapper() %} + {{ textbox(form.name) }} + {{ page_footer('Save') }} + {% endcall %} + +{% endblock %} From 18435d34555dee059accb090f938aee1b4a2a033 Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Tue, 30 Jun 2020 12:12:05 +0100 Subject: [PATCH 3/8] Update bullets to use default user organisation --- app/templates/views/service-settings/name-local.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/templates/views/service-settings/name-local.html b/app/templates/views/service-settings/name-local.html index 49304786b..782183810 100644 --- a/app/templates/views/service-settings/name-local.html +++ b/app/templates/views/service-settings/name-local.html @@ -18,10 +18,11 @@

Your service name should tell users what the message is about as well as who it’s from. For example:

    -
  • School admissions - Brighton & Hove City Council
  • -
  • Electoral services - London Borough of Bromley
  • -
  • Blue Badge - Redcar & Cleveland Borough Council
  • +
  • School admissions - {{ current_user.default_organisation.name }}
  • +
  • Electoral services - {{ current_user.default_organisation.name }}
  • +
  • Blue Badge - {{ current_user.default_organisation.name }}
+

You should only use an acronym if your users are already familiar with it.

From a381c6d37dab492e4d4c48b08469d0826136d9a8 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Wed, 1 Jul 2020 11:18:20 +0100 Subject: [PATCH 4/8] Add test for local auth' version of add-service --- tests/app/main/views/test_add_service.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/app/main/views/test_add_service.py b/tests/app/main/views/test_add_service.py index 96147d4db..277e493f7 100644 --- a/tests/app/main/views/test_add_service.py +++ b/tests/app/main/views/test_add_service.py @@ -76,6 +76,22 @@ def test_get_should_not_render_radios_if_org_type_known( assert not page.select('.multiple-choice') +def test_show_different_page_if_user_org_type_is_local( + client_request, + mocker, +): + mocker.patch( + 'app.organisations_client.get_organisation_by_domain', + return_value=organisation_json(organisation_type='local'), + ) + page = client_request.get('main.add_service') + assert page.select_one('h1').text.strip() == 'About your service' + assert page.select_one('input[name=name]')['value'] == '' + assert page.select_one('main .govuk-body').text.strip() == ( + 'Give your service a name that tells users what your' + 'messages are about, as well as who they’re from. For example:') + + @pytest.mark.parametrize('email_address', ( # User’s email address doesn’t matter when the organisation is known 'test@example.gov.uk', From d0dd6218f734a68c1accf99e12d99628e3bfa8c3 Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Wed, 1 Jul 2020 11:49:11 +0100 Subject: [PATCH 5/8] Show different page for local org users when adding new service --- app/main/views/add_service.py | 7 +++++++ tests/app/main/views/test_add_service.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/main/views/add_service.py b/app/main/views/add_service.py index b1b726189..3b9f563e2 100644 --- a/app/main/views/add_service.py +++ b/app/main/views/add_service.py @@ -80,6 +80,13 @@ def add_service(): template_id=example_sms_template['data']['id'] )) else: + if default_organisation_type == 'local': + return render_template( + 'views/add-service-local.html', + form=form, + heading=heading, + default_organisation_type=default_organisation_type, + ) return render_template( 'views/add-service.html', form=form, diff --git a/tests/app/main/views/test_add_service.py b/tests/app/main/views/test_add_service.py index 277e493f7..789f7474e 100644 --- a/tests/app/main/views/test_add_service.py +++ b/tests/app/main/views/test_add_service.py @@ -88,7 +88,7 @@ def test_show_different_page_if_user_org_type_is_local( assert page.select_one('h1').text.strip() == 'About your service' assert page.select_one('input[name=name]')['value'] == '' assert page.select_one('main .govuk-body').text.strip() == ( - 'Give your service a name that tells users what your' + 'Give your service a name that tells users what your ' 'messages are about, as well as who they’re from. For example:') From b3bc3a6447b1cfcc2bb41af0fbd6b14ba113a6da Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Wed, 1 Jul 2020 12:16:32 +0100 Subject: [PATCH 6/8] Write test for separate page for service name change for local orgs Also make a bullet list gov uk style --- app/main/views/add_service.py | 1 + app/templates/views/add-service-local.html | 4 ++-- tests/app/main/views/test_service_settings.py | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/main/views/add_service.py b/app/main/views/add_service.py index 3b9f563e2..e5442e7d9 100644 --- a/app/main/views/add_service.py +++ b/app/main/views/add_service.py @@ -87,6 +87,7 @@ def add_service(): heading=heading, default_organisation_type=default_organisation_type, ) + return render_template( 'views/add-service.html', form=form, diff --git a/app/templates/views/add-service-local.html b/app/templates/views/add-service-local.html index 7db2fd733..1ce590ec6 100644 --- a/app/templates/views/add-service-local.html +++ b/app/templates/views/add-service-local.html @@ -17,13 +17,13 @@ {{ page_header('About your service') }}

Give your service a name that tells users what your messages are about, as well as who they’re from. For example:

-
    +
    • School admissions - {{ current_user.default_organisation.name }}
    • Electoral services - {{ current_user.default_organisation.name }}
    • Blue Badge - {{ current_user.default_organisation.name }}

    You should only use an acronym if your users are already familiar with it.

    - + {% call form_wrapper() %} {{ textbox(form.name, hint="You can change this later") }} diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 028ef989f..3e96b60ab 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -383,6 +383,26 @@ def test_should_show_service_name( app.service_api_client.get_service.assert_called_with(SERVICE_ONE_ID) +def test_should_show_different_change_service_name_page_for_local_services( + client_request, + service_one, + mocker, +): + mocker.patch( + 'app.organisations_client.get_organisation_by_domain', + return_value=organisation_json(organisation_type='local'), + ) + service_one['organisation_type'] = 'local' + page = client_request.get('main.service_name_change', service_id=SERVICE_ONE_ID) + assert page.find('h1').text == 'Change your service name' + assert page.find('input', attrs={"type": "text"})['value'] == 'service one' + assert page.select_one('main .govuk-body').text.strip() == ( + 'Your service name should tell users what the message is about as well as who it’s from. For example:' + ) + + app.service_api_client.get_service.assert_called_with(SERVICE_ONE_ID) + + def test_should_show_service_name_with_no_prefixing( client_request, service_one, From 4eea8bfe5793915741c9e4eb591c4bdf633daf5c Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Wed, 1 Jul 2020 14:24:27 +0100 Subject: [PATCH 7/8] Add variant page for service-settings/name Includes correction of class used for bulleted list. --- app/main/views/service_settings.py | 6 ++++++ app/templates/views/service-settings/name-local.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index ef8a78117..9aa2257e8 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -104,6 +104,12 @@ def service_name_change(service_id): session['service_name_change'] = form.name.data return redirect(url_for('.service_name_change_confirm', service_id=service_id)) + if current_service.organisation_type == 'local': + return render_template( + 'views/service-settings/name-local.html', + form=form, + ) + return render_template( 'views/service-settings/name.html', form=form, diff --git a/app/templates/views/service-settings/name-local.html b/app/templates/views/service-settings/name-local.html index 782183810..58cece252 100644 --- a/app/templates/views/service-settings/name-local.html +++ b/app/templates/views/service-settings/name-local.html @@ -17,7 +17,7 @@ ) }}

    Your service name should tell users what the message is about as well as who it’s from. For example:

    -
      +
      • School admissions - {{ current_user.default_organisation.name }}
      • Electoral services - {{ current_user.default_organisation.name }}
      • Blue Badge - {{ current_user.default_organisation.name }}
      • @@ -28,7 +28,7 @@
        {% if current_service.prefix_sms %}

        Users will see your service name:

        -
          +
          • at the start of every text message
          • as your email sender name
          From 1b2727197aec9a75d98c9ecd36547c0f35bddd02 Mon Sep 17 00:00:00 2001 From: "Pea M. Tyczynska" Date: Wed, 1 Jul 2020 15:30:57 +0100 Subject: [PATCH 8/8] Use en dashes for better formatting Co-authored-by: Chris Hill-Scott --- app/templates/views/add-service-local.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/views/add-service-local.html b/app/templates/views/add-service-local.html index 1ce590ec6..427f33e36 100644 --- a/app/templates/views/add-service-local.html +++ b/app/templates/views/add-service-local.html @@ -18,9 +18,9 @@

          Give your service a name that tells users what your messages are about, as well as who they’re from. For example:

            -
          • School admissions - {{ current_user.default_organisation.name }}
          • -
          • Electoral services - {{ current_user.default_organisation.name }}
          • -
          • Blue Badge - {{ current_user.default_organisation.name }}
          • +
          • School admissions – {{ current_user.default_organisation.name }}
          • +
          • Electoral services – {{ current_user.default_organisation.name }}
          • +
          • Blue Badge – {{ current_user.default_organisation.name }}

          You should only use an acronym if your users are already familiar with it.