mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-01 20:29:49 -04:00
Make it clear which template you’re sending
The one downside of skipping the template page is that you no longer get such strong confirmation that you’ve picked the correct template. You still see the preview of the template, but it’s further down the page, and the name of the template has disappeared. This commit adds the name of the template to the page title, to: - have some continuity from the previous page - make it easier to double-check you’ve chosen the correct template
This commit is contained in:
@@ -451,7 +451,8 @@ def send_test_step(service_id, template_id, step_index):
|
||||
page_title=get_send_test_page_title(
|
||||
template.template_type,
|
||||
get_help_argument(),
|
||||
entering_recipient=not session['recipient']
|
||||
entering_recipient=not session['recipient'],
|
||||
name=template.name,
|
||||
),
|
||||
template=template,
|
||||
form=form,
|
||||
@@ -751,13 +752,13 @@ def all_placeholders_in_session(placeholders):
|
||||
)
|
||||
|
||||
|
||||
def get_send_test_page_title(template_type, help_argument, entering_recipient):
|
||||
def get_send_test_page_title(template_type, help_argument, entering_recipient, name=None):
|
||||
if help_argument:
|
||||
return 'Example text message'
|
||||
if template_type == 'letter':
|
||||
return 'Print a test letter'
|
||||
if entering_recipient:
|
||||
return 'Who should this message be sent to?'
|
||||
return 'Send ‘{}’'.format(name)
|
||||
return 'Personalise this message'
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
|
||||
{% block service_page_title %}
|
||||
{{ "Error" if error else "Preview of {}".format(template.name) }}
|
||||
{{ "Error" if error else "Preview of ‘{}’".format(template.name) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
<h1 class="heading-large">
|
||||
Preview of {{ template.name }}
|
||||
Preview of ‘{{ template.name }}’
|
||||
</h1>
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ def test_conversation_reply_redirects_with_phone_number_from_notification(
|
||||
)
|
||||
|
||||
for element, expected_text in [
|
||||
('h1', 'Preview of Two week reminder'),
|
||||
('h1', 'Preview of ‘Two week reminder’'),
|
||||
('.sms-message-recipient', 'To: 07123 456789'),
|
||||
('.sms-message-wrapper', 'service one: Template <em>content</em> with & entity'),
|
||||
]:
|
||||
|
||||
@@ -919,7 +919,7 @@ def test_send_test_doesnt_show_file_contents(
|
||||
|
||||
assert response.status_code == 200
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
assert page.select('h1')[0].text.strip() == 'Preview of Two week reminder'
|
||||
assert page.select('h1')[0].text.strip() == 'Preview of ‘Two week reminder’'
|
||||
assert len(page.select('table')) == 0
|
||||
assert len(page.select('.banner-dangerous')) == 0
|
||||
assert page.select_one('button[type=submit]').text.strip() == 'Send 1 text message'
|
||||
@@ -1039,7 +1039,7 @@ def test_send_one_off_does_not_send_without_the_correct_permissions(
|
||||
(
|
||||
mock_get_service_template_with_placeholders,
|
||||
partial(url_for, 'main.send_one_off'),
|
||||
'Who should this message be sent to?',
|
||||
'Send ‘Two week reminder’',
|
||||
False,
|
||||
),
|
||||
(
|
||||
@@ -1063,7 +1063,7 @@ def test_send_one_off_does_not_send_without_the_correct_permissions(
|
||||
(
|
||||
mock_get_service_email_template,
|
||||
partial(url_for, 'main.send_one_off'),
|
||||
'Who should this message be sent to?',
|
||||
'Send ‘Two week reminder’',
|
||||
False,
|
||||
),
|
||||
(
|
||||
@@ -1479,7 +1479,7 @@ def test_send_test_email_message_without_placeholders_redirects_to_check_page(
|
||||
)
|
||||
assert response.status_code == 200
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
assert page.select('h1')[0].text.strip() == 'Preview of Two week reminder'
|
||||
assert page.select('h1')[0].text.strip() == 'Preview of ‘Two week reminder’'
|
||||
|
||||
|
||||
@pytest.mark.parametrize('user, expected_back_link_endpoint, extra_args', (
|
||||
@@ -2755,7 +2755,7 @@ def test_check_notification_shows_preview(
|
||||
template_id=fake_uuid
|
||||
)
|
||||
|
||||
assert page.h1.text.strip() == 'Preview of Two week reminder'
|
||||
assert page.h1.text.strip() == 'Preview of ‘Two week reminder’'
|
||||
assert (
|
||||
page.findAll('a', {'class': 'page-footer-back-link'})[0]['href']
|
||||
) == url_for(
|
||||
|
||||
Reference in New Issue
Block a user