Delete old letter branding request page

This commit is contained in:
Pea Tyczynska
2020-01-21 16:02:41 +00:00
parent cc61e87701
commit 5a32177982
7 changed files with 8 additions and 108 deletions

View File

@@ -1001,15 +1001,6 @@ def service_preview_letter_branding(service_id):
)
@main.route("/services/<uuid:service_id>/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/<uuid:service_id>/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')
)

View File

@@ -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',

View File

@@ -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)
) }}
<p>

View File

@@ -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)
) }}
<div class="grid-row">
<div class="column-three-quarters">
{% if current_service.letter_branding_id %}
<p>
Your letters have the {{ current_service.letter_branding.name }} logo.
</p>
<p>
<a href="{{ url_for('main.feedback', ticket_type='ask-question-give-feedback', body='letter-branding') }}">Contact us</a>
if you want to use a different logo.
</p>
{% else %}
<p>
Your letters do not have a logo.
</p>
<p>
<a href="{{ url_for('main.feedback', ticket_type='ask-question-give-feedback', body='letter-branding') }}">Contact us</a>
if you want to add your organisations logo.
</p>
{% endif %}
</div>
</div>
{% endblock %}

View File

@@ -51,7 +51,7 @@
<div class="column-whole template-container">
{% if current_user.has_permissions('manage_templates') and template.template_type == 'letter' %}
{% if not current_service.letter_branding_id %}
<a href="{{ url_for(".request_letter_branding", service_id=current_service.id, from_template=template.id) }}" class="edit-template-link-letter-branding">Add logo</a>
<a href="{{ url_for(".branding_request", service_id=current_service.id, branding_type="letter", from_template=template.id) }}" class="edit-template-link-letter-branding">Add logo</a>
{% endif %}
<a href="{{ url_for(".edit_template_postage", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-postage">Change</a>
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-body">Edit</a>

View File

@@ -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,
):

View File

@@ -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',
),
(