mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 17:45:32 -04:00
Merge pull request #3508 from alphagov/remove-template-id-redaction-broadcasts
Hide template ID and redaction for broadcast templates
This commit is contained in:
@@ -46,9 +46,11 @@
|
|||||||
{% include 'views/templates/_template.html' %}
|
{% include 'views/templates/_template.html' %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bottom-gutter-1-2">
|
{% if template.template_type != 'broadcast' %}
|
||||||
{{ api_key(template.id, name="Template ID", thing='template ID') }}
|
<div class="bottom-gutter-1-2">
|
||||||
</div>
|
{{ api_key(template.id, name="Template ID", thing='template ID') }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="bottom-gutter-1-2">
|
<div class="bottom-gutter-1-2">
|
||||||
{% if template._template.updated_at %}
|
{% if template._template.updated_at %}
|
||||||
@@ -71,7 +73,7 @@
|
|||||||
</span>
|
</span>
|
||||||
 
|
 
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if template.template_type != 'letter' %}
|
{% if template.template_type not in ('letter', 'broadcast') %}
|
||||||
{% if not template._template.redact_personalisation %}
|
{% if not template._template.redact_personalisation %}
|
||||||
<span class="page-footer-delete-link page-footer-delete-link-without-button">
|
<span class="page-footer-delete-link page-footer-delete-link-without-button">
|
||||||
<a class="govuk-link govuk-link--destructive" href="{{ url_for('.confirm_redact_template', service_id=current_service.id, template_id=template.id) }}">Hide personalisation after sending</a>
|
<a class="govuk-link govuk-link--destructive" href="{{ url_for('.confirm_redact_template', service_id=current_service.id, template_id=template.id) }}">Hide personalisation after sending</a>
|
||||||
|
|||||||
@@ -728,6 +728,21 @@ def test_should_show_template_id_on_template_page(
|
|||||||
assert page.select('.api-key__key')[0].text == fake_uuid
|
assert page.select('.api-key__key')[0].text == fake_uuid
|
||||||
|
|
||||||
|
|
||||||
|
def test_should_hide_template_id_for_broadcast_templates(
|
||||||
|
client_request,
|
||||||
|
mock_get_broadcast_template,
|
||||||
|
mock_get_template_folders,
|
||||||
|
fake_uuid,
|
||||||
|
):
|
||||||
|
page = client_request.get(
|
||||||
|
'.view_template',
|
||||||
|
service_id=SERVICE_ONE_ID,
|
||||||
|
template_id=fake_uuid,
|
||||||
|
_test_page_title=False,
|
||||||
|
)
|
||||||
|
assert not page.select('.api-key__key')
|
||||||
|
|
||||||
|
|
||||||
def test_should_show_sms_template_with_downgraded_unicode_characters(
|
def test_should_show_sms_template_with_downgraded_unicode_characters(
|
||||||
client_request,
|
client_request,
|
||||||
mocker,
|
mocker,
|
||||||
@@ -2256,6 +2271,25 @@ def test_should_not_show_redaction_stuff_for_letters(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_should_not_show_redaction_stuff_for_broadcasts(
|
||||||
|
client_request,
|
||||||
|
fake_uuid,
|
||||||
|
mock_get_broadcast_template,
|
||||||
|
mock_get_template_folders,
|
||||||
|
):
|
||||||
|
page = client_request.get(
|
||||||
|
'main.view_template',
|
||||||
|
service_id=SERVICE_ONE_ID,
|
||||||
|
template_id=fake_uuid,
|
||||||
|
_test_page_title=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert page.select('.hint') == []
|
||||||
|
assert 'personalisation' not in ' '.join(
|
||||||
|
link.text.lower() for link in page.select('a')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_set_template_sender(
|
def test_set_template_sender(
|
||||||
client_request,
|
client_request,
|
||||||
fake_uuid,
|
fake_uuid,
|
||||||
|
|||||||
Reference in New Issue
Block a user