govuk_publishing_components 29.5.0 → 29.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +72 -73
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +11 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-click-tracking.js +49 -0
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +0 -1
  7. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +20 -6
  8. data/app/assets/javascripts/govuk_publishing_components/modules.js +0 -1
  9. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-measurer.js +28 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +11 -4
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +1 -1
  13. data/app/controllers/govuk_publishing_components/audit_controller.rb +1 -4
  14. data/app/models/govuk_publishing_components/audit_components.rb +61 -24
  15. data/app/views/govuk_publishing_components/audit/_applications.html.erb +8 -3
  16. data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +82 -0
  17. data/app/views/govuk_publishing_components/audit/_components.html.erb +2 -47
  18. data/app/views/govuk_publishing_components/component_guide/index.html.erb +2 -2
  19. data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -1
  20. data/app/views/govuk_publishing_components/components/_attachment.html.erb +1 -1
  21. data/app/views/govuk_publishing_components/components/_attachment_link.html.erb +1 -1
  22. data/app/views/govuk_publishing_components/components/_cards.html.erb +13 -11
  23. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +1 -1
  24. data/app/views/govuk_publishing_components/components/docs/document_list.yml +4 -4
  25. data/app/views/govuk_publishing_components/components/docs/heading.yml +1 -1
  26. data/app/views/govuk_publishing_components/components/docs/image_card.yml +1 -1
  27. data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +4 -4
  28. data/app/views/govuk_publishing_components/components/docs/metadata.yml +1 -1
  29. data/app/views/govuk_publishing_components/components/docs/share_links.yml +1 -1
  30. data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +1 -1
  31. data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +1 -2
  32. data/config/locales/ar.yml +1 -0
  33. data/config/locales/az.yml +1 -0
  34. data/config/locales/be.yml +1 -0
  35. data/config/locales/bg.yml +1 -0
  36. data/config/locales/bn.yml +1 -0
  37. data/config/locales/cs.yml +1 -0
  38. data/config/locales/cy.yml +1 -0
  39. data/config/locales/da.yml +1 -0
  40. data/config/locales/de.yml +1 -0
  41. data/config/locales/dr.yml +1 -0
  42. data/config/locales/el.yml +1 -0
  43. data/config/locales/en.yml +54 -3
  44. data/config/locales/es-419.yml +1 -0
  45. data/config/locales/es.yml +1 -0
  46. data/config/locales/et.yml +1 -0
  47. data/config/locales/fa.yml +1 -0
  48. data/config/locales/fi.yml +1 -0
  49. data/config/locales/fr.yml +1 -0
  50. data/config/locales/gd.yml +1 -0
  51. data/config/locales/gu.yml +1 -0
  52. data/config/locales/he.yml +1 -0
  53. data/config/locales/hi.yml +1 -0
  54. data/config/locales/hr.yml +1 -0
  55. data/config/locales/hu.yml +1 -0
  56. data/config/locales/hy.yml +1 -0
  57. data/config/locales/id.yml +1 -0
  58. data/config/locales/is.yml +1 -0
  59. data/config/locales/it.yml +1 -0
  60. data/config/locales/ja.yml +1 -0
  61. data/config/locales/ka.yml +1 -0
  62. data/config/locales/kk.yml +1 -0
  63. data/config/locales/ko.yml +1 -0
  64. data/config/locales/lt.yml +1 -0
  65. data/config/locales/lv.yml +1 -0
  66. data/config/locales/ms.yml +1 -0
  67. data/config/locales/mt.yml +1 -0
  68. data/config/locales/nl.yml +1 -0
  69. data/config/locales/no.yml +1 -0
  70. data/config/locales/pa-pk.yml +1 -0
  71. data/config/locales/pa.yml +1 -0
  72. data/config/locales/pl.yml +1 -0
  73. data/config/locales/ps.yml +1 -0
  74. data/config/locales/pt.yml +1 -0
  75. data/config/locales/ro.yml +1 -0
  76. data/config/locales/ru.yml +1 -0
  77. data/config/locales/si.yml +1 -0
  78. data/config/locales/sk.yml +1 -0
  79. data/config/locales/sl.yml +1 -0
  80. data/config/locales/so.yml +1 -0
  81. data/config/locales/sq.yml +1 -0
  82. data/config/locales/sr.yml +1 -0
  83. data/config/locales/sv.yml +1 -0
  84. data/config/locales/sw.yml +1 -0
  85. data/config/locales/ta.yml +1 -0
  86. data/config/locales/th.yml +1 -0
  87. data/config/locales/tk.yml +1 -0
  88. data/config/locales/tr.yml +1 -0
  89. data/config/locales/uk.yml +1 -0
  90. data/config/locales/ur.yml +1 -0
  91. data/config/locales/uz.yml +1 -0
  92. data/config/locales/vi.yml +1 -0
  93. data/config/locales/zh-hk.yml +1 -0
  94. data/config/locales/zh-tw.yml +1 -0
  95. data/config/locales/zh.yml +1 -0
  96. data/lib/generators/govuk_publishing_components/templates/_component.html.erb +1 -1
  97. data/lib/govuk_publishing_components/app_helpers/brand_helper.rb +1 -1
  98. data/lib/govuk_publishing_components/presenters/{attachment.rb → attachment_helper.rb} +1 -2
  99. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +18 -289
  100. data/lib/govuk_publishing_components/version.rb +1 -1
  101. data/lib/govuk_publishing_components.rb +1 -1
  102. metadata +7 -4
