mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Replace test with one-off
It’s a confusing proposition to have two features which are almost identical. Even differentiating between them in the template menu would be tricky. I think the better thing to do is rename the whole feature to ‘send one-off message’. Then if someone wants to use there own phone number or email address, give them a quick shortcut to doing that, once they’re in the flow. In the background this reuses the ‘send yourself a test’ code, but the user is never aware that they’re going through a different route to send an individual message. So the proposition stays nice and clean.
This commit is contained in:
@@ -26,6 +26,19 @@
|
||||
@include grid-column(7/8);
|
||||
}
|
||||
|
||||
%top-gutter,
|
||||
.top-gutter {
|
||||
@extend %contain-floats;
|
||||
display: block;
|
||||
margin-top: $gutter;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.top-gutter-4-3 {
|
||||
@extend %top-gutter;
|
||||
margin-top: $gutter * 4 / 3;
|
||||
}
|
||||
|
||||
%bottom-gutter,
|
||||
.bottom-gutter {
|
||||
@extend %contain-floats;
|
||||
|
||||
@@ -57,7 +57,7 @@ class Config(object):
|
||||
CSV_UPLOAD_BUCKET_NAME = 'local-notifications-csv-upload'
|
||||
DESKPRO_PERSON_EMAIL = 'donotreply@notifications.service.gov.uk'
|
||||
ACTIVITY_STATS_LIMIT_DAYS = 7
|
||||
TEST_MESSAGE_FILENAME = 'Test message'
|
||||
TEST_MESSAGE_FILENAME = 'One-off message'
|
||||
|
||||
STATSD_ENABLED = False
|
||||
STATSD_HOST = "statsd.hostedgraphite.com"
|
||||
|
||||
@@ -282,13 +282,25 @@ def send_test_step(service_id, template_id, step_index):
|
||||
template.values = get_normalised_send_test_values_from_session()
|
||||
template.values[current_placeholder] = None
|
||||
|
||||
if (
|
||||
request.endpoint == 'main.send_one_off_step' and
|
||||
step_index == 0 and
|
||||
template.template_type != 'letter'
|
||||
):
|
||||
skip_link = (
|
||||
'Use my {}'.format(first_column_headings[template.template_type][0]),
|
||||
url_for('.send_test', service_id=service_id, template_id=template.id),
|
||||
)
|
||||
else:
|
||||
skip_link = None
|
||||
|
||||
return render_template(
|
||||
'views/send-test.html',
|
||||
page_title=get_send_test_page_title(template.template_type, request.endpoint),
|
||||
page_title=get_send_test_page_title(template.template_type, get_help_argument()),
|
||||
template=template,
|
||||
form=form,
|
||||
skip_link=skip_link,
|
||||
optional_placeholder=optional_placeholder,
|
||||
help=get_help_argument(),
|
||||
back_link=back_link,
|
||||
)
|
||||
|
||||
@@ -549,12 +561,9 @@ def all_placeholders_in_session(placeholders):
|
||||
)
|
||||
|
||||
|
||||
def get_send_test_page_title(template_type, endpoint):
|
||||
if get_help_argument():
|
||||
def get_send_test_page_title(template_type, help_argument):
|
||||
if help_argument:
|
||||
return 'Example text message'
|
||||
if template_type == 'letter':
|
||||
return 'Print a test letter'
|
||||
return {
|
||||
'main.send_test_step': 'Send yourself a test',
|
||||
'main.send_one_off_step': 'Send one-off message',
|
||||
}[endpoint]
|
||||
return 'Send one-off message'
|
||||
|
||||
@@ -15,10 +15,20 @@
|
||||
</h1>
|
||||
|
||||
<form method="post" class="js-stick-at-top-when-scrolling" data-module="autofocus">
|
||||
{{ textbox(
|
||||
form.placeholder_value,
|
||||
hint='Optional' if optional_placeholder else None
|
||||
) }}
|
||||
<div class="grid-row">
|
||||
<div class="column-two-thirds">
|
||||
{{ textbox(
|
||||
form.placeholder_value,
|
||||
hint='Optional' if optional_placeholder else None,
|
||||
width='1-1',
|
||||
) }}
|
||||
</div>
|
||||
{% if skip_link %}
|
||||
<div class="column-one-third">
|
||||
<a href="{{ skip_link[1] }}" class="top-gutter-4-3">{{ skip_link[0] }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ page_footer('Next', back_link=back_link) }}
|
||||
</form>
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="{{ 'column-half' if template.template_type == 'letter' else 'column-third' }}">
|
||||
<a href="{{ url_for(".send_test", service_id=current_service.id, template_id=template.id) }}" class="pill-separate-item">
|
||||
{{ 'Print a test letter' if template.template_type == 'letter' else 'Send yourself a test' }}
|
||||
<a href="{{ url_for(".send_one_off", service_id=current_service.id, template_id=template.id) }}" class="pill-separate-item">
|
||||
{{ 'Print a test letter' if template.template_type == 'letter' else 'Send one-off message' }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user