From 4d05427669291dda34da09415d892d89f7cecd4e Mon Sep 17 00:00:00 2001 From: Eric Dunsworth <1907279+EricDunsworth@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:33:36 -0400 Subject: [PATCH] Page feedback tool: Polish AJAX fragments (FR pageData, role="status") The AJAX fragments had two minor flaws: * The English fragment contained pageData references that were missing from the French variant. That difference caused a hidden input named "contact" (with a JSON string as its value) to be injected into French feedback widgets. Although it didn't cause any other issues (data-feedback-link and data-feedback-url still worked fine in practice). * The no button's invisible transition message in JS mode is technically a status message, but wasn't coded as such (was using aria-live="polite" as opposed to role="status"). This resolves the flaws by: * Adding pageData references throughout the French fragment (same spots as English) to eliminate the hidden "contact" input. * Replacing aria-live="polite" with role="status" in the no button's transition message: * role="status" is a more formal way of denoting status messages, implicitly sets aria-live="polite" + aria-atomic="true" and is already in use for the widget's thank you message. --- _data/sites.json | 93 +++++++++++++++---- .../deprecated/page-feedback-v1-en.html | 84 +++++++++++++++++ .../deprecated/page-feedback-v1-fr.html | 84 +++++++++++++++++ sites/feedback/assets/page-feedback-en.html | 2 +- sites/feedback/assets/page-feedback-fr.html | 18 ++-- sites/feedback/index.json-ld | 93 +++++++++++++++---- 6 files changed, 330 insertions(+), 44 deletions(-) create mode 100644 sites/feedback/assets/deprecated/page-feedback-v1-en.html create mode 100644 sites/feedback/assets/deprecated/page-feedback-v1-fr.html diff --git a/_data/sites.json b/_data/sites.json index f94c072995..ba3614bd5f 100644 --- a/_data/sites.json +++ b/_data/sites.json @@ -631,7 +631,7 @@ } ,{ "@context": { - "@version": 2.0, + "@version": 2.1, "dct": "http://purl.org/dc/terms/", "title": { "@id": "dct:title", "@container": "@language" }, "description": { "@id": "dct:description", "@container": "@language" }, @@ -645,10 +645,10 @@ "en": "Documentation on how to use the elements of the feedback area.", "fr": "Documentation sur l'utilisation des éléments de la zone commentaires." }, - "modified": "2023-01-10", + "modified": "2024-07-19", "componentName": "feedback", "status": "stable", - "version": "2.0", + "version": "2.1", "pages": { "docs": [ { @@ -741,7 +741,7 @@ "en": "https://design.canada.ca/feedback/index.html", "fr": "https://conception.canada.ca/retroaction/index.html" }, - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "example": [ { "en": { "href": "page-feedback-en.html", "text": "Page feedback tool" }, @@ -755,6 +755,10 @@ "_:implement_pft_mws_author" ], "history": [ + { + "en": "July 2024 - AJAX fragment: Added pageData to the French variant, changed aria-live=\"polite\" to role=\"status\" in \"Tell us why below:\".", + "fr": "Juillet 2024 - Fragment AJAX : Ajout de pageData à la variante française, changement de aria-live=\"polite\" à role=\"status\" dans « Dites nous pourquoi ci-dessous : »." + }, { "en": "August 2023 - Initial implementation of the variation.", "fr": "Août 2023 - Implémentation initiale de la variante." @@ -775,7 +779,7 @@ "en": "https://design.canada.ca/feedback/index.html", "fr": "https://conception.canada.ca/retroaction/index.html" }, - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "example": [ { "en": { "href": "page-feedback-contact-en.html", "text": "Page feedback tool with contact link" }, @@ -985,7 +989,7 @@ }, { "@id": "_:implement_pft", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "Standard (wet-boew)", "fr": "Standard (wet-boew)" @@ -1055,7 +1059,7 @@ }, { "@id": "_:implement_pft_gcweb", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "GCWeb Jekyll", "fr": "GCWeb Jekyll" @@ -1093,7 +1097,7 @@ }, { "@id": "_:implement_pft_upgrade_rap", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "Upgrade from RAP", "fr": "Mise à jour à partir de SUP" @@ -1115,7 +1119,7 @@ }, { "@id": "_:implement_pft_mws_author", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "MWS users", "fr": "Utilisateur SWG" @@ -1141,7 +1145,7 @@ }, { "@id": "_:implement_pft_contact", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "Standard (WET-BOEW)", "fr": "Standard (WET-BOEW)" @@ -1211,7 +1215,7 @@ }, { "@id": "_:implement_pft_contact_gcweb", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "GCWeb Jekyll", "fr": "GCWeb Jekyll" @@ -1255,7 +1259,7 @@ "@id": "_:cs_pft_container", "name": "Page feedback tool with AJAX", "status": "stable", - "baseOnIteration": "_:iteration_pft_1", + "baseOnIteration": "_:iteration_pft_2", "detectableBy": ".pagedetails .wb-disable-allow[data-ajax-replace*=feedback]", "layout": [ "At the top-left column in the page details component", @@ -1303,7 +1307,7 @@ "@id": "_:cs_pft_ajax", "name": "Page feedback tool AJAX file", "status": "stable", - "baseOnIteration": "_:iteration_pft_1", + "baseOnIteration": "_:iteration_pft_2", "dependOnChangeSet": "_:cs_pft_container", "detectableBy": "
", "layout": [ @@ -1600,10 +1604,15 @@ ], "iteration": [ { - "@id": "_:iteration_pft_1", - "name": "Page feedback tool - Iteration 1", - "date": "2023-08", - "detectableBy": ".gc-pft", + "@id": "_:iteration_pft_2", + "name": "Page feedback tool - Iteration 1.1", + "date": "2024-07", + "detectableBy": "#gc-pft:has(.gc-pft-no p[role=\"status\"]:nth-of-type(2))", + "fixes": [ + "AJAX fragment: Added pageData to the French variant", + "AJAX fragment: Changed aria-live=\"polite\" to role=\"status\" in \"Tell us why below:\"." + ], + "predecessor": "_:iteration_pft_1", "assets": [ { "@type": "source-code", @@ -1649,6 +1658,56 @@ } ] }, + { + "@id": "_:iteration_pft_1", + "name": "Page feedback tool - Iteration 1", + "date": "2023-08", + "detectableBy": "#gc-pft", + "assets": [ + { + "@type": "source-code", + "@language": "en", + "description": "Code sample", + "code": "
" + }, + { + "@type": "source-code", + "@language": "en", + "description": "Code sample with contact link", + "code": "
" + }, + { + "@type": "source-code", + "@language": "en", + "description": "Ajaxed-in content", + "code": { + "@type": [ "rdf:HTML", "@id" ], + "@value": "assets/deprecated/page-feedback-v1-en.html" + } + }, + { + "@type": "source-code", + "@language": "fr", + "description": "Exemple de code", + "code": "
" + }, + { + "@type": "source-code", + "@language": "fr", + "description": "Exemple de code avec lien de contact", + "code": "
" + }, + { + "@type": "source-code", + "@language": "fr", + "description": "Contenu ajouté via Ajax", + "code": { + "@type": [ "rdf:HTML", "@id" ], + "@value": "assets/deprecated/page-feedback-v1-fr.html" + } + } + ] + }, { "@id": "_:iteration_rap_5", "name": "Report a problem - Iteration 5", diff --git a/sites/feedback/assets/deprecated/page-feedback-v1-en.html b/sites/feedback/assets/deprecated/page-feedback-v1-en.html new file mode 100644 index 0000000000..5d69900786 --- /dev/null +++ b/sites/feedback/assets/deprecated/page-feedback-v1-en.html @@ -0,0 +1,84 @@ +
+
+
+