@@ -1,294 +1,7 @@
1
1
  module GovukPublishingComponents
2
2
  module Presenters
3
3
  class PublicLayoutHelper
4
- FOOTER_NAV = [
5
- {
6
- title: "Services and information",
7
- columns: 2,
8
- items: [
9
- {
10
- href: "/browse/benefits",
11
- text: "Benefits",
12
- attributes: {
13
- data: {
14
- track_category: "footerClicked",
15
- track_action: "footerLinks",
16
- track_label: "Benefits",
17
- },
18
- },
19
- },
20
- {
21
- href: "/browse/births-deaths-marriages",
22
- text: "Births, deaths, marriages and care",
23
- attributes: {
24
- data: {
25
- track_category: "footerClicked",
26
- track_action: "footerLinks",
27
- track_label: "Births, deaths, marriages and care",
28
- },
29
- },
30
- },
31
- {
32
- href: "/browse/business",
33
- text: "Business and self-employed",
34
- attributes: {
35
- data: {
36
- track_category: "footerClicked",
37
- track_action: "footerLinks",
38
- track_label: "Business and self-employed",
39
- },
40
- },
41
- },
42
- {
43
- href: "/browse/childcare-parenting",
44
- text: "Childcare and parenting",
45
- attributes: {
46
- data: {
47
- track_category: "footerClicked",
48
- track_action: "footerLinks",
49
- track_label: "Childcare and parenting",
50
- },
51
- },
52
- },
53
- {
54
- href: "/browse/citizenship",
55
- text: "Citizenship and living in the UK",
56
- attributes: {
57
- data: {
58
- track_category: "footerClicked",
59
- track_action: "footerLinks",
60
- track_label: "Citizenship and living in the UK",
61
- },
62
- },
63
- },
64
- {
65
- href: "/browse/justice",
66
- text: "Crime, justice and the law",
67
- attributes: {
68
- data: {
69
- track_category: "footerClicked",
70
- track_action: "footerLinks",
71
- track_label: "Crime, justice and the law",
72
- },
73
- },
74
- },
75
- {
76
- href: "/browse/disabilities",
77
- text: "Disabled people",
78
- attributes: {
79
- data: {
80
- track_category: "footerClicked",
81
- track_action: "footerLinks",
82
- track_label: "Disabled people",
83
- },
84
- },
85
- },
86
- {
87
- href: "/browse/driving",
88
- text: "Driving and transport",
89
- attributes: {
90
- data: {
91
- track_category: "footerClicked",
92
- track_action: "footerLinks",
93
- track_label: "Driving and transport",
94
- },
95
- },
96
- },
97
- {
98
- href: "/browse/education",
99
- text: "Education and learning",
100
- attributes: {
101
- data: {
102
- track_category: "footerClicked",
103
- track_action: "footerLinks",
104
- track_label: "Education and learning",
105
- },
106
- },
107
- },
108
- {
109
- href: "/browse/employing-people",
110
- text: "Employing people",
111
- attributes: {
112
- data: {
113
- track_category: "footerClicked",
114
- track_action: "footerLinks",
115
- track_label: "Employing people",
116
- },
117
- },
118
- },
119
- {
120
- href: "/browse/environment-countryside",
121
- text: "Environment and countryside",
122
- attributes: {
123
- data: {
124
- track_category: "footerClicked",
125
- track_action: "footerLinks",
126
- track_label: "Environment and countryside",
127
- },
128
- },
129
- },
130
- {
131
- href: "/browse/housing-local-services",
132
- text: "Housing and local services",
133
- attributes: {
134
- data: {
135
- track_category: "footerClicked",
136
- track_action: "footerLinks",
137
- track_label: "Housing and local services",
138
- },
139
- },
140
- },
141
- {
142
- href: "/browse/tax",
143
- text: "Money and tax",
144
- attributes: {
145
- data: {
146
- track_category: "footerClicked",
147
- track_action: "footerLinks",
148
- track_label: "Money and tax",
149
- },
150
- },
151
- },
152
- {
153
- href: "/browse/abroad",
154
- text: "Passports, travel and living abroad",
155
- attributes: {
156
- data: {
157
- track_category: "footerClicked",
158
- track_action: "footerLinks",
159
- track_label: "Passports, travel and living abroad",
160
- },
161
- },
162
- },
163
- {
164
- href: "/browse/visas-immigration",
165
- text: "Visas and immigration",
166
- attributes: {
167
- data: {
168
- track_category: "footerClicked",
169
- track_action: "footerLinks",
170
- track_label: "Visas and immigration",
171
- },
172
- },
173
- },
174
- {
175
- href: "/browse/working",
176
- text: "Working, jobs and pensions",
177
- attributes: {
178
- data: {
179
- track_category: "footerClicked",
180
- track_action: "footerLinks",
181
- track_label: "Working, jobs and pensions",
182
- },
183
- },
184
- },
185
- ],
186
- },
187
- {
188
- title: "Departments and policy",
189
- items: [
190
- {
191
- href: "/government/how-government-works",
192
- text: "How government works",
193
- attributes: {
194
- data: {
195
- track_category: "footerClicked",
196
- track_action: "footerLinks",
197
- track_label: "How government works",
198
- },
199
- },
200
- },
201
- {
202
- href: "/government/organisations",
203
- text: "Departments",
204
- attributes: {
205
- data: {
206
- track_category: "footerClicked",
207
- track_action: "footerLinks",
208
- track_label: "Departments",
209
- },
210
- },
211
- },
212
- {
213
- href: "/world",
214
- text: "Worldwide",
215
- attributes: {
216
- data: {
217
- track_category: "footerClicked",
218
- track_action: "footerLinks",
219
- track_label: "Worldwide",
220
- },
221
- },
222
- },
223
- {
224
- href: "/search/services",
225
- text: "Services",
226
- attributes: {
227
- data: {
228
- track_category: "footerClicked",
229
- track_action: "footerLinks",
230
- track_label: "Services",
231
- },
232
- },
233
- },
234
- {
235
- href: "/search/guidance-and-regulation",
236
- text: "Guidance and regulation",
237
- attributes: {
238
- data: {
239
- track_category: "footerClicked",
240
- track_action: "footerLinks",
241
- track_label: "Guidance and regulation",
242
- },
243
- },
244
- },
245
- {
246
- href: "/search/news-and-communications",
247
- text: "News and communications",
248
- attributes: {
249
- data: {
250
- track_category: "footerClicked",
251
- track_action: "footerLinks",
252
- track_label: "News and communications",
253
- },
254
- },
255
- },
256
- {
257
- href: "/search/research-and-statistics",
258
- text: "Research and statistics",
259
- attributes: {
260
- data: {
261
- track_category: "footerClicked",
262
- track_action: "footerLinks",
263
- track_label: "Research and statistics",
264
- },
265
- },
266
- },
267
- {
268
- href: "/search/policy-papers-and-consultations",
269
- text: "Policy papers and consultations",
270
- attributes: {
271
- data: {
272
- track_category: "footerClicked",
273
- track_action: "footerLinks",
274
- track_label: "Policy papers and consultations",
275
- },
276
- },
277
- },
278
- {
279
- href: "/search/transparency-and-freedom-of-information-releases",
280
- text: "Transparency and freedom of information releases",
281
- attributes: {
282
- data: {
283
- track_category: "footerClicked",
284
- track_action: "footerLinks",
285
- track_label: "Transparency and freedom of information releases",
286
- },
287
- },
288
- },
289
- ],
290
- },
291
- ].freeze
4
+ FOOTER_NAVIGATION_COLUMNS = [2, 1].freeze
292
5
 
