Skip to content

Commit

Permalink
Add char limit to change service name txt field (#1851)
Browse files Browse the repository at this point in the history
- Added the text hint from the create service page to the change service name page.
- Removed guidance sentence replaced it with hint text
  • Loading branch information
whabanks committed May 22, 2024
1 parent 23196f1 commit 662e17c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/templates/views/service-settings/name.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
back_link=url_for('main.service_settings', service_id=current_service.id)
) }}

<p>{{ _('Name your service something people would search for in their inbox.') }}</p>

<div class="form-group contain-floats box-border mb-gutterHalf md:mb-gutter">
{% if current_service.prefix_sms %}
<p>{{ _('Users will see your service name:') }}</p>
Expand All @@ -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 %}

Expand Down
1 change: 0 additions & 1 deletion app/translations/csv/fr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 8 additions & 2 deletions tests/app/main/views/test_service_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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(
Expand Down

0 comments on commit 662e17c

Please sign in to comment.