Skip to content

Commit ae97216

Browse files
committed
Feedback: hide PFT when server is down
1 parent 842d373 commit ae97216

7 files changed

Lines changed: 170 additions & 2 deletions

File tree

_data/sites.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,11 @@
969969
"language": "fr",
970970
"path": "page-feedback-fr.html"
971971
},
972+
{
973+
"title": "Page feedback tool when end-point is down",
974+
"language": "en",
975+
"path": "page-feedback-down.html"
976+
},
972977
{
973978
"title": "Page feedback tool with contact link",
974979
"language": "en",
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<div data-wb-jsonmanager='{
2+
"url": "pft-test.json",
3+
"name": "service",
4+
"patches": [
5+
{ "op": "test", "path": "/isPFTActive", "value": false },
6+
{ "op": "add", "path": "/unhideme", "value": "hidden" }
7+
]
8+
}'></div>
9+
10+
<div id="gc-pft" class="row wb-disable-allow" data-wb-jsonmanager='{
11+
"name": "gc-pft",
12+
"extractor": [
13+
{ "selector": "title", "path": "pageData/pageTitle" },
14+
{ "selector": "html", "attr": "lang", "path": "pageData/language" },
15+
{ "interface": "locationHref", "path": "pageData/submissionPage" },
16+
{ "selector": "#wb-lng ul li:first-child a[lang]", "attr": "href", "path": "pageData/oppositelang" },
17+
{ "selector": "[data-feedback-theme]", "attr": "data-feedback-theme", "path": "pageData/themeopt" },
18+
{ "selector": "[data-feedback-section]", "attr": "data-feedback-section", "path": "pageData/sectionopt" },
19+
{ "selector": "meta[name=\"dcterms.creator\"]", "attr": "content", "path": "pageData/institutionopt" },
20+
{ "selector": "[data-feedback-link]", "attr": "data-feedback-link", "path": "contact/link" },
21+
{ "selector": "[data-feedback-url]", "attr": "data-feedback-url", "path": "contact/url" }
22+
]
23+
}'>
24+
<div class="col-sm-10 col-md-9 col-lg-8 hidden" data-wb-json='{
25+
"url": "#[service]/unhideme",
26+
"type": "removeclass"
27+
}'>
28+
<section class="well mrgn-bttm-0">
29+
<h3 class="wb-inv">Give feedback about this page</h3>
30+
<form action="https://feedback-retroaction.canada.ca/api/QueueProblemForm" method="post" class="wb-postback wb-disable-allow" data-wb-postback='{"success":".gc-pft-thnk"}'>
31+
<div class="wb-disable-allow" data-wb-json='{
32+
"url": "#[gc-pft]/pageData",
33+
"mapping": [
34+
{ "selector": "input", "attr": "name", "value": "/@id" },
35+
{ "selector": "input", "attr": "value", "value": "/@value" }
36+
]
37+
}'>
38+
<template>
39+
<input type="hidden" name="" value="" />
40+
</template>
41+
</div>
42+
<fieldset class="gc-pft-btns chkbxrdio-grp row row-no-gutters d-sm-flex flex-sm-wrap align-items-sm-center">
43+
<legend class="col-xs-12 col-sm-7 nojs-col-sm-12 col-md-9 col-lg-8 text-center text-sm-left nojs-text-left mrgn-tp-sm pr-sm-3"><span class="field-name">Did you find what you were looking for?</span></legend>
44+
<div class="col-xs-12 nojs-show">
45+
<button name="helpful" value="Yes-Oui" class="btn btn-primary" aria-describedby="gc-pft-why">Yes</button>
46+
</div>
47+
<div class="col-xs-12 col-sm-5 col-md-3 col-lg-4 text-center text-sm-right nojs-hide">
48+
<button name="helpful" value="Yes-Oui" class="btn btn-primary">Yes</button>
49+
<button class="btn btn-primary mrgn-lft-sm" data-wb-doaction='[
50+
{"action":"removeClass","source":".gc-pft-no","class":"nojs-show"},
51+
{"action":"addClass","source":".gc-pft-btns","class":"hide"}
52+
]'>No</button>
53+
</div>
54+
</fieldset>
55+
<div class="gc-pft-no nojs-show">
56+
<p id="gc-pft-why" class="nojs-show mrgn-tp-lg mrgn-bttm-md">If not, tell us why below:</p>
57+
<p class="nojs-hide wb-inv" aria-live="polite">Tell us why below:</p>
58+
<div class="wb-disable-allow" data-wb-json='{
59+
"url": "#[gc-pft]/contact",
60+
"streamline": "true",
61+
"mapping": [
62+
{
63+
"template": "[data-contact-template]",
64+
"test": "fn:isLiteral",
65+
"assess": "/url",
66+
"mapping": [
67+
{ "selector": "a", "type": "attr", "attr": "href", "value": "/url" },
68+
{ "selector": "a", "value": "/link" }
69+
]
70+
}
71+
]
72+
}'>
73+
<template data-contact-template>
74+
<details>
75+
<summary>Need urgent help with a problem? Contact us</summary>
76+
<p class="mrgn-bttm-0 mrgn-tp-md fnt-nrml">
77+
<a href="#"></a>
78+
</p>
79+
</details>
80+
</template>
81+
</div>
82+
<div class="form-group">
83+
<label id="gc-pft-prblm-label" for="gc-pft-prblm" class="mrgn-bttm-0"><span class="field-name">Please provide more details</span></label>
84+
<p id="gc-pft-prblm-note" class="mrgn-bttm-sm"><small>You will not receive a reply. Don't include personal information (telephone, email, SIN, financial, medical, or work details).</small></p>
85+
<p id="gc-pft-prblm-instruction" class="fnt-nrml small">Maximum 300 characters</p>
86+
<textarea id="gc-pft-prblm" aria-describedby="gc-pft-prblm-note gc-pft-prblm-instruction" name="details" class="form-control full-width" maxlength="300"></textarea>
87+
</div>
88+
<button name="helpful" value="No-Non" class="btn btn-primary">Submit</button>
89+
</div>
90+
</form>
91+
<div class="gc-pft-thnk hide">
92+
<p class="mrgn-tp-sm mrgn-bttm-0" role="status"><span class="glyphicon glyphicon-ok text-success mrgn-rght-sm" aria-hidden="true"></span> Thank you for your feedback.</p>
93+
</div>
94+
</section>
95+
</div>
96+
</div>