293
6
  FOOTER_META = {
294
7
  items: [
@@ -333,7 +46,23 @@ module GovukPublishingComponents
333
46
  attr_reader :footer_navigation, :footer_meta, :cookie_banner_data
334
47
 
335
48
  def initialize(local_assigns)
336
- @footer_navigation = local_assigns[:footer_navigation] || FOOTER_NAV
49
+ @footer_navigation = local_assigns[:footer_navigation] || I18n.t("components.layout_footer.navigation_links").each_with_index.map do |menu, i|
50
+ {
51
+ title: menu[:title],
52
+ columns: FOOTER_NAVIGATION_COLUMNS[i],
53
+ items: menu[:menu_contents].map do |item|
54
+ item.merge({
55
+ attributes: {
56
+ data: {
57
+ track_category: "footerClicked",
58
+ track_action: "footerLinks",
59
+ track_label: item[:text],
60
+ },
61
+ },
62
+ })
63
+ end,
64
+ }
65
+ end
337
66
  @footer_meta = local_assigns[:footer_meta] || FOOTER_META
338
67
  @cookie_banner_data = local_assigns[:cookie_banner_data] || {}
339
68
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "29.5.0".freeze
2
+ VERSION = "29.8.0".freeze
3
3
  end
@@ -5,7 +5,7 @@ require "govuk_personalisation"
5
5
  require "govuk_publishing_components/config"
6
6
  require "govuk_publishing_components/engine"
7
7
  require "govuk_publishing_components/presenters/shared_helper"
8
- require "govuk_publishing_components/presenters/attachment"
8
+ require "govuk_publishing_components/presenters/attachment_helper"
9
9
  require "govuk_publishing_components/presenters/big_number_helper"
10
10
  require "govuk_publishing_components/presenters/breadcrumbs"
11
11
  require "govuk_publishing_components/presenters/breadcrumb_selector"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 29.5.0
4
+ version: 29.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-22 00:00:00.000000000 Z
11
+ date: 2022-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -433,6 +433,8 @@ files:
433
433
  - app/assets/javascripts/component_guide/vendor/bind-polyfill.js
434
434
  - app/assets/javascripts/component_guide/vendor/matches-polyfill.min.js
435
435
  - app/assets/javascripts/govuk_publishing_components/all_components.js
436
+ - app/assets/javascripts/govuk_publishing_components/analytics-ga4.js
437
+ - app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-click-tracking.js
436
438
  - app/assets/javascripts/govuk_publishing_components/analytics.js
437
439
  - app/assets/javascripts/govuk_publishing_components/analytics/analytics.js
438
440
  - app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js
@@ -636,6 +638,7 @@ files:
636
638
  - app/models/govuk_publishing_components/component_example.rb
637
639
  - app/models/govuk_publishing_components/shared_accessibility_criteria.rb
638
640
  - app/views/govuk_publishing_components/audit/_applications.html.erb
641
+ - app/views/govuk_publishing_components/audit/_component_contents.html.erb
639
642
  - app/views/govuk_publishing_components/audit/_components.html.erb
640
643
  - app/views/govuk_publishing_components/audit/show.html.erb
641
644
  - app/views/govuk_publishing_components/component_guide/_application_stylesheet.html.erb
@@ -899,7 +902,7 @@ files:
899
902
  - lib/govuk_publishing_components/config.rb
900
903
  - lib/govuk_publishing_components/engine.rb
901
904
  - lib/govuk_publishing_components/minitest/component_guide_test.rb
902
- - lib/govuk_publishing_components/presenters/attachment.rb
905
+ - lib/govuk_publishing_components/presenters/attachment_helper.rb
903
906
  - lib/govuk_publishing_components/presenters/big_number_helper.rb
904
907
  - lib/govuk_publishing_components/presenters/breadcrumb_selector.rb
905
908
  - lib/govuk_publishing_components/presenters/breadcrumbs.rb
@@ -1890,7 +1893,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1890
1893
  - !ruby/object:Gem::Version
1891
1894
  version: '0'
1892
1895
  requirements: []
1893
- rubygems_version: 3.3.12
1896
+ rubygems_version: 3.3.13
1894
1897
  signing_key:
1895
1898
  specification_version: 4
1896
1899
  summary: A gem to document components in GOV.UK frontend applications