Tell users that they can search by reference

Users who have an API integration (and therefore have a way of passing
in a reference for each notification) can now search by that reference
(see https://github.com/alphagov/notifications-api/pull/2682)

This commit changes the label on the search box to tell these users that
this is possible, without changing the label for users without an API
integration, who might get confused by what ‘reference’ means.

It also makes the label consistently say ‘email address or phone number’
(ie email address is first) because this is our content style.
This commit is contained in:
Chris Hill-Scott
2019-12-13 14:27:56 +00:00
parent 9c47a2ce8f
commit 4da9c44919
4 changed files with 91 additions and 2 deletions

View File

@@ -227,6 +227,15 @@ def view_notifications(service_id, message_type=None):
message_type=message_type,
to=request.form.get('to', ''),
),
things_you_can_search_by={
'email': ['email address'],
'sms': ['phone number'],
'letter': [],
None: ['email address', 'phone number'],
}.get(message_type) + {
True: ['reference'],
False: [],
}.get(bool(current_service.api_keys)),
download_link=url_for(
'.download_notifications_csv',
service_id=current_service.id,

View File

@@ -41,6 +41,13 @@
{{ textbox(
search_form.to,
width='1-1',
label=things_you_can_search_by|formatted_list(
conjunction='or',
before_each='',
after_each='',
prefix='Search by',
prefix_plural='Search by'
)
) }}
</div>
<div class="column-one-quarter align-button-with-textbox">