Give feedback about this page

+
+
+ +
+
+ Did you find what you were looking for? +
+ +
+
+ + +
+
+
+

If not, tell us why below:

+

Tell us why below:

+
+ +
+
+ +

You will not receive a reply. Don't include personal information (telephone, email, SIN, financial, medical, or work details).

+

Maximum 300 characters

+ +
+ +
+
+
+

Thank you for your feedback.

+
+
+
+
diff --git a/sites/feedback/assets/deprecated/page-feedback-v1-fr.html b/sites/feedback/assets/deprecated/page-feedback-v1-fr.html new file mode 100644 index 0000000000..c0c147076e --- /dev/null +++ b/sites/feedback/assets/deprecated/page-feedback-v1-fr.html @@ -0,0 +1,84 @@ +
+
+
+

Donnez votre rétroaction sur cette page

+
+
+ +
+
+ Avez-vous trouvé ce que vous cherchiez? +
+ +
+
+ + +
+
+
+

Sinon, dites nous pourquoi ci-dessous :

+

Dites nous pourquoi ci-dessous :

+
+ +
+
+ +

Vous ne recevrez pas de réponse. N'incluez pas de renseignements personnels (téléphone, courriel, NAS, renseignements financiers, médicaux ou professionnels).

+

Maximum de 300 caractères

+ +
+ +
+
+
+

Merci de vos commentaires.

+
+
+
+
diff --git a/sites/feedback/assets/page-feedback-en.html b/sites/feedback/assets/page-feedback-en.html index 5d69900786..c490bee556 100644 --- a/sites/feedback/assets/page-feedback-en.html +++ b/sites/feedback/assets/page-feedback-en.html @@ -42,7 +42,7 @@

