mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
Merge pull request #2287 from GSA/revert-2206-2125-send-message-a11y-audit-unique-ids
This commit is contained in:
@@ -1024,7 +1024,3 @@ nav.nav {
|
|||||||
font-size: units(3);
|
font-size: units(3);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-error {
|
|
||||||
border: 4px solid #b10e1e
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -645,7 +645,6 @@ def edit_service_template(service_id, template_id):
|
|||||||
return render_template(
|
return render_template(
|
||||||
"views/edit-{}-template.html".format(template["template_type"]),
|
"views/edit-{}-template.html".format(template["template_type"]),
|
||||||
form=form,
|
form=form,
|
||||||
errors=form.errors if form.errors else None,
|
|
||||||
template=template,
|
template=template,
|
||||||
heading_action="Edit",
|
heading_action="Edit",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -42,7 +42,5 @@
|
|||||||
{%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %}
|
{%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %}
|
||||||
{%- if params.autocomplete %} autocomplete="{{ params.autocomplete}}"{% endif %}
|
{%- if params.autocomplete %} autocomplete="{{ params.autocomplete}}"{% endif %}
|
||||||
{%- if params.pattern %} pattern="{{ params.pattern }}"{% endif %}
|
{%- if params.pattern %} pattern="{{ params.pattern }}"{% endif %}
|
||||||
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}
|
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
|
||||||
{%- if params.required %} required{% endif %}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
data-{{ key }}="{{ val }}"
|
data-{{ key }}="{{ val }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
novalidate
|
||||||
>
|
>
|
||||||
{{ caller() }}
|
{{ caller() }}
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -13,13 +13,22 @@
|
|||||||
safe_error_message=False,
|
safe_error_message=False,
|
||||||
rows=8,
|
rows=8,
|
||||||
extra_form_group_classes='',
|
extra_form_group_classes='',
|
||||||
placeholder='',
|
placeholder=''
|
||||||
required=None
|
|
||||||
) %}
|
) %}
|
||||||
<div
|
<div
|
||||||
class="usa-form-group{% if field.errors %} usa-form-group--error{% endif %} {{ extra_form_group_classes }}"
|
class="form-group{% if field.errors %} form-group-error{% endif %} {{ extra_form_group_classes }}"
|
||||||
data-module="{% if autofocus %}autofocus{% elif colour_preview %}colour-preview{% endif %}"
|
data-module="{% if autofocus %}autofocus{% elif colour_preview %}colour-preview{% endif %}"
|
||||||
>
|
>
|
||||||
|
{% if field.errors %}
|
||||||
|
<div class="usa-alert usa-alert--error edit-textbox-error-mt" role="alert">
|
||||||
|
<div class="usa-alert__body">
|
||||||
|
<h4 class="usa-alert__heading">Error message</h4>
|
||||||
|
<p class="usa-alert__text" data-module="track-error" data-error-type="{{ field.errors[0] }}" data-error-label="{{ field.name }}">
|
||||||
|
{% if not safe_error_message %}{{ field.errors[0] }}{% else %}{{ field.errors[0]|safe }}{% endif %}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<label class="usa-label" for="{{ field.name }}">
|
<label class="usa-label" for="{{ field.name }}">
|
||||||
{% if label %}
|
{% if label %}
|
||||||
{{ label }}
|
{{ label }}
|
||||||
@@ -31,12 +40,6 @@
|
|||||||
<div class="usa-hint">
|
<div class="usa-hint">
|
||||||
{{ hint }}
|
{{ hint }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
{% if field.errors %}
|
|
||||||
<span id="{{ field.name}}-error" class="usa-error-message" data-module="track-error" data-error-type="{{ field.errors[0] }}" data-error-label="{{ field.name }}">
|
|
||||||
<span class="usa-sr-only">Error:</span>
|
|
||||||
{% if not safe_error_message %}{{ field.errors[0] }}{% else %}{{ field.errors[0]|safe }}{% endif %}
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%
|
{%
|
||||||
if highlight_placeholders or autosize
|
if highlight_placeholders or autosize
|
||||||
@@ -56,8 +59,6 @@
|
|||||||
data_highlight_placeholders='true' if highlight_placeholders else 'false',
|
data_highlight_placeholders='true' if highlight_placeholders else 'false',
|
||||||
rows=rows|string,
|
rows=rows|string,
|
||||||
placeholder=placeholder,
|
placeholder=placeholder,
|
||||||
aria_describedby=field.name+"-error",
|
|
||||||
required='required' if required else None,
|
|
||||||
**kwargs
|
**kwargs
|
||||||
) }}
|
) }}
|
||||||
{% if suffix %}
|
{% if suffix %}
|
||||||
|
|||||||
@@ -29,11 +29,9 @@
|
|||||||
|
|
||||||
{% call form_wrapper() %}
|
{% call form_wrapper() %}
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="tablet:grid-col-9 mobile-lg:grid-col-12" aria-live="polite" role="alert">
|
<div class="tablet:grid-col-9 mobile-lg:grid-col-12">
|
||||||
{{ form.name(param_extensions={
|
{{ form.name(param_extensions={
|
||||||
"extra_form_group_classes": "margin-bottom-2",
|
"extra_form_group_classes": "margin-bottom-2",
|
||||||
"id": "name",
|
|
||||||
"required": True,
|
|
||||||
"hint": {"text": "Your recipients will not see this"}
|
"hint": {"text": "Your recipients will not see this"}
|
||||||
}) }}
|
}) }}
|
||||||
{{ textbox(
|
{{ textbox(
|
||||||
@@ -43,8 +41,7 @@
|
|||||||
hint=content_hint,
|
hint=content_hint,
|
||||||
rows=5,
|
rows=5,
|
||||||
extra_form_group_classes='margin-bottom-1',
|
extra_form_group_classes='margin-bottom-1',
|
||||||
placeholder='Edit me! Check out the Personalization section below for details on cool ((stuff)) you can do with your messages!',
|
placeholder='Edit me! Check out the Personalization section below for details on cool ((stuff)) you can do with your messages!'
|
||||||
required=True
|
|
||||||
) }}
|
) }}
|
||||||
{% if current_user.platform_admin %}
|
{% if current_user.platform_admin %}
|
||||||
{{ form.process_type }}
|
{{ form.process_type }}
|
||||||
|
|||||||
@@ -37,8 +37,8 @@
|
|||||||
data_kwargs={'force-focus': True}
|
data_kwargs={'force-focus': True}
|
||||||
) %}
|
) %}
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-col-12 {% if form.placeholder_value.label.text == 'phone number' %}extra-tracking{% endif %}">
|
<div class="grid-col-12 {% if form.placeholder_value.label.text == 'phone number' %}extra-tracking{% endif %}" aria-live="polite" role="alert">
|
||||||
{{ form.placeholder_value(param_extensions={"id": "phone-number"}) }}
|
{{ form.placeholder_value(param_extensions={"classes": ""}) }}
|
||||||
</div>
|
</div>
|
||||||
{% if skip_link or link_to_upload %}
|
{% if skip_link or link_to_upload %}
|
||||||
<div class="grid-col-12 margin-top-1">
|
<div class="grid-col-12 margin-top-1">
|
||||||
|
|||||||
@@ -90,4 +90,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--<div class="">
|
||||||
|
{{ copy_to_clipboard(template.id, name="Template ID", thing='template ID') }}
|
||||||
|
</div>-->
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1521,7 +1521,7 @@ def test_link_to_upload_not_offered_when_entering_personalisation(
|
|||||||
|
|
||||||
# We’re entering personalization
|
# We’re entering personalization
|
||||||
assert page.select_one("input[type=text]")["name"] == "placeholder_value"
|
assert page.select_one("input[type=text]")["name"] == "placeholder_value"
|
||||||
assert page.select_one("label[for=phone-number]").text.strip() == "name"
|
assert page.select_one("label[for=placeholder_value]").text.strip() == "name"
|
||||||
# No ‘Upload’ link shown
|
# No ‘Upload’ link shown
|
||||||
assert len(page.select("main a")) == 0
|
assert len(page.select("main a")) == 0
|
||||||
assert "Upload" not in page.select_one("main").text
|
assert "Upload" not in page.select_one("main").text
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ def test_should_show_empty_text_box(
|
|||||||
# shouldn’t also be set on the textbox itself
|
# shouldn’t also be set on the textbox itself
|
||||||
assert "data-module" not in textbox
|
assert "data-module" not in textbox
|
||||||
assert (
|
assert (
|
||||||
normalize_spaces(page.select_one("label[for=phone-number]").text) == "one"
|
normalize_spaces(page.select_one("label[for=placeholder_value]").text) == "one"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user