From b7b33ff706ae54470e4463860eaa23bf69b187c6 Mon Sep 17 00:00:00 2001
From: developer43
Date: Mon, 4 Nov 2024 08:30:31 -0500
Subject: [PATCH 1/5] usagov-1955-report-issue-error-handling: update code to
make error box the first focus with a form error
---
web/themes/custom/usagov/scripts/reportAProblem.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/themes/custom/usagov/scripts/reportAProblem.js b/web/themes/custom/usagov/scripts/reportAProblem.js
index 6a23267bfb..8ef449273b 100644
--- a/web/themes/custom/usagov/scripts/reportAProblem.js
+++ b/web/themes/custom/usagov/scripts/reportAProblem.js
@@ -92,7 +92,7 @@ function fieldValidation() {
// If there is at least 1 error, focus the screen on the first error message.
if (!noErrors) {
var elem = document.querySelector(".err-label");
- elem.focus();
+ // elem.focus(); // commented out so focus can goto the error box first
var viewportOffset = elem.getBoundingClientRect();
var top = viewportOffset.top;
if (top < 108) {
From 9a46ff51260cfb3027739ba033fe6b45277eb155 Mon Sep 17 00:00:00 2001
From: developer43
Date: Mon, 4 Nov 2024 11:41:05 -0500
Subject: [PATCH 2/5] usagov-1955-report-issue-error-handling: update script to
tab focus on inline error
---
web/themes/custom/usagov/scripts/reportAProblem.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/themes/custom/usagov/scripts/reportAProblem.js b/web/themes/custom/usagov/scripts/reportAProblem.js
index 8ef449273b..66dfe7df59 100644
--- a/web/themes/custom/usagov/scripts/reportAProblem.js
+++ b/web/themes/custom/usagov/scripts/reportAProblem.js
@@ -57,7 +57,7 @@ function fieldValidation() {
label.after(
'' +
+ '" class="err-label usa-error" tabindex="-1">' +
error +
""
);
From 7ef7b8ed7316dce080ee9f7a00d3bc45b67128fb Mon Sep 17 00:00:00 2001
From: developer43
Date: Mon, 4 Nov 2024 11:41:20 -0500
Subject: [PATCH 3/5] usagov-1955-report-issue-error-handling: update error
anchor link
---
...twig-content-site-issue-report-form.html.twig | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-site-issue-report-form.html.twig b/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-site-issue-report-form.html.twig
index 76a06f2460..7b56e5f960 100644
--- a/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-site-issue-report-form.html.twig
+++ b/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-site-issue-report-form.html.twig
@@ -6,19 +6,19 @@
@@ -58,7 +58,7 @@
maxlength="255"
size="40"
required
- data-error="Fill out the name field"
+ data-error="Error: Fill out the name field"
data-name="First Name"
/>
@@ -75,7 +75,7 @@
maxlength="80"
size="40"
required
- data-error="Fill out the email field"
+ data-error="Error: Fill out the email field"
data-name="Email Address"
/>
@@ -94,7 +94,7 @@
rows="10"
maxlength="1000"
required
- data-error="Fill out the description field"
+ data-error="Error: Fill out the description field"
data-name="Description"
>
Maximum length is 1000 characters.
From 4971f1ccfb453c6ca79bc1a37c12ff590278fdc1 Mon Sep 17 00:00:00 2001
From: developer43
Date: Mon, 4 Nov 2024 11:47:27 -0500
Subject: [PATCH 4/5] usagov-1955-report-issue-error-handling: update error
anchor link on Spanish page
---
...ntent-reporte-problemas-en-este-sitio-web.html.twig | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-reporte-problemas-en-este-sitio-web.html.twig b/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-reporte-problemas-en-este-sitio-web.html.twig
index be4e60cafa..dbbe2e749c 100644
--- a/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-reporte-problemas-en-este-sitio-web.html.twig
+++ b/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-reporte-problemas-en-este-sitio-web.html.twig
@@ -6,20 +6,20 @@
From c5776cfb6638521e3c53e9fce3ac273b78e796c7 Mon Sep 17 00:00:00 2001
From: developer43
Date: Wed, 6 Nov 2024 07:15:14 -0500
Subject: [PATCH 5/5] usagov-1955-report-issue-error-handling: add "Error" text
to inline error message
---
...ig-content-reporte-problemas-en-este-sitio-web.html.twig | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-reporte-problemas-en-este-sitio-web.html.twig b/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-reporte-problemas-en-este-sitio-web.html.twig
index dbbe2e749c..8c50fce5c9 100644
--- a/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-reporte-problemas-en-este-sitio-web.html.twig
+++ b/web/themes/custom/usagov/templates/field--node--field-custom-twig-content-reporte-problemas-en-este-sitio-web.html.twig
@@ -58,7 +58,7 @@
maxlength="255"
size="40"
required
- data-error="Escriba su nombre"
+ data-error="Error: Escriba su nombre"
data-name="First Name"
/>
@@ -75,7 +75,7 @@
maxlength="80"
size="40"
required\
- data-error="Escriba su email"
+ data-error="Error: Escriba su email"
data-name="Email Address"
/>
@@ -94,7 +94,7 @@
rows="10"
maxlength="1000"
required
- data-error="Escriba la descripción"
+ data-error="Error: Escriba la descripción"
data-name="Description"
>
Por favor limite su comentario a 1000 caracteres.