diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 1237aba10..c10dde797 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -1001,15 +1001,6 @@ def service_preview_letter_branding(service_id): ) -@main.route("/services//service-settings/request-letter-branding", methods=['GET', 'POST']) -@user_has_permissions('manage_service', 'manage_templates') -def request_letter_branding(service_id): - return render_template( - 'views/service-settings/request-letter-branding.html', - from_template=request.args.get('from_template'), - ) - - @main.route("/services//service-settings/link-service-to-organisation", methods=['GET', 'POST']) @user_is_platform_admin def link_service_to_organisation(service_id): @@ -1085,7 +1076,8 @@ def branding_request(service_id, branding_type): 'views/service-settings/branding/branding-options.html', form=form, branding_type=branding_type, - branding_name=branding_name + branding_name=branding_name, + from_template=request.args.get('from_template') ) diff --git a/app/navigation.py b/app/navigation.py index 354483c7d..2b544bb0f 100644 --- a/app/navigation.py +++ b/app/navigation.py @@ -237,7 +237,6 @@ class HeaderNavigation(Navigation): 'registration_continue', 'remove_user_from_organisation', 'remove_user_from_service', - 'request_letter_branding', 'request_to_go_live', 'resend_email_link', 'resend_email_verification', @@ -404,7 +403,6 @@ class MainNavigation(Navigation): 'branding_request', 'estimate_usage', 'link_service_to_organisation', - 'request_letter_branding', 'request_to_go_live', 'service_add_email_reply_to', 'service_add_letter_contact', @@ -802,7 +800,6 @@ class CaseworkNavigation(Navigation): 'registration_continue', 'remove_user_from_organisation', 'remove_user_from_service', - 'request_letter_branding', 'request_to_go_live', 'resend_email_link', 'resend_email_verification', @@ -1081,7 +1078,6 @@ class OrgNavigation(Navigation): 'register_from_org_invite', 'registration_continue', 'remove_user_from_service', - 'request_letter_branding', 'request_to_go_live', 'resend_email_link', 'resend_email_verification', diff --git a/app/templates/views/service-settings/branding/branding-options.html b/app/templates/views/service-settings/branding/branding-options.html index 2be9c49fe..d7b3cb68f 100644 --- a/app/templates/views/service-settings/branding/branding-options.html +++ b/app/templates/views/service-settings/branding/branding-options.html @@ -14,7 +14,7 @@ {{ page_header( 'Change {} branding'.format(branding_type), - back_link=url_for('main.service_settings', service_id=current_service.id) + back_link=url_for('.view_template', service_id=current_service.id, template_id=from_template) if from_template else url_for('.service_settings', service_id=current_service.id) ) }}

diff --git a/app/templates/views/service-settings/request-letter-branding.html b/app/templates/views/service-settings/request-letter-branding.html deleted file mode 100644 index 508182001..000000000 --- a/app/templates/views/service-settings/request-letter-branding.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "withnav_template.html" %} -{% from "components/radios.html" import radios %} -{% from "components/page-header.html" import page_header %} -{% from "components/page-footer.html" import page_footer %} - -{% block service_page_title %} - Letter branding -{% endblock %} - -{% block maincolumn_content %} - - {{ page_header( - 'Letter branding', - back_link=url_for('.view_template', service_id=current_service.id, template_id=from_template) if from_template else url_for('.service_settings', service_id=current_service.id) - ) }} - -

-
- {% if current_service.letter_branding_id %} -

- Your letters have the {{ current_service.letter_branding.name }} logo. -

-

- Contact us - if you want to use a different logo. -

- {% else %} -

- Your letters do not have a logo. -

-

- Contact us - if you want to add your organisation’s logo. -

- {% endif %} -
-
- -{% endblock %} diff --git a/app/templates/views/templates/_template.html b/app/templates/views/templates/_template.html index f236a5a1a..eecee2ece 100644 --- a/app/templates/views/templates/_template.html +++ b/app/templates/views/templates/_template.html @@ -51,7 +51,7 @@
{% if current_user.has_permissions('manage_templates') and template.template_type == 'letter' %} {% if not current_service.letter_branding_id %} - Add logo + Add logo {% endif %} Change Edit diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 6449ed6a3..0127e2b80 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -3024,58 +3024,6 @@ def test_set_letter_contact_block_has_max_10_lines( assert error_message == 'Contains 11 lines, maximum is 10' -@pytest.mark.parametrize('extra_args, expected_partial_url', ( - ( - {}, - partial(url_for, 'main.service_settings') - ), - ( - {'from_template': FAKE_TEMPLATE_ID}, - partial(url_for, 'main.view_template', template_id=FAKE_TEMPLATE_ID) - ), -)) -def test_request_letter_branding( - client_request, - mock_get_letter_branding_by_id, - extra_args, - expected_partial_url, -): - request_page = client_request.get( - 'main.request_letter_branding', - service_id=SERVICE_ONE_ID, - **extra_args - ) - assert request_page.select_one('main p').text.strip() == 'Your letters do not have a logo.' - back_link_href = request_page.select('main a')[0]['href'] - link_href = request_page.select('main a')[1]['href'] - assert link_href == url_for( - 'main.feedback', - ticket_type='ask-question-give-feedback', - body='letter-branding', - ) - feedback_page = client_request.get_url(link_href) - assert feedback_page.select_one('textarea').text.strip() == ( - 'I would like my own logo on my letter templates.' - ) - assert back_link_href == expected_partial_url(service_id=SERVICE_ONE_ID) - - -def test_request_letter_branding_if_already_have_branding( - client_request, - mock_get_letter_branding_by_id, - service_one, -): - service_one['letter_branding'] = uuid4() - - request_page = client_request.get( - 'main.request_letter_branding', - service_id=SERVICE_ONE_ID, - ) - - mock_get_letter_branding_by_id.assert_called_once_with(service_one['letter_branding']) - assert request_page.select_one('main p').text.strip() == 'Your letters have the HM Government logo.' - - def test_service_set_letter_branding_platform_admin_only( client_request, ): diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index fde9b8f0b..fd79523f9 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -437,7 +437,10 @@ def test_user_with_only_send_and_view_sees_letter_page( @pytest.mark.parametrize('letter_branding, expected_link, expected_link_text', ( ( None, - partial(url_for, 'main.request_letter_branding', from_template=TEMPLATE_ONE_ID), + partial( + url_for, 'main.branding_request', + service_id=SERVICE_ONE_ID, branding_type="letter", from_template=TEMPLATE_ONE_ID + ), 'Add logo', ), (