From add1764bcdb5b65426d7ec2420cd2e2962921d86 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 1/2] 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 3e6ec3171e..d2cf0b1a43 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": [
{
@@ -751,7 +751,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" },
@@ -765,6 +765,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."
@@ -785,7 +789,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" },
@@ -995,7 +999,7 @@
},
{
"@id": "_:implement_pft",
- "iteration": "_:iteration_pft_1",
+ "iteration": "_:iteration_pft_2",
"name": {
"en": "Standard (wet-boew)",
"fr": "Standard (wet-boew)"
@@ -1065,7 +1069,7 @@
},
{
"@id": "_:implement_pft_gcweb",
- "iteration": "_:iteration_pft_1",
+ "iteration": "_:iteration_pft_2",
"name": {
"en": "GCWeb Jekyll",
"fr": "GCWeb Jekyll"
@@ -1103,7 +1107,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"
@@ -1125,7 +1129,7 @@
},
{
"@id": "_:implement_pft_mws_author",
- "iteration": "_:iteration_pft_1",
+ "iteration": "_:iteration_pft_2",
"name": {
"en": "MWS users",
"fr": "Utilisateur SWG"
@@ -1151,7 +1155,7 @@
},
{
"@id": "_:implement_pft_contact",
- "iteration": "_:iteration_pft_1",
+ "iteration": "_:iteration_pft_2",
"name": {
"en": "Standard (WET-BOEW)",
"fr": "Standard (WET-BOEW)"
@@ -1221,7 +1225,7 @@
},
{
"@id": "_:implement_pft_contact_gcweb",
- "iteration": "_:iteration_pft_1",
+ "iteration": "_:iteration_pft_2",
"name": {
"en": "GCWeb Jekyll",
"fr": "GCWeb Jekyll"
@@ -1265,7 +1269,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",
@@ -1313,7 +1317,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": [
@@ -1610,10 +1614,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",
@@ -1659,6 +1668,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
+
+
+
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
+
+
+
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