diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index 94bd5cf19..4258d91be 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -169,8 +169,12 @@ def view_notifications(service_id, message_type=None): things_you_can_search_by={ 'email': ['email address'], 'sms': ['phone number'], - 'letter': [], - None: ['email address', 'phone number'], + # This should become ‘postal address’ not ‘first line…’ once + # we’ve finished populating normalised addresses + 'letter': ['first line of address', 'file name'], + # We say recipient here because combining all 3 types, plus + # reference gets too long for the hint text + None: ['recipient'], }.get(message_type) + { True: ['reference'], False: [], diff --git a/app/templates/views/notifications.html b/app/templates/views/notifications.html index 7c9bbabc0..b675555af 100644 --- a/app/templates/views/notifications.html +++ b/app/templates/views/notifications.html @@ -34,42 +34,39 @@ 'counts' ) }} - {% call form_wrapper( - action=url_for('.view_notifications', service_id=current_service.id, message_type=message_type), - class="govuk-grid-row" - ) %} -
-Download this report diff --git a/tests/app/main/views/test_activity.py b/tests/app/main/views/test_activity.py index 8ed04e75c..75e9f0b13 100644 --- a/tests/app/main/views/test_activity.py +++ b/tests/app/main/views/test_activity.py @@ -340,7 +340,7 @@ def test_shows_message_when_no_notifications( ( {}, {}, - 'Search by email address or phone number', + 'Search by recipient', '', ), ( @@ -373,6 +373,16 @@ def test_shows_message_when_no_notifications( 'Search by email address', 'test@example.com', ), + ( + { + 'message_type': 'letter', + }, + { + 'to': 'Firstname Lastname', + }, + 'Search by first line of address or file name', + 'Firstname Lastname', + ), ]) def test_search_recipient_form( client_request, @@ -413,9 +423,10 @@ def test_search_recipient_form( @pytest.mark.parametrize('message_type, expected_search_box_label', [ - (None, 'Search by email address, phone number or reference'), + (None, 'Search by recipient or reference'), ('sms', 'Search by phone number or reference'), ('email', 'Search by email address or reference'), + ('letter', 'Search by first line of address, file name or reference'), ]) def test_api_users_are_told_they_can_search_by_reference_when_service_has_api_keys( client_request, @@ -437,7 +448,7 @@ def test_api_users_are_told_they_can_search_by_reference_when_service_has_api_ke @pytest.mark.parametrize('message_type, expected_search_box_label', [ - (None, 'Search by email address or phone number'), + (None, 'Search by recipient'), ('sms', 'Search by phone number'), ('email', 'Search by email address'), ]) @@ -615,10 +626,10 @@ def test_redacts_templates_that_should_be_redacted( "message_type, tablist_visible, search_bar_visible", [ ('email', True, True), ('sms', True, True), - ('letter', False, False) + ('letter', False, True) ] ) -def test_big_numbers_and_search_dont_show_for_letters( +def test_big_numbers_dont_show_for_letters( client_request, service_one, mock_get_notifications,