diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 10fb6412a..fcc845654 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -162,7 +162,14 @@ def service_name_change_confirm(service_id): @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') + return render_template( + 'views/service-settings/request-to-go-live.html', + has_team_members=( + user_api_client.get_count_of_users_with_permission( + service_id, 'manage_settings' + ) > 1 + ), + ) @main.route("/services//service-settings/submit-request-to-go-live", methods=['GET', 'POST']) diff --git a/app/templates/components/tick-cross.html b/app/templates/components/tick-cross.html index 6467b38ca..f6fbc9ecf 100644 --- a/app/templates/components/tick-cross.html +++ b/app/templates/components/tick-cross.html @@ -1,15 +1,20 @@ -{% macro tick_cross(yes, label) %} +{% macro tick_cross(yes, label, truthy_hint='Can', falsey_hint='Can’t') %}
  • {% if yes %} - Can + {{ truthy_hint }} {{ label}} {% else %} - Can’t + {{ falsey_hint }} {{ label}} {% endif %}
  • {% endmacro %} + + +{% macro tick_cross_done_not_done(yes, label) %} + {{ tick_cross(yes, label, truthy_hint='Done: ', falsey_hint='Not done: ') }} +{% endmacro %} 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 ed8628485..65b1b6ac8 100644 --- a/app/templates/views/service-settings/request-to-go-live.html +++ b/app/templates/views/service-settings/request-to-go-live.html @@ -4,6 +4,7 @@ {% from "components/radios.html" import radios %} {% from "components/page-footer.html" import page_footer %} {% from "components/banner.html" import banner_wrapper %} +{% from "components/tick-cross.html" import tick_cross_done_not_done %} {% block service_page_title %} Request to go live @@ -14,21 +15,27 @@

    Request to go live

    - Before you request to go live, make sure you’ve: + Before you request to go live, make sure that: +

    + +

    + You also need to:

    diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index e7e945a87..ee0e80387 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -455,17 +455,30 @@ def test_should_raise_duplicate_name_handled( assert mock_verify_password.called +@pytest.mark.parametrize('count_of_users_with_manage_service, expected_checklist_item', [ + (1, 'Not done: Another person in your team has the ‘Manage service’ permission'), + (2, 'Done: Another person in your team has the ‘Manage service’ permission'), +]) def test_should_show_request_to_go_live_checklist( client_request, + mocker, + count_of_users_with_manage_service, + expected_checklist_item, ): + mock_count_users = mocker.patch( + 'app.main.views.service_settings.user_api_client.get_count_of_users_with_permission', + return_value=count_of_users_with_manage_service + ) page = client_request.get( 'main.request_to_go_live', service_id=SERVICE_ONE_ID ) assert page.h1.text == 'Request to go live' + assert normalize_spaces(page.select('main ul li')[0].text) == expected_checklist_item assert page.select_one('main .button')['href'] == url_for( 'main.submit_request_to_go_live', service_id=SERVICE_ONE_ID, ) + mock_count_users.assert_called_once_with(SERVICE_ONE_ID, 'manage_settings') def test_should_show_request_to_go_live(