Give feedback about this page

If not, tell us why below:

-

Tell us why below:

+

Tell us why below:

Donnez votre rétroaction sur cette page
pageData to the French variant, changed aria-live=\"polite\" to role=\"status\" in \"Tell us why below:\".", + "fr": "Juillet 2024 - Fragment AJAX : Ajout de pageData à la variante française, changement de aria-live=\"polite\" à role=\"status\" dans « Dites nous pourquoi ci-dessous : »." + }, { "en": "August 2023 - Initial implementation of the variation.", "fr": "Août 2023 - Implémentation initiale de la variante." @@ -144,7 +148,7 @@ "en": "https://design.canada.ca/feedback/index.html", "fr": "https://conception.canada.ca/retroaction/index.html" }, - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "example": [ { "en": { "href": "page-feedback-contact-en.html", "text": "Page feedback tool with contact link" }, @@ -354,7 +358,7 @@ }, { "@id": "_:implement_pft", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "Standard (wet-boew)", "fr": "Standard (wet-boew)" @@ -424,7 +428,7 @@ }, { "@id": "_:implement_pft_gcweb", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "GCWeb Jekyll", "fr": "GCWeb Jekyll" @@ -462,7 +466,7 @@ }, { "@id": "_:implement_pft_upgrade_rap", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "Upgrade from RAP", "fr": "Mise à jour à partir de SUP" @@ -484,7 +488,7 @@ }, { "@id": "_:implement_pft_mws_author", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "MWS users", "fr": "Utilisateur SWG" @@ -510,7 +514,7 @@ }, { "@id": "_:implement_pft_contact", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "Standard (WET-BOEW)", "fr": "Standard (WET-BOEW)" @@ -580,7 +584,7 @@ }, { "@id": "_:implement_pft_contact_gcweb", - "iteration": "_:iteration_pft_1", + "iteration": "_:iteration_pft_2", "name": { "en": "GCWeb Jekyll", "fr": "GCWeb Jekyll" @@ -624,7 +628,7 @@ "@id": "_:cs_pft_container", "name": "Page feedback tool with AJAX", "status": "stable", - "baseOnIteration": "_:iteration_pft_1", + "baseOnIteration": "_:iteration_pft_2", "detectableBy": ".pagedetails .wb-disable-allow[data-ajax-replace*=feedback]", "layout": [ "At the top-left column in the page details component", @@ -672,7 +676,7 @@ "@id": "_:cs_pft_ajax", "name": "Page feedback tool AJAX file", "status": "stable", - "baseOnIteration": "_:iteration_pft_1", + "baseOnIteration": "_:iteration_pft_2", "dependOnChangeSet": "_:cs_pft_container", "detectableBy": "
", "layout": [ @@ -969,10 +973,15 @@ ], "iteration": [ { - "@id": "_:iteration_pft_1", - "name": "Page feedback tool - Iteration 1", - "date": "2023-08", - "detectableBy": ".gc-pft", + "@id": "_:iteration_pft_2", + "name": "Page feedback tool - Iteration 1.1", + "date": "2024-07", + "detectableBy": "#gc-pft:has(.gc-pft-no p[role=\"status\"]:nth-of-type(2))", + "fixes": [ + "AJAX fragment: Added pageData to the French variant", + "AJAX fragment: Changed aria-live=\"polite\" to role=\"status\" in \"Tell us why below:\"." + ], + "predecessor": "_:iteration_pft_1", "assets": [ { "@type": "source-code", @@ -1018,6 +1027,56 @@ } ] }, + { + "@id": "_:iteration_pft_1", + "name": "Page feedback tool - Iteration 1", + "date": "2023-08", + "detectableBy": "#gc-pft", + "assets": [ + { + "@type": "source-code", + "@language": "en", + "description": "Code sample", + "code": "
" + }, + { + "@type": "source-code", + "@language": "en", + "description": "Code sample with contact link", + "code": "
" + }, + { + "@type": "source-code", + "@language": "en", + "description": "Ajaxed-in content", + "code": { + "@type": [ "rdf:HTML", "@id" ], + "@value": "assets/deprecated/page-feedback-v1-en.html" + } + }, + { + "@type": "source-code", + "@language": "fr", + "description": "Exemple de code", + "code": "
" + }, + { + "@type": "source-code", + "@language": "fr", + "description": "Exemple de code avec lien de contact", + "code": "
" + }, + { + "@type": "source-code", + "@language": "fr", + "description": "Contenu ajouté via Ajax", + "code": { + "@type": [ "rdf:HTML", "@id" ], + "@value": "assets/deprecated/page-feedback-v1-fr.html" + } + } + ] + }, { "@id": "_:iteration_rap_5", "name": "Report a problem - Iteration 5",