From 662e17c4bf2a391740a0cda6e04aa5bbedbc4d43 Mon Sep 17 00:00:00 2001 From: William B <7444334+whabanks@users.noreply.github.com> Date: Wed, 22 May 2024 16:40:41 -0400 Subject: [PATCH] Add char limit to change service name txt field (#1851) - Added the text hint from the create service page to the change service name page. - Removed guidance sentence replaced it with hint text --- app/templates/views/service-settings/name.html | 6 +++--- app/translations/csv/fr.csv | 1 - tests/app/main/views/test_service_settings.py | 10 ++++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/templates/views/service-settings/name.html b/app/templates/views/service-settings/name.html index 5306c70f7b..34e7119bcd 100644 --- a/app/templates/views/service-settings/name.html +++ b/app/templates/views/service-settings/name.html @@ -16,8 +16,6 @@ back_link=url_for('main.service_settings', service_id=current_service.id) ) }} -
{{ _('Name your service something people would search for in their inbox.') }}
-{{ _('Users will see your service name:') }}
@@ -33,7 +31,9 @@ {% call form_wrapper() %} {% set save_txt = _('Save') %} - {{ textbox(form.name) }} + {% set hint_txt = _('Use a name that recipients will recognize. Maximum 255 characters.') %} + + {{ textbox(form.name, hint=hint_txt, maxlength=255) }} {{ page_footer(save_txt) }} {% endcall %} diff --git a/app/translations/csv/fr.csv b/app/translations/csv/fr.csv index 48ec3f5e90..49316da2d4 100644 --- a/app/translations/csv/fr.csv +++ b/app/translations/csv/fr.csv @@ -169,7 +169,6 @@ "Personalise this message","Personnalisez le message" "This service name is already in use","Ce nom de service a déjà été utilisé" "Change your service name","Modifier le nom du service" -"Name your service something people would search for in their inbox.","Donnez à votre service un nom que les gens chercheraient dans leur boîte de réception." "Thank you for your request to go live. We’ll get back to you within one working day.","Merci pour votre demande d'activation du service. Nous communiquerons avec vous dans un délai d'un jour ouvrable." "‘%(service_name)s’ was deleted","‘%(service_name)s’ a été supprimé" "Are you sure you want to delete","Voulez-vous vraiment supprimer" diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 39d3e3fd61..d832d65653 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -355,7 +355,10 @@ def test_should_show_service_name( page = client_request.get("main.service_name_change", service_id=SERVICE_ONE_ID) assert page.find("h1").text == "Change your service name" assert page.find("input", attrs={"type": "text"})["value"] == "service one" - assert page.select_one("main p").text == "Name your service something people would search for in their inbox." + assert ( + normalize_spaces(page.select_one("div[class~='form-group'] span[id='name-hint']").text) + == "Use a name that recipients will recognize. Maximum 255 characters." + ) assert normalize_spaces(page.select_one("main ul").text) == ("as your email sender name. at the start of every text message.") app.service_api_client.get_service.assert_called_with(SERVICE_ONE_ID) @@ -367,7 +370,10 @@ def test_should_show_service_name_with_no_prefixing( service_one["prefix_sms"] = False page = client_request.get("main.service_name_change", service_id=SERVICE_ONE_ID) assert page.find("h1").text == "Change your service name" - assert page.select_one("main p").text == "Name your service something people would search for in their inbox." + assert ( + normalize_spaces(page.select_one("div[class~='form-group'] span[id='name-hint']").text) + == "Use a name that recipients will recognize. Maximum 255 characters." + ) def test_should_redirect_after_change_service_name(