sites/feedback/assets/page-feedback-en.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<div data-wb-jsonmanager='{
2+
"url": "pft-test.json",
3+
"name": "service",
4+
"patches": [
5+
{ "op": "test", "path": "/isPFTActive", "value": true },
6+
{ "op": "add", "path": "/unhideme", "value": "hidden" }
7+
]
8+
}'></div>
9+
110
<div id="gc-pft" class="row wb-disable-allow" data-wb-jsonmanager='{
211
"name": "gc-pft",
312
"extractor": [
@@ -12,7 +21,10 @@
1221
{ "selector": "[data-feedback-url]", "attr": "data-feedback-url", "path": "contact/url" }
1322
]
1423
}'>
15-
<div class="col-sm-10 col-md-9 col-lg-8">
24+
<div class="col-sm-10 col-md-9 col-lg-8 hidden" data-wb-json='{
25+
"url": "#[service]/unhideme",
26+
"type": "removeclass"
27+
}'>
1628
<section class="well mrgn-bttm-0">
1729
<h3 class="wb-inv">Give feedback about this page</h3>
1830
<form action="https://feedback-retroaction.canada.ca/api/QueueProblemForm" method="post" class="wb-postback wb-disable-allow" data-wb-postback='{"success":".gc-pft-thnk"}'>

sites/feedback/assets/page-feedback-fr.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<div data-wb-jsonmanager='{
2+
"url": "pft-test.json",
3+
"name": "service",
4+
"patches": [
5+
{ "op": "test", "path": "/isPFTActive", "value": true },
6+
{ "op": "add", "path": "/unhideme", "value": "hidden" }
7+
]
8+
}'></div>
9+
110
<div id="gc-pft" class="row wb-disable-allow" data-wb-jsonmanager='{
211
"name": "gc-pft",
312
"extractor": [
@@ -12,7 +21,10 @@
1221
{ "selector": "[data-feedback-url]", "attr": "data-feedback-url", "path": "contact/url" }
1322
]
1423
}'>
15-
<div class="col-sm-10 col-md-9 col-lg-8">
24+
<div class="col-sm-10 col-md-9 col-lg-8 hidden" data-wb-json='{
25+
"url": "#[service]/unhideme",
26+
"type": "removeclass"
27+
}'>
1628
<section class="well mrgn-bttm-0">
1729
<h3 class="wb-inv">Donnez votre rétroaction sur cette page</h3>
1830
<form action="https://feedback-retroaction.canada.ca/api/QueueProblemForm" method="post" class="wb-postback wb-disable-allow" data-wb-postback='{"success":".gc-pft-thnk"}'>

sites/feedback/index.json-ld

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
"language": "fr",
4343
"path": "page-feedback-fr.html"
4444
},
45+
{
46+
"title": "Page feedback tool when end-point is down",
47+
"language": "en",
48+
"path": "page-feedback-down.html"
49+
},
4550
{
4651
"title": "Page feedback tool with contact link",
4752
"language": "en",
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
{
3+
"breadcrumbs": [
4+
{ "title": "Feedback area - Documentation", "link": "sites/feedback/feedback-docs-en.html" }
5+
],
6+
"dateModified": "2025-02-26",
7+
"description": "Page feedback tool example for Canada.ca when the server is down.",
8+
"language": "en",
9+
"title": "Page feedback tool when end-point is down",
10+
"feedback": "true",
11+
"feedbackData": {
12+
"theme": "Theme",
13+
"section": "Section"
14+
},
15+
"feedbackPath": "assets/page-feedback-down.html"
16+
}
17+
---
18+
19+
<div class="wb-prettify all-pre hide"></div>
20+
21+
<p>Note: This working example is only available in English as it is for testing purposes only. It it used to test the behaviour of the Page feedback tool when the form's end point is down.</p>
22+
23+
<p>HTML code in the web page</p>
24+
<pre><code>&lt;div class="wb-disable-allow"
25+
data-ajax-replace="https://www.canada.ca/etc/designs/canada/wet-boew/assets/feedback/page-feedback-en.html"
26+
data-feedback-section="Section"
27+
data-feedback-theme="Theme"&gt;&lt;/div&gt;</code></pre>
28+
29+
<details>
30+
<summary>Ajaxed-in content source code</summary>
31+
<p>Note: This working example page loads a local copy of the feedback form for testing purposes only. Institutions are asked to load the centralized feedback form at this web address: <code>https://www.canada.ca/etc/designs/canada/wet-boew/assets/feedback/page-feedback-en.html</code>.</p>
32+
{% highlight text %}
33+
{% include_relative assets/page-feedback-down.html %}
34+
{% endhighlight %}
35+
</details>

sites/feedback/pft-test.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"isPFTActive": true
3+
}

0 commit comments

Comments
 (0)