govuk_publishing_components 31.1.2 → 32.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/action-link-arrow--blue.svg +8 -2
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/track-click.js +1 -1
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-ecommerce-tracker.js +10 -5
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +2 -2
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +10 -3
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +81 -73
  8. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +25 -1
  9. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +20 -11
  10. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +20 -10
  11. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +44 -39
  12. data/config/locales/en.yml +1 -1
  13. data/lib/govuk_publishing_components/version.rb +1 -1
  14. data/node_modules/axe-core/README.md +7 -6
  15. data/node_modules/axe-core/axe.d.ts +1 -0
  16. data/node_modules/axe-core/axe.js +8911 -7204
  17. data/node_modules/axe-core/axe.min.js +2 -2
  18. data/node_modules/axe-core/locales/_template.json +1067 -0
  19. data/node_modules/axe-core/locales/fr.json +1 -1
  20. data/node_modules/axe-core/locales/he.json +1015 -0
  21. data/node_modules/axe-core/locales/no_NB.json +797 -0
  22. data/node_modules/axe-core/package.json +57 -59
  23. data/node_modules/axe-core/sri-history.json +4 -0
  24. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6228168725fc509c3b6313611fb75d4700597c685bb059c58ab4058173adfee5
4
- data.tar.gz: 4ecefeead36ad35884f76edc0cb679e8449b300e08b95bf05ef9a1bd2ba9c7fe
3
+ metadata.gz: 40c8f5cd0a641b265004d0db4aa4dad79cc1f251bc6510655d69bc7fa954614f
4
+ data.tar.gz: 80b737085d4e49d8a2d5558472f918ed7632db5932d32c9945ad82d936c3a2d0
5
5
  SHA512:
6
- metadata.gz: 60b6aa5e85acf22e1bb663dc8e87d626f60ded689eb6809ec269868a4dba96bd1c41ae8766a30f8f97e27a5b56ef5044e65db4a2fee5814d150de6aa9731bd68
7
- data.tar.gz: 06a0a8bd5ca1a14ff13bb0aec9869dba18d3e0e9942d48a712befde02c6738c7b62a2ca9e300f5c3ae320a86adfe507faa74598d74a76740b9da5fbcbf898200
6
+ metadata.gz: c18a6aee8070978fd4f72f29eb7d916d8899a261c3bac0fac075703a18d5c7e7b1854fc56dc3d9ee4bfae10e1c5725aa4693f0488edac5429bb5f9b6ceed3e33
7
+ data.tar.gz: 2903283d75f095a49ebd6940cb003bc6653bf3e2e96cd990f311b3b113b1925bf042b9bc689a0f01d1f951973aee8f58fd00945e771507477e1ec69fa29eca1b
@@ -1,3 +1,9 @@
1
- <svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M11.4893 23C17.8406 23 22.9893 17.8513 22.9893 11.5C22.9893 5.14873 17.8406 0 11.4893 0C5.64643 0 0.821276 4.35747 0.0862655 10H12.7633L8.98933 5.67277L10.4482 4L16.9893 11.5L10.4482 19L8.98933 17.3272L13.6354 12H0C0.261778 18.1193 5.30558 23 11.4893 23ZM13.9893 11.5942L14.0715 11.5L13.9893 11.4057V11.5942Z" fill="#366FB3"/>
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="19.5" cy="19.5" r="19.5" fill="#366FB3" mask="url(#mask)"/>
3
+
4
+ <mask id="mask">
5
+ <rect width="100%" height="100%" fill="white"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M24.0343 20L14.1812 10.1469L17.0096 7.31848L29.6912 20L17.0096 32.6815L14.1812 29.8531L24.0343 20Z" fill="black"/>
7
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0.000423781 18L25.1328 18L25.1328 22L0.000423431 22L0.000423781 18Z" fill="black"/>
8
+ </mask>
3
9
  </svg>
@@ -19,7 +19,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
19
19
  var target = e.target
20
20
  if (!trackLinksOnly) {
21
21
  that.$module.handleClick(target)
22
- } else if (trackLinksOnly && target.tagName === 'A') {
22
+ } else if (trackLinksOnly && target.closest('a')) {
23
23
  if (!limitToElementClass) {
24
24
  that.$module.handleClick(target)
25
25
  } else if (limitToElementClass && target.closest('.' + limitToElementClass)) {
@@ -9,12 +9,17 @@
9
9
  PIIRemover: new GOVUK.analyticsGa4.PIIRemover(),
10
10
  DEFAULT_LIST_TITLE: 'Site search results',
11
11
 
12
- init: function (isNewPageLoad) {
12
+ init: function (referrer) {
13
13
  if (window.dataLayer) {
14
+ /* The referrer parameter is only passed to the init() function as a result of an AJAX request
15
+ (in live_search.js in the finder-frontend repository). Otherwise it will not be available and this indicates a fresh page load.
16
+ This is needed to trigger a fresh pageViewTracker push to the dataLayer on dynamic page updates and to prevent multiple
17
+ click listeners from being applied on this.searchResultsBlocks elements. */
18
+ var isNewPageLoad = !referrer
19
+
14
20
  /* The data-ga4-ecommerce attribute may be present on several DOM elements e.g. search results and spelling
15
21
  suggestions, hence why document.querySelectorAll is required */
16
22
  this.searchResultsBlocks = document.querySelectorAll('[data-ga4-ecommerce]')
17
- this.isNewPageLoad = isNewPageLoad
18
23
 
19
24
  if (!this.searchResultsBlocks.length === 0) {
20
25
  return
@@ -23,18 +28,18 @@
23
28
  /* If the results are updated by JS, the URL of the page will change and this needs to be visible to PA's,
24
29
  hence the pageView object push to the dataLayer. We do not need to send a pageView object on page load as
25
30
  this is handled elsewhere. */
26
- if (!this.isNewPageLoad) {
31
+ if (referrer) {
27
32
  var pageViewTracker = window.GOVUK.analyticsGa4.analyticsModules.PageViewTracker
28
33
 
29
34
  if (pageViewTracker) {
30
- pageViewTracker.init()
35
+ pageViewTracker.init(referrer)
31
36
  }
32
37
  }
33
38
 
34
39
  for (var i = 0; i < this.searchResultsBlocks.length; i++) {
35
40
  this.trackSearchResults(this.searchResultsBlocks[i])
36
41
 
37
- if (this.isNewPageLoad) {
42
+ if (isNewPageLoad) {
38
43
  this.searchResultsBlocks[i].addEventListener('click', this.handleClick.bind(this))
39
44
  }
40
45
  }
@@ -51,8 +51,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
51
51
  }
52
52
  }
53
53
 
54
- // Ensure it only tracks aria-expanded in an accordion element, instead of in any child of the clicked element
55
- if (target.closest('.gem-c-accordion')) {
54
+ /* Ensure it only tracks aria-expanded in an accordion or element with data-ga4-expandable on it. */
55
+ if (target.closest('.gem-c-accordion') || target.closest('[data-ga4-expandable]')) {
56
56
  var ariaExpanded = this.getClosestAttribute(target, 'aria-expanded')
57
57
  }
58
58
 
@@ -9,13 +9,15 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
9
9
  PIIRemover: new window.GOVUK.analyticsGa4.PIIRemover(), // imported in analytics-ga4.js
10
10
  nullValue: undefined,
11
11
 
12
- init: function () {
12
+ init: function (referrer) {
13
13
  if (window.dataLayer) {
14
14
  var data = {
15
15
  event: 'page_view',
16
16
  page_view: {
17
17
  location: this.getLocation(),
18
- referrer: this.getReferrer(),
18
+ /* If the init() function receives a referrer parameter, this indicates that it has been called as a part of an AJAX request and
19
+ this.getReferrer() will not return the correct value. Therefore we need to rely on the referrer parameter. */
20
+ referrer: referrer || this.getReferrer(),
19
21
  title: this.getTitle(),
20
22
  status_code: this.getStatusCode(),
21
23
 
@@ -42,7 +44,12 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
42
44
  political_status: this.getMetaContent('political-status'),
43
45
  primary_publishing_organisation: this.getMetaContent('primary-publishing-organisation'),
44
46
  organisations: this.getMetaContent('analytics:organisations'),
45
- world_locations: this.getMetaContent('analytics:world-locations')
47
+ world_locations: this.getMetaContent('analytics:world-locations'),
48
+
49
+ /* The existence of a referrer parameter indicates that the page has been dynamically updated via an AJAX request
50
+ and therefore we can use it to set the dynamic property appropriately. This value is used by PA's to differentiate
51
+ between fresh page loads and dynamic page updates. */
52
+ dynamic: referrer ? 'true' : 'false'
46
53
  }
47
54
  }
48
55
  window.GOVUK.analyticsGa4.core.sendData(data)
@@ -2,11 +2,20 @@
2
2
  background: govuk-colour("white");
3
3
  margin-top: govuk-spacing(6);
4
4
 
5
- @include govuk-media-query($from: tablet) {
5
+ @include govuk-media-query($from: desktop) {
6
6
  margin-top: govuk-spacing(9);
7
- border-bottom: 1px solid govuk-colour("white");
8
7
  }
9
8
 
9
+ // New design has the box flush with edges of smaller screens
10
+ // We need to compensate for `govuk-width-container` margins:
11
+ @include govuk-media-query($until: tablet) {
12
+ margin-right: govuk-spacing(-3);
13
+ margin-left: govuk-spacing(-3);
14
+ }
15
+ @include govuk-media-query($from: tablet, $until: desktop) {
16
+ margin-right: govuk-spacing(-6);
17
+ margin-left: govuk-spacing(-6);
18
+ }
10
19
  // Scoped to the feedback component temporarily
11
20
  [hidden] {
12
21
  // stylelint-disable-next-line declaration-no-important
@@ -14,92 +23,88 @@
14
23
  }
15
24
  }
16
25
 
17
- .gem-c-feedback__prompt-questions {
18
- text-align: center;
19
- border-bottom: 1px solid govuk-colour("white");
20
- padding: govuk-spacing(5) govuk-spacing(5) govuk-spacing(5) govuk-spacing(5);
21
- box-sizing: border-box;
26
+ .gem-c-feedback__prompt {
27
+ background-color: govuk-colour("light-grey");
28
+ color: govuk-colour("black");
29
+ border-top: 1px solid $govuk-border-colour;
30
+ outline: 0;
31
+ }
22
32
 
33
+ .gem-c-feedback__prompt-content {
34
+ display: flex;
35
+ flex-direction: column;
36
+ padding: 0 govuk-spacing(3);
23
37
  @include govuk-media-query($from: tablet) {
24
- width: 50%;
25
- display: table-cell;
26
- text-align: left;
27
- border-bottom: 0;
38
+ flex-direction: row;
39
+ align-items: center;
40
+ justify-content: space-between;
28
41
  }
29
42
  }
30
43
 
31
- .gem-c-feedback__prompt-questions--something-is-wrong {
32
- text-align: center;
33
-
44
+ .gem-c-feedback__prompt-questions {
45
+ text-align: left;
46
+ padding: govuk-spacing(4) 0;
34
47
  @include govuk-media-query($from: tablet) {
35
- text-align: right;
36
- vertical-align: bottom;
37
- float: none;
48
+ margin: 0 govuk-spacing(3);
38
49
  }
39
50
  }
40
51
 
41
- .gem-c-feedback__prompt {
42
- @include govuk-clearfix;
43
- background-color: govuk-colour("blue");
44
- color: govuk-colour("white");
45
- outline: 0;
46
-
52
+ .gem-c-feedback__prompt-questions--something-is-wrong {
53
+ border-top: 1px solid $govuk-border-colour;
47
54
  @include govuk-media-query($from: tablet) {
48
- @include govuk-font(16, $weight: bold);
49
- display: table;
50
- width: 100%;
55
+ border: 0;
56
+ }
57
+ }
58
+
59
+ .gem-c-feedback__prompt-question-answer {
60
+ display: flex;
61
+ align-items: center;
62
+ @include govuk-media-query($until: mobile) {
63
+ justify-content: center;
64
+ flex-wrap: wrap;
51
65
  }
52
66
  }
53
67
 
54
68
  .gem-c-feedback__prompt-question,
55
69
  .gem-c-feedback__prompt-success {
56
70
  @include govuk-font(19, $weight: bold);
57
-
58
71
  @include govuk-media-query($from: tablet) {
59
72
  @include govuk-font(16, $weight: bold);
60
73
  }
61
74
  }
62
75
 
63
76
  .gem-c-feedback__prompt-question {
64
- vertical-align: top;
65
- display: inline-block;
66
- margin: govuk-spacing(2) govuk-spacing(4);
77
+ margin: 0;
78
+ padding-bottom: govuk-spacing(2);
67
79
 
68
80
  &:focus {
69
81
  outline: 0;
70
82
  }
71
-
72
- @include govuk-media-query($from: tablet) {
73
- margin-left: 0;
74
- margin-top: 0;
75
- display: block;
76
- }
77
-
78
- // This custom media-query is to account for some awkward positioning where the yes and no buttons are too big to sit inline with the prompt question
79
- @include govuk-media-query($from: 950px) {
80
- display: inline-block;
81
- margin-top: govuk-spacing(2);
83
+ @include govuk-media-query($from: mobile) {
84
+ padding-bottom: 0;
85
+ margin-right: govuk-spacing(2);
82
86
  }
83
87
  }
84
88
 
85
89
  .gem-c-feedback__prompt-link {
86
90
  @include govuk-font(19);
87
91
  background: transparent;
88
- box-shadow: 0 2px 0 govuk-colour("white");
89
- border: 1px govuk-colour("white") solid;
90
- min-width: 100%;
92
+ color: govuk-colour("black");
93
+ box-shadow: 0 3px 0 govuk-colour("black");
94
+ border: 1px govuk-colour("black") solid;
95
+ margin-bottom: 0;
96
+ width: 100%;
91
97
 
92
98
  &:hover {
93
99
  // backup style for browsers that don't support rgba
94
- background: govuk-colour("black");
100
+ background: govuk-colour("mid-grey");
95
101
  background: rgba(govuk-colour("black"), .2);
102
+ color: govuk-colour("black");
96
103
  }
97
104
 
98
- @include govuk-media-query($from: mobile) {
99
- min-width: 100px;
100
- margin-bottom: 0;
105
+ &:active:focus:not(:hover) {
106
+ background: govuk-colour("yellow");
101
107
  }
102
-
103
108
  @include govuk-media-query($from: tablet) {
104
109
  @include govuk-font(16);
105
110
  }
@@ -108,42 +113,44 @@
108
113
  .gem-c-feedback__email-link,
109
114
  .gem-c-feedback__prompt-link {
110
115
  position: relative;
116
+
117
+ &:focus:not(:active):not(:hover) {
118
+ border-color: govuk-colour("black");
119
+ }
120
+
121
+ &:focus,
122
+ &:active {
123
+ color: $govuk-focus-text-colour;
124
+ }
111
125
  }
112
126
 
113
127
  .gem-c-feedback__prompt-link:link,
114
128
  .gem-c-feedback__prompt-link:visited {
115
- color: govuk-colour("white");
129
+ color: govuk-colour("black");
116
130
 
117
- &:focus {
131
+ &:focus,
132
+ &:active {
118
133
  color: $govuk-focus-text-colour;
119
134
  }
120
135
  }
121
136
 
122
137
  .gem-c-feedback__option-list {
138
+ display: flex;
123
139
  list-style-type: none;
124
140
  margin: 0;
125
141
  padding: 0;
126
- margin-top: govuk-spacing(2);
127
-
128
- @include govuk-media-query($from: mobile) {
129
- display: inline-block;
130
- margin-right: govuk-spacing(2);
131
- }
132
-
133
- @include govuk-media-query($from: tablet) {
134
- margin-top: 0;
135
- }
136
142
  }
137
143
 
138
144
  .gem-c-feedback__option-list-item {
139
- @include govuk-media-query($from: mobile) {
140
- display: inline-block;
145
+ &:last-child {
146
+ margin-left: govuk-spacing(2);
141
147
  }
142
148
  }
143
149
 
144
- .gem-c-feedback__option-list-item:last-child {
145
- @include govuk-media-query($from: mobile) {
146
- margin-left: govuk-spacing(4);
150
+ .gem-c-feedback__option-list-item .gem-c-feedback__prompt-link {
151
+ min-width: 100px;
152
+ @include govuk-media-query($until: desktop) {
153
+ min-width: 80px;
147
154
  }
148
155
  }
149
156
 
@@ -158,7 +165,7 @@
158
165
  outline: solid 3px $govuk-focus-colour;
159
166
  }
160
167
 
161
- @include govuk-media-query($from: tablet) {
168
+ @include govuk-media-query($from: desktop) {
162
169
  border-width: $govuk-border-width;
163
170
  }
164
171
 
@@ -190,11 +197,11 @@
190
197
  }
191
198
 
192
199
  .gem-c-feedback__form {
193
- padding: govuk-spacing(3) 0;
194
- border-top: govuk-spacing(2) solid govuk-colour("blue");
200
+ padding: govuk-spacing(3);
201
+ border-top: 1px solid $govuk-border-colour;
195
202
 
196
203
  @include govuk-media-query($from: tablet) {
197
- padding: govuk-spacing(6) 0;
204
+ padding: govuk-spacing(6);
198
205
  }
199
206
  }
200
207
 
@@ -217,8 +224,10 @@
217
224
  }
218
225
 
219
226
  .gem-c-feedback__close {
220
- float: right;
221
- margin: 0 govuk-spacing(1) govuk-spacing(2) 0;
227
+ margin: 0 govuk-spacing(2);
228
+ @include govuk-media-query($until: tablet) {
229
+ margin: govuk-spacing(4) 0 0;
230
+ }
222
231
  }
223
232
 
224
233
  .gem-c-feedback__email-link {
@@ -228,7 +237,6 @@
228
237
  @include govuk-media-query($from: desktop) {
229
238
  display: inline-block;
230
239
  margin-top: govuk-spacing(2);
231
- margin-left: govuk-spacing(3);
232
240
  }
233
241
  }
234
242
 
@@ -15,7 +15,7 @@
15
15
  hide_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "navigation")
16
16
  show_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "navigation")
17
17
  %>
18
- <header role="banner" class="gem-c-layout-super-navigation-header" data-module="gem-track-click" data-track-links-only>
18
+ <header role="banner" class="gem-c-layout-super-navigation-header" data-module="gem-track-click ga4-event-tracker" data-track-links-only data-ga4-expandable>
19
19
  <div class="gem-c-layout-super-navigation-header__container govuk-width-container govuk-clearfix">
20
20
  <div class="gem-c-layout-super-navigation-header__header-logo">
21
21
  <a
@@ -78,6 +78,14 @@
78
78
  hidden
79
79
  id="super-navigation-menu-toggle"
80
80
  type="button"
81
+ data-ga4="<%= {
82
+ "event_name": "select_content",
83
+ "type": "header menu bar",
84
+ "text": "Menu",
85
+ "index": 1,
86
+ "index_total": navigation_links.length + 2,
87
+ "section": "Menu"
88
+ }.to_json %>"
81
89
  >
82
90
  <span class="gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner">
83
91
  Menu
@@ -124,6 +132,14 @@
124
132
  toggle_desktop_group: "top",
125
133
  toggle_mobile_group: "second",
126
134
  tracking_key: tracking_label,
135
+ ga4: {
136
+ event_name: "select_content",
137
+ type: "header menu bar",
138
+ text: link[:label],
139
+ index: index + 2,
140
+ index_total: navigation_links.length + 2,
141
+ section: link[:label]
142
+ }
127
143
  },
128
144
  hidden: true,
129
145
  id: "super-navigation-menu__section-#{unique_id}-toggle",
@@ -217,6 +233,14 @@
217
233
  hidden
218
234
  id="super-search-menu-toggle"
219
235
  type="button"
236
+ data-ga4="<%= {
237
+ "event_name": "select_content",
238
+ "type": "header menu bar",
239
+ "text": "Search",
240
+ "index": navigation_links.length + 2,
241
+ "index_total": navigation_links.length + 2,
242
+ "section": "Search"
243
+ }.to_json %>"
220
244
  >
221
245
  <span class="govuk-visually-hidden">
222
246
  <%= search_text %>
@@ -5,14 +5,6 @@
5
5
  data-track-action="GOV.UK Send Form"
6
6
  method="post"
7
7
  hidden>
8
- <button
9
- class="govuk-button govuk-button--secondary gem-c-feedback__close gem-c-feedback__js-show js-close-form"
10
- data-track-category="Onsite Feedback"
11
- data-track-action="GOV.UK Close Form"
12
- aria-controls="something-is-wrong"
13
- aria-expanded="true">
14
- <%= t("components.feedback.close") %>
15
- </button>
16
8
 
17
9
  <div class="govuk-grid-row">
18
10
  <div class="govuk-grid-column-two-thirds">
@@ -47,15 +39,32 @@
47
39
  } %>
48
40
 
49
41
  <%= render "govuk_publishing_components/components/button", {
50
- text: t("components.feedback.send")
42
+ text: t("components.feedback.send"),
43
+ data_attributes: {
44
+ ga4: {
45
+ event_name: "form_submit",
46
+ type: "feedback",
47
+ text: "Send",
48
+ section: "Help us improve GOV.UK",
49
+ }
50
+ }
51
51
  } %>
52
+
53
+ <button
54
+ class="govuk-button govuk-button--secondary gem-c-feedback__close gem-c-feedback__js-show js-close-form"
55
+ data-track-category="Onsite Feedback"
56
+ data-track-action="GOV.UK Close Form"
57
+ aria-controls="something-is-wrong"
58
+ aria-expanded="true">
59
+ <%= t("components.feedback.close") %>
60
+ </button>
52
61
  </div>
53
62
  </div>
54
63
  </form>
55
64
 
56
65
  <%
57
- # I've added the following script inline in case of a scenario where a bot is able to parse the page,
58
- # without downloading any of the external scripts.
66
+ # I've added the following script inline in case of a scenario where a bot is able to parse the page,
67
+ # without downloading any of the external scripts.
59
68
  # This seems to be a more reliable way to make sure the script is executed.
60
69
  %>
61
70
 
@@ -4,15 +4,6 @@
4
4
  data-track-category="yesNoFeedbackForm"
5
5
  data-track-action="Send Form"
6
6
  method="post">
7
- <button
8
- class="govuk-button govuk-button--secondary gem-c-feedback__close js-close-form"
9
- data-track-category="yesNoFeedbackForm"
10
- data-track-action="ffFormClose"
11
- aria-controls="page-is-not-useful"
12
- aria-expanded="true"
13
- hidden>
14
- <%= t("components.feedback.close") %>
15
- </button>
16
7
 
17
8
  <div class="govuk-grid-row">
18
9
  <div class="govuk-grid-column-two-thirds" id="survey-wrapper">
@@ -34,9 +25,28 @@
34
25
  describedby: "survey_explanation"
35
26
  } %>
36
27
 
37
- <%= render "govuk_publishing_components/components/button", {
28
+ <%= render "govuk_publishing_components/components/button", {
38
29
  text: t("components.feedback.send_me_survey"),
30
+ data_attributes: {
31
+ ga4: {
32
+ event_name: "form_submit",
33
+ type: "feedback",
34
+ text: "Send me the survey",
35
+ section: "Help us improve GOV.UK",
36
+ }
37
+ }
39
38
  } %>
39
+
40
+ <button
41
+ class="govuk-button govuk-button--secondary gem-c-feedback__close js-close-form"
42
+ data-track-category="yesNoFeedbackForm"
43
+ data-track-action="ffFormClose"
44
+ aria-controls="page-is-not-useful"
45
+ aria-expanded="true"
46
+ hidden>
47
+ <%= t("components.feedback.close") %>
48
+ </button>
49
+
40
50
  </div>
41
51
  </div>
42
52
  </form>
@@ -1,42 +1,47 @@
1
1
  <div class="gem-c-feedback__prompt gem-c-feedback__js-show js-prompt" tabindex="-1">
2
- <div class="gem-c-feedback__prompt-questions js-prompt-questions" hidden>
3
- <h2 class="gem-c-feedback__prompt-question"><%= t("components.feedback.is_this_page_useful") %></h2>
4
-
5
- <ul class="gem-c-feedback__option-list">
6
- <li class="gem-c-feedback__option-list-item govuk-visually-hidden" style="display: none" hidden>
7
- <% # Maybe button exists only to try and capture clicks by bots %>
8
- <%= link_to "/contact/govuk", {
9
- class: 'gem-c-feedback__prompt-link',
10
- data: {
11
- 'track-category' => 'yesNoFeedbackForm',
12
- 'track-action' => 'ffMaybeClick'
13
- },
14
- role: 'button',
15
- style: 'display: none',
16
- hidden: 'hidden',
17
- 'aria-hidden': 'true',
18
- } do %>
19
- <%= t("components.feedback.maybe") %>
20
- <% end %>
21
- </li>
22
- <li class="gem-c-feedback__option-list-item">
23
- <button class="govuk-button gem-c-feedback__prompt-link js-page-is-useful" data-track-category="yesNoFeedbackForm" data-track-action="ffYesClick" data-ga4='{"event_name":"form_submit","type":"feedback","text":"Yes", "section": "Is this page useful?"}'>
24
- <%= t("components.feedback.yes") %> <span class="govuk-visually-hidden"><%= t("components.feedback.is_useful") %></span>
25
- </button>
26
- </li>
27
- <li class="gem-c-feedback__option-list-item">
28
- <button class="govuk-button gem-c-feedback__prompt-link js-toggle-form js-page-is-not-useful" data-track-category="yesNoFeedbackForm" data-track-action="ffNoClick" aria-controls="page-is-not-useful" aria-expanded="false" data-ga4='{"event_name":"form_submit","type":"feedback","text":"No", "section": "Is this page useful?"}'>
29
- <%= t("components.feedback.no") %> <span class="govuk-visually-hidden"><%= t("components.feedback.is_not_useful") %></span>
30
- </button>
31
- </li>
32
- </ul>
33
- </div>
34
- <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-success js-prompt-success" role="alert" hidden>
35
- <%= t("components.feedback.thank_you_for_feedback") %>
36
- </div>
37
- <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-questions--something-is-wrong js-prompt-questions" hidden>
38
- <button class="govuk-button gem-c-feedback__prompt-link js-toggle-form js-something-is-wrong" data-track-category="Onsite Feedback" data-track-action="GOV-UK Open Form" aria-controls="something-is-wrong" aria-expanded="false">
39
- <%= t("components.feedback.something_wrong") %>
40
- </button>
2
+ <div class="gem-c-feedback__prompt-content">
3
+ <div class="gem-c-feedback__prompt-questions js-prompt-questions" hidden>
4
+ <div class="gem-c-feedback__prompt-question-answer">
5
+ <h2 class="gem-c-feedback__prompt-question"><%= t("components.feedback.is_this_page_useful") %></h2>
6
+ <ul class="gem-c-feedback__option-list">
7
+ <li class="gem-c-feedback__option-list-item govuk-visually-hidden" style="display: none" hidden>
8
+ <% # Maybe button exists only to try and capture clicks by bots %>
9
+ <%= link_to "/contact/govuk", {
10
+ class: 'gem-c-feedback__prompt-link',
11
+ data: {
12
+ 'track-category' => 'yesNoFeedbackForm',
13
+ 'track-action' => 'ffMaybeClick'
14
+ },
15
+ role: 'button',
16
+ style: 'display: none',
17
+ hidden: 'hidden',
18
+ 'aria-hidden': 'true',
19
+ } do %>
20
+ <%= t("components.feedback.maybe") %>
21
+ <% end %>
22
+ </li>
23
+ <li class="gem-c-feedback__option-list-item">
24
+ <button class="govuk-button gem-c-feedback__prompt-link js-page-is-useful" data-track-category="yesNoFeedbackForm" data-track-action="ffYesClick" data-ga4='{"event_name":"form_submit","type":"feedback","text":"Yes", "section": "Is this page useful?"}'>
25
+ <%= t("components.feedback.yes") %> <span class="govuk-visually-hidden"><%= t("components.feedback.is_useful") %></span>
26
+ </button>
27
+ </li>
28
+ <li class="gem-c-feedback__option-list-item">
29
+ <button class="govuk-button gem-c-feedback__prompt-link js-toggle-form js-page-is-not-useful" data-track-category="yesNoFeedbackForm" data-track-action="ffNoClick" aria-controls="page-is-not-useful" aria-expanded="false" data-ga4='{"event_name":"form_submit","type":"feedback","text":"No", "section": "Is this page useful?"}'>
30
+ <%= t("components.feedback.no") %> <span class="govuk-visually-hidden"><%= t("components.feedback.is_not_useful") %></span>
31
+ </button>
32
+ </li>
33
+ </ul>
34
+ </div>
35
+ </div>
36
+
37
+ <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-success js-prompt-success" role="alert" hidden>
38
+ <%= t("components.feedback.thank_you_for_feedback") %>
39
+ </div>
40
+
41
+ <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-questions--something-is-wrong js-prompt-questions" hidden>
42
+ <button class="govuk-button gem-c-feedback__prompt-link js-toggle-form js-something-is-wrong" data-track-category="Onsite Feedback" data-track-action="GOV-UK Open Form" aria-controls="something-is-wrong" aria-expanded="false" data-ga4='{"event_name":"form_submit","type":"feedback","text":"Report a problem with this page", "section": "Is this page useful?"}'>
43
+ <%= t("components.feedback.something_wrong") %>
44
+ </button>
45
+ </div>
41
46
  </div>
42
47
  </div>
@@ -61,7 +61,7 @@ en:
61
61
  publication: Publication for %{nation}
62
62
  wales: Wales
63
63
  feedback:
64
- close: Close
64
+ close: Cancel
65
65
  dont_include_personal_info: Don’t include personal or financial information like your National Insurance number or credit card details.
66
66
  email_address: Email address
67
67
  help_us_improve_govuk: Help us improve GOV.UK
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "31.1.2".freeze
2
+ VERSION = "32.0.0".freeze
3
3
  end