govuk_publishing_components 25.5.0 → 27.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/track-click.js +9 -3
  3. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +3 -7
  4. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_devolved-nations.scss +10 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +2 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +4 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +1 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +22 -24
  10. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +1 -0
  11. data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +23 -0
  12. data/app/views/govuk_publishing_components/components/_document_list.html.erb +1 -1
  13. data/app/views/govuk_publishing_components/components/_image_card.html.erb +14 -10
  14. data/app/views/govuk_publishing_components/components/docs/devolved_nations.yml +81 -0
  15. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +11 -0
  16. data/app/views/govuk_publishing_components/components/docs/image_card.yml +28 -12
  17. data/app/views/govuk_publishing_components/components/layout_for_public/_account-feedback-footer.html.erb +1 -1
  18. data/app/views/govuk_publishing_components/components/layout_for_public/_account-layout.html.erb +1 -1
  19. data/app/views/govuk_publishing_components/components/layout_for_public/_account-navigation.html.erb +3 -3
  20. data/config/locales/en.yml +6 -0
  21. data/lib/govuk_publishing_components/presenters/devolved_nations_helper.rb +27 -0
  22. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +5 -5
  23. data/lib/govuk_publishing_components/version.rb +1 -1
  24. data/lib/govuk_publishing_components.rb +2 -0
  25. metadata +24 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75bbe4fa0f6a066c890631953c88c20877539ad38d4d3c5bd643d58fb67448e4
4
- data.tar.gz: 14d822a1adb2e3f6ad935f922e7175a4fd2f6cfd01f3c9e1a96df442924e8f4e
3
+ metadata.gz: 57832f873fbcb6c9c245858ca1626b8fe4548ee312a96597e0e2ef06ce776ddd
4
+ data.tar.gz: ca662dd2ac3a84e232942628613a5e2f36aeab7a5b6b21f4227d727d514ab0ed
5
5
  SHA512:
6
- metadata.gz: ec49f4d9fbd7d37c802e1d7ac7e39559d4c7861483355225d9bde8d0df83b2656e77c07e3520ea52a09de678447eb3f1255dd3e3a96ddf33b07e46575058a7d5
7
- data.tar.gz: 42721bc8eedaf12aee5c82a673201e4fb6bb4ef1d103a0a683a398b0a77e53d323ab0ba49ab21ef1dce9960b4148e10395c580f52652cd9315ab0762e1393b57
6
+ metadata.gz: 73096c4cec16fc95e026911ae54503935ca718b7f0935892412c299f1ed1f5ae7b78db6e555c0256a326126db75673a4027a62840d584bdf185c67bf3c13fda9
7
+ data.tar.gz: b482b8fa029539c6c7bc1f196165f75c1d48d8891188cd2fff978b7fdee96cff9a8c74b74736acaa1092caba2a1469b0bbb05743e7dbce567eff433f42fddc60
@@ -10,14 +10,20 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
10
10
  this.$module = $module[0]
11
11
  this.$module.handleClick = this.handleClick.bind(this)
12
12
  var trackLinksOnly = this.$module.hasAttribute('data-track-links-only')
13
+ var limitToElementClass = this.$module.getAttribute('data-limit-to-element-class')
13
14
 
14
15
  var that = this
15
16
  // add a listener to the whole element
16
17
  this.$module.addEventListener('click', function (e) {
18
+ var target = e.target
17
19
  if (!trackLinksOnly) {
18
- that.$module.handleClick(e.target)
19
- } else if (trackLinksOnly && e.target.tagName === 'A') {
20
- that.$module.handleClick(e.target)
20
+ that.$module.handleClick(target)
21
+ } else if (trackLinksOnly && target.tagName === 'A') {
22
+ if (!limitToElementClass) {
23
+ that.$module.handleClick(target)
24
+ } else if (limitToElementClass && target.closest('.' + limitToElementClass)) {
25
+ that.$module.handleClick(target)
26
+ }
21
27
  }
22
28
  })
23
29
  }
@@ -155,10 +155,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
155
155
  }
156
156
 
157
157
  this.$module.style.marginBottom = '0'
158
-
159
- window.removeEventListener('resize', this.resizeHandler, { passive: true })
160
-
161
- this.lastWindowSize = this.windowSize()
162
158
  }
163
159
 
164
160
  // Hide the navigation toggle button and show the navigation submenu:
@@ -166,10 +162,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
166
162
  this.$navigationToggle.setAttribute('hidden', 'hidden')
167
163
  this.$navigationMenu.removeAttribute('hidden')
168
164
 
169
- window.addEventListener('resize', this.resizeHandler, { passive: true })
170
-
171
- this.lastWindowSize = this.windowSize()
165
+ this.resizeHandler()
172
166
  }
167
+
168
+ this.lastWindowSize = this.windowSize()
173
169
  }
174
170
 
175
171
  SuperNavigationMegaMenu.prototype.buttonHandler = function (event) {
@@ -27,6 +27,7 @@ $govuk-new-link-styles: true;
27
27
  @import "components/copy-to-clipboard";
28
28
  @import "components/date-input";
29
29
  @import "components/details";
30
+ @import "components/devolved-nations";
30
31
  @import "components/document-list";
31
32
  @import "components/error-alert";
32
33
  @import "components/error-message";
@@ -0,0 +1,10 @@
1
+ .gem-c-devolved-nations {
2
+ background: govuk-colour("light-grey");
3
+ margin-bottom: govuk-spacing(3);
4
+ padding: govuk-spacing(3);
5
+
6
+ @include govuk-media-query($from: desktop) {
7
+ margin-bottom: govuk-spacing(8);
8
+ padding: govuk-spacing(4) govuk-spacing(6);
9
+ }
10
+ }
@@ -107,6 +107,8 @@
107
107
 
108
108
  .gem-c-document-list__children {
109
109
  margin-bottom: 0;
110
+ padding-left: 0;
111
+ list-style-type: none;
110
112
 
111
113
  @include govuk-media-query($from: desktop) {
112
114
  margin-left: govuk-spacing(4);
@@ -127,6 +127,10 @@
127
127
  margin-bottom: govuk-spacing(1);
128
128
  }
129
129
 
130
+ .gem-c-image-card__list-item--text {
131
+ color: govuk-colour("dark-grey", $legacy: "grey-1");
132
+ }
133
+
130
134
  .gem-c-image-card__list-item-link {
131
135
  line-height: 1.35em;
132
136
  }
@@ -9,6 +9,7 @@
9
9
 
10
10
  .js-enabled .gem-c-layout-for-public__global-banner-wrapper {
11
11
  margin-top: - govuk-spacing(2);
12
+ min-height: govuk-spacing(2);
12
13
  position: relative;
13
14
  }
14
15
 
@@ -269,7 +269,11 @@ $search-icon-size: 20px;
269
269
  color: $govuk-link-colour;
270
270
 
271
271
  &:hover {
272
- color: govuk-colour("mid-grey");
272
+ color: $govuk-link-hover-colour;
273
+
274
+ @include govuk-media-query($from: "desktop") {
275
+ color: govuk-colour("mid-grey");
276
+ }
273
277
  }
274
278
 
275
279
  &:focus {
@@ -358,6 +362,10 @@ $search-icon-size: 20px;
358
362
  position: absolute;
359
363
  right: 45px;
360
364
 
365
+ &.gem-c-layout-super-navigation-header__open-button {
366
+ border-top-color: govuk-colour("black");
367
+ }
368
+
361
369
  @include govuk-media-query($from: 360px) {
362
370
  &:before {
363
371
  @include chevron("white");
@@ -388,8 +396,19 @@ $search-icon-size: 20px;
388
396
  position: absolute;
389
397
  right: (0 - govuk-spacing(3));
390
398
 
391
- &:hover {
392
- border-color: govuk-colour("black");
399
+ &:after {
400
+ background-color: $govuk-link-colour;
401
+ content: " ";
402
+ left: 0;
403
+ right: 0;
404
+ }
405
+
406
+ &:not(.gem-c-layout-super-navigation-header__open-button):focus {
407
+ &:hover,
408
+ &:after {
409
+ background-color: $govuk-focus-colour;
410
+ border-top-color: $govuk-focus-colour;
411
+ }
393
412
  }
394
413
 
395
414
  @include govuk-media-query($from: 360px) {
@@ -405,22 +424,6 @@ $search-icon-size: 20px;
405
424
  position: relative;
406
425
  float: right;
407
426
 
408
- &:not(.gem-c-layout-super-navigation-header__open-button):hover {
409
- background: none;
410
- color: govuk-colour("light-grey");
411
-
412
- &:after {
413
- content: " ";
414
- left: 0;
415
- right: 0;
416
- }
417
- }
418
-
419
- &:focus:hover:after,
420
- &:after {
421
- content: none;
422
- }
423
-
424
427
  &.gem-c-layout-super-navigation-header__open-button {
425
428
  border-top-color: govuk-colour("black");
426
429
 
@@ -486,7 +489,6 @@ $search-icon-size: 20px;
486
489
 
487
490
  &:focus {
488
491
  color: $govuk-focus-text-colour;
489
- // border-color: $govuk-focus-text-colour;
490
492
 
491
493
  &:after {
492
494
  background-color: $govuk-focus-text-colour;
@@ -501,10 +503,6 @@ $search-icon-size: 20px;
501
503
  &.gem-c-layout-super-navigation-header__open-button {
502
504
  border-top-color: govuk-colour("black");
503
505
 
504
- &:focus {
505
- border-top-color: $govuk-focus-colour;
506
- }
507
-
508
506
  &:before {
509
507
  transform: translateY(20%) rotate(225deg);
510
508
  }
@@ -17,6 +17,7 @@
17
17
  clear: both;
18
18
  overflow: hidden;
19
19
  padding: govuk-spacing(2) 0 0;
20
+ margin: 0;
20
21
 
21
22
  img {
22
23
  display: inline;
@@ -0,0 +1,23 @@
1
+ <%
2
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
3
+ devolved_nations_helper = GovukPublishingComponents::Presenters::DevolvedNationsHelper.new(local_assigns)
4
+
5
+ applies_to ||= t('components.devolved_nations.applies_to')
6
+ heading_level ||= 2
7
+ %>
8
+
9
+ <% if national_applicability.any? { |k,v| v[:applicable] == true } %>
10
+ <%= tag.section class: "gem-c-devolved-nations" do %>
11
+ <%= content_tag(shared_helper.get_heading_level, class: "govuk-heading-s govuk-!-margin-bottom-0") do %>
12
+ <%= applies_to %> <%= devolved_nations_helper.applicable_nations_title_text %>
13
+ <% end %>
14
+
15
+ <% if devolved_nations_helper.nations_with_urls.any? %>
16
+ <%= content_tag :ul, class: "govuk-list govuk-!-margin-top-1 govuk-!-margin-bottom-0" do -%>
17
+ <% devolved_nations_helper.nations_with_urls.each do |k, v| %>
18
+ <%= content_tag(:li, link_to("Guidance for #{t("components.devolved_nations.#{k}")}", v[:alternative_url], class: "govuk-link")) %>
19
+ <% end %>
20
+ <% end %>
21
+ <% end %>
22
+ <% end %>
23
+ <% end %>
@@ -92,7 +92,7 @@
92
92
  <% end %>
93
93
 
94
94
  <% if item[:parts] && item[:parts].any? %>
95
- <ul class="gem-c-document-list__children govuk-list">
95
+ <ul class="gem-c-document-list__children">
96
96
  <% item[:parts].each do |part| %>
97
97
  <li class="gem-c-document-list-child">
98
98
  <%=
@@ -23,7 +23,7 @@
23
23
  extra_link_classes << brand_helper.color_class
24
24
 
25
25
  %>
26
- <% if card_helper.href || card_helper.extra_links.any? %>
26
+ <% if card_helper.href || card_helper.extra_details.any? %>
27
27
  <div class="<%= classes %> <%= brand_helper.brand_class %>"
28
28
  <%= "data-module=gem-track-click" if card_helper.is_tracking? %>
29
29
  <%= "lang=#{card_helper.lang}" if card_helper.lang %>>
@@ -44,15 +44,19 @@
44
44
  <%= card_helper.context %>
45
45
  </div>
46
46
  <%= card_helper.description %>
47
- <% if card_helper.extra_links.any? %>
48
- <ul class="gem-c-image-card__list <%= "gem-c-image-card__list--indented" if not card_helper.extra_links_no_indent %>">
49
- <% card_helper.extra_links.each do |link| %>
50
- <li class="gem-c-image-card__list-item">
51
- <%= link_to link[:text], link[:href],
52
- class: extra_link_classes,
53
- data: link[:data_attributes]
54
- %>
55
- </li>
47
+ <% if card_helper.extra_details.any? %>
48
+ <ul class="gem-c-image-card__list <%= "gem-c-image-card__list--indented" if not card_helper.extra_details_no_indent %>">
49
+ <% card_helper.extra_details.each do |link| %>
50
+ <li class="gem-c-image-card__list-item <%= "gem-c-image-card__list-item--text" if not link[:href].present? %>">
51
+ <% if link[:href].present? %>
52
+ <%= link_to link[:text], link[:href],
53
+ class: extra_link_classes,
54
+ data: link[:data_attributes]
55
+ %>
56
+ <% else %>
57
+ <%= link[:text] %>
58
+ <% end %>
59
+ </li>
56
60
  <% end %>
57
61
  </ul>
58
62
  <% end %>
@@ -0,0 +1,81 @@
1
+ name: Devolved Nations (experimental)
2
+ description: A banner for linking to guidance for other nations.
3
+ body: |
4
+ The component replaces uses of the important metadata component for guidance for other nations.
5
+
6
+ The component can display:
7
+
8
+ * nations that the guidance relates to
9
+ * a list of alternative URLs where applicable
10
+ shared_accessibility_criteria:
11
+ - link
12
+ accessibility_criteria: |
13
+ The component must:
14
+
15
+ - Provide context for link text to highlight guidance is available.
16
+ examples:
17
+ default:
18
+ data:
19
+ national_applicability:
20
+ england:
21
+ applicable: true
22
+ applies_to_two_nations:
23
+ data:
24
+ national_applicability:
25
+ england:
26
+ applicable: true
27
+ wales:
28
+ applicable: true
29
+ applies_to_three_nations:
30
+ data:
31
+ national_applicability:
32
+ england:
33
+ applicable: true
34
+ scotland:
35
+ applicable: true
36
+ wales:
37
+ applicable: true
38
+ applies_to_one_nation_individual_guidance_available:
39
+ data:
40
+ national_applicability:
41
+ england:
42
+ applicable: true
43
+ scotland:
44
+ applicable: false
45
+ alternative_url: /
46
+ wales:
47
+ applicable: false
48
+ alternative_url: /
49
+ applies_to_one_nation_individual_guidance_available:
50
+ data:
51
+ national_applicability:
52
+ england:
53
+ applicable: true
54
+ northern_ireland:
55
+ applicable: false
56
+ alternative_url: /
57
+ scotland:
58
+ applicable: false
59
+ alternative_url: /
60
+ wales:
61
+ applicable: false
62
+ alternative_url: /
63
+ applies_to_three_nations_individual_guidance_available:
64
+ data:
65
+ national_applicability:
66
+ england:
67
+ applicable: true
68
+ northern_ireland:
69
+ applicable: false
70
+ alternative_url: /
71
+ scotland:
72
+ applicable: true
73
+ wales:
74
+ applicable: true
75
+ specific_heading level:
76
+ description: Use a different heading level for the main link title. Defaults to H2 if not passed.
77
+ data:
78
+ heading_level: 3
79
+ national_applicability:
80
+ england:
81
+ applicable: true
@@ -824,3 +824,14 @@ examples:
824
824
  <a role="button" class="gem-c-button govuk-button" href="https://gov.uk/random">Button</a>
825
825
  <a class="gem-c-button govuk-button govuk-button--start" role="button" href="https://gov.uk/random"> Start button <svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" role="presentation" focusable="false"><path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"></path></svg></a>
826
826
  </p>
827
+ image:
828
+ data:
829
+ block: |
830
+ <figure class="image embedded">
831
+ <div class="img">
832
+ <img src="https://assets.publishing.service.gov.uk/government/uploads/system/uploads/image_data/file/40160/Picture2.jpg" alt="Open water with only mangrove stumps showing above the water. Credit: Blue Ventures-Garth Cripps">
833
+ </div>
834
+ <figcaption>
835
+ <p>Deforested area. Credit: Blue Ventures-Garth Cripps</p>
836
+ </figcaption>
837
+ </figure>
@@ -66,14 +66,14 @@ examples:
66
66
  text: "Press release"
67
67
  heading_text: "Government does things"
68
68
  description: "Following a thorough review of existing procedure, a government body has today announced that further work is necessary."
69
- with_extra_links:
69
+ with_extra_details:
70
70
  data:
71
71
  href: "/a-page-no-just-kidding"
72
72
  image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
73
73
  image_alt: "some meaningful alt text please"
74
74
  heading_text: "Some more links"
75
75
  description: "Greater transparency across government is at the heart of our commitment to let you hold politicians and public bodies to account."
76
- extra_links: [
76
+ extra_details: [
77
77
  {
78
78
  text: "Single departmental plans",
79
79
  href: "/1"
@@ -87,7 +87,7 @@ examples:
87
87
  href: "/3"
88
88
  },
89
89
  ]
90
- extra_links_without_indent:
90
+ extra_details_without_indent:
91
91
  description: Don't indent the extra links. Used for links to people pages.
92
92
  data:
93
93
  href: "/government/people/"
@@ -96,20 +96,36 @@ examples:
96
96
  context:
97
97
  text: "The Rt Hon"
98
98
  heading_text: "John Whiskers MP"
99
- extra_links: [
99
+ extra_details: [
100
100
  {
101
101
  text: "Minister for Cats",
102
102
  href: "/government/ministers/"
103
103
  }
104
104
  ]
105
- extra_links_no_indent: true
106
- extra_links_with_no_main_link:
105
+ extra_details_no_indent: true
106
+ extra_details_with_no_links:
107
+ description: If `extra_details` are passed to the component without `href` attributes, they are displayed as a simple text list.
108
+ data:
109
+ href: "/government/people/"
110
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
111
+ image_alt: "some meaningful alt text please"
112
+ heading_text: "John Whiskers MP"
113
+ extra_details: [
114
+ {
115
+ text: "Conservative 2010 to 2016",
116
+ },
117
+ {
118
+ text: "Labour 2007 to 2010",
119
+ }
120
+ ]
121
+ extra_details_no_indent: true
122
+ extra_details_with_no_main_link:
107
123
  description: If extra links are included, the main link is not needed. Note that in this configuration the image is not a link as no link has been supplied.
108
124
  data:
109
125
  image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
110
126
  image_alt: "some meaningful alt text please"
111
127
  heading_text: "John Whiskers MP"
112
- extra_links: [
128
+ extra_details: [
113
129
  {
114
130
  text: "Minister for Cats",
115
131
  href: "/government/ministers/"
@@ -129,7 +145,7 @@ examples:
129
145
  image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
130
146
  image_alt: "some meaningful alt text please"
131
147
  description: Here are some links to more information about the thing you are reading about.
132
- extra_links: [
148
+ extra_details: [
133
149
  {
134
150
  text: "More information",
135
151
  href: "/1"
@@ -158,7 +174,7 @@ examples:
158
174
  image_alt: "some meaningful alt text please"
159
175
  heading_text: "Something relating to this"
160
176
  description: "Public reform committee consultation vote department interior minister referendum."
161
- extra_links: [
177
+ extra_details: [
162
178
  {
163
179
  text: "Something",
164
180
  href: "/1"
@@ -194,7 +210,7 @@ examples:
194
210
  image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
195
211
  image_alt: "some meaningful alt text please"
196
212
  heading_text: "A link with tracking"
197
- extra_links: [
213
+ extra_details: [
198
214
  {
199
215
  text: "Another link with tracking",
200
216
  href: "/1",
@@ -219,13 +235,13 @@ examples:
219
235
  text: "The Rt Hon"
220
236
  heading_text: "John Whiskers MP"
221
237
  metadata: "Unpaid"
222
- extra_links: [
238
+ extra_details: [
223
239
  {
224
240
  text: "Minister for Cats",
225
241
  href: "/government/ministers/"
226
242
  }
227
243
  ]
228
- extra_links_no_indent: true
244
+ extra_details_no_indent: true
229
245
  with_lang:
230
246
  description: |
231
247
  Pass through an appropriate `lang` to set a HTML lang attribute for the component.
@@ -9,7 +9,7 @@
9
9
 
10
10
  <p class="govuk-body govuk-!-margin-bottom-0">
11
11
  <%= t("components.layout_for_public.account_layout.feedback.banners.footer_intro") %>
12
- <a href="<%= "#{Plek.find('account-manager')}/feedback" %>" class="govuk-link">
12
+ <a href="<%= GovukPersonalisation::Urls.feedback %>" class="govuk-link">
13
13
  <%= t("components.layout_for_public.account_layout.feedback.banners.footer_link") %>
14
14
  </a>
15
15
  <%= t("components.layout_for_public.account_layout.feedback.banners.footer_outro") %>
@@ -1,7 +1,7 @@
1
1
  <div class="govuk-width-container">
2
2
  <% message = capture do %>
3
3
  <%= t("components.layout_for_public.account_layout.feedback.banners.phase_intro") %>
4
- <a class="govuk-link" href=<%= "#{Plek.find('account-manager')}/feedback" %>>
4
+ <a class="govuk-link" href=<%= GovukPersonalisation::Urls.feedback %>>
5
5
  <%= t("components.layout_for_public.account_layout.feedback.banners.phase_link") %>
6
6
  </a>
7
7
  <%= t("components.layout_for_public.account_layout.feedback.banners.phase_outro") %>
@@ -5,7 +5,7 @@
5
5
  <li class="gem-c-layout-for-public-account-menu__item <%= "gem-c-layout-for-public-account-menu__item--current" if page_is == "your-account" %>">
6
6
  <%= link_to(
7
7
  t("components.layout_for_public.account_layout.navigation.menu_bar.account.link_text"),
8
- "#{Plek.find('account-manager')}",
8
+ GovukPersonalisation::Urls.your_account,
9
9
  class: 'gem-c-layout-for-public-account-menu__link govuk-link govuk-link--no-visited-state',
10
10
  'aria-current': page_is == "your-account" ? "page" : nil,
11
11
  ) %>
@@ -13,7 +13,7 @@
13
13
  <li class="gem-c-layout-for-public-account-menu__item <%= "gem-c-layout-for-public-account-menu__item--current" if page_is == "manage" %>">
14
14
  <%= link_to(
15
15
  t("components.layout_for_public.account_layout.navigation.menu_bar.manage.link_text"),
16
- "#{Plek.find('account-manager')}/account/manage",
16
+ GovukPersonalisation::Urls.manage,
17
17
  class: 'gem-c-layout-for-public-account-menu__link govuk-link govuk-link--no-visited-state',
18
18
  'aria-current': page_is == "manage" ? "page" : nil,
19
19
  ) %>
@@ -21,7 +21,7 @@
21
21
  <li class="gem-c-layout-for-public-account-menu__item <%= "gem-c-layout-for-public-account-menu__item--current" if page_is == "security" %>">
22
22
  <%= link_to(
23
23
  t("components.layout_for_public.account_layout.navigation.menu_bar.security.link_text"),
24
- "#{Plek.find('account-manager')}/account/security",
24
+ GovukPersonalisation::Urls.security,
25
25
  class: 'gem-c-layout-for-public-account-menu__link govuk-link govuk-link--no-visited-state',
26
26
  'aria-current': page_is == "security" ? "page" : nil,
27
27
  ) %>
@@ -46,6 +46,12 @@ en:
46
46
  - We’d like to set additional cookies to understand how you use GOV.UK, remember your settings and improve government services.
47
47
  - We also use cookies set by other sites to help us deliver content from their services.
48
48
  title: Cookies on GOV.UK
49
+ devolved_nations:
50
+ applies_to: Applies to
51
+ england: England
52
+ northern_ireland: Northern Ireland
53
+ scotland: Scotland
54
+ wales: Wales
49
55
  feedback:
50
56
  close: Close
51
57
  dont_include_personal_info: Don’t include personal or financial information like your National Insurance number or credit card details.
@@ -0,0 +1,27 @@
1
+ module GovukPublishingComponents
2
+ module Presenters
3
+ class DevolvedNationsHelper
4
+ attr_reader :national_applicability
5
+
6
+ def initialize(local_assigns)
7
+ @national_applicability = local_assigns[:national_applicability]
8
+ end
9
+
10
+ def applicable_nations_title_text
11
+ @national_applicability
12
+ .select { |_, v| v[:applicable] == true }
13
+ .map { |k, _| I18n.t("components.devolved_nations.#{k}") }
14
+ .sort
15
+ .to_sentence(last_word_connector: " and ")
16
+ end
17
+
18
+ def nations_with_urls
19
+ @national_applicability
20
+ .select do |_, v|
21
+ v[:alternative_url]
22
+ .present?
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -4,12 +4,12 @@ module GovukPublishingComponents
4
4
  include ActionView::Helpers
5
5
  include ActionView::Context
6
6
 
7
- attr_reader :href, :href_data_attributes, :extra_links, :large, :extra_links_no_indent, :heading_text, :metadata, :lang, :image_loading
7
+ attr_reader :href, :href_data_attributes, :extra_details, :large, :extra_details_no_indent, :heading_text, :metadata, :lang, :image_loading
8
8
 
9
9
  def initialize(local_assigns)
10
10
  @href = local_assigns[:href]
11
11
  @href_data_attributes = local_assigns[:href_data_attributes]
12
- @extra_links = local_assigns[:extra_links] || []
12
+ @extra_details = local_assigns[:extra_details] || []
13
13
  @image_src = local_assigns[:image_src]
14
14
  @image_alt = local_assigns[:image_alt] || ""
15
15
  @image_loading = local_assigns[:image_loading] || "auto"
@@ -17,7 +17,7 @@ module GovukPublishingComponents
17
17
  @description = local_assigns[:description]
18
18
  @large = local_assigns[:large]
19
19
  @heading_text = local_assigns[:heading_text]
20
- @extra_links_no_indent = local_assigns[:extra_links_no_indent]
20
+ @extra_details_no_indent = local_assigns[:extra_details_no_indent]
21
21
  @metadata = local_assigns[:metadata]
22
22
  @lang = local_assigns[:lang]
23
23
  end
@@ -25,8 +25,8 @@ module GovukPublishingComponents
25
25
  def is_tracking?
26
26
  return true if @href_data_attributes
27
27
 
28
- if @extra_links
29
- @extra_links.each do |link|
28
+ if @extra_details
29
+ @extra_details.each do |link|
30
30
  return true if link[:data_attributes]
31
31
  end
32
32
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "25.5.0".freeze
2
+ VERSION = "27.0.0".freeze
3
3
  end
@@ -1,6 +1,7 @@
1
1
  require "active_support"
2
2
  require "action_controller"
3
3
  require "action_view"
4
+ require "govuk_personalisation"
4
5
  require "govuk_publishing_components/config"
5
6
  require "govuk_publishing_components/engine"
6
7
  require "govuk_publishing_components/presenters/shared_helper"
@@ -10,6 +11,7 @@ require "govuk_publishing_components/presenters/breadcrumb_selector"
10
11
  require "govuk_publishing_components/presenters/brexit_cta_helper"
11
12
  require "govuk_publishing_components/presenters/button_helper"
12
13
  require "govuk_publishing_components/presenters/contextual_navigation"
14
+ require "govuk_publishing_components/presenters/devolved_nations_helper"
13
15
  require "govuk_publishing_components/presenters/related_navigation_helper"
14
16
  require "govuk_publishing_components/presenters/step_by_step_nav_helper"
15
17
  require "govuk_publishing_components/presenters/page_with_step_by_step_navigation"
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: 25.5.0
4
+ version: 27.0.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: 2021-08-20 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: govuk_personalisation
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.7.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: kramdown
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +72,14 @@ dependencies:
58
72
  requirements:
59
73
  - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: 5.0.0.1
75
+ version: '6'
62
76
  type: :runtime
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: 5.0.0.1
82
+ version: '6'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rouge
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -198,14 +212,14 @@ dependencies:
198
212
  requirements:
199
213
  - - "~>"
200
214
  - !ruby/object:Gem::Version
201
- version: 3.8.0
215
+ version: 3.9.2
202
216
  type: :development
203
217
  prerelease: false
204
218
  version_requirements: !ruby/object:Gem::Requirement
205
219
  requirements:
206
220
  - - "~>"
207
221
  - !ruby/object:Gem::Version
208
- version: 3.8.0
222
+ version: 3.9.2
209
223
  - !ruby/object:Gem::Dependency
210
224
  name: jasmine_selenium_runner
211
225
  requirement: !ruby/object:Gem::Requirement
@@ -533,6 +547,7 @@ files:
533
547
  - app/assets/stylesheets/govuk_publishing_components/components/_copy-to-clipboard.scss
534
548
  - app/assets/stylesheets/govuk_publishing_components/components/_date-input.scss
535
549
  - app/assets/stylesheets/govuk_publishing_components/components/_details.scss
550
+ - app/assets/stylesheets/govuk_publishing_components/components/_devolved-nations.scss
536
551
  - app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss
537
552
  - app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss
538
553
  - app/assets/stylesheets/govuk_publishing_components/components/_error-message.scss
@@ -670,6 +685,7 @@ files:
670
685
  - app/views/govuk_publishing_components/components/_copy_to_clipboard.html.erb
671
686
  - app/views/govuk_publishing_components/components/_date_input.html.erb
672
687
  - app/views/govuk_publishing_components/components/_details.html.erb
688
+ - app/views/govuk_publishing_components/components/_devolved_nations.html.erb
673
689
  - app/views/govuk_publishing_components/components/_document_list.html.erb
674
690
  - app/views/govuk_publishing_components/components/_error_alert.html.erb
675
691
  - app/views/govuk_publishing_components/components/_error_message.html.erb
@@ -751,6 +767,7 @@ files:
751
767
  - app/views/govuk_publishing_components/components/docs/copy_to_clipboard.yml
752
768
  - app/views/govuk_publishing_components/components/docs/date_input.yml
753
769
  - app/views/govuk_publishing_components/components/docs/details.yml
770
+ - app/views/govuk_publishing_components/components/docs/devolved_nations.yml
754
771
  - app/views/govuk_publishing_components/components/docs/document_list.yml
755
772
  - app/views/govuk_publishing_components/components/docs/error_alert.yml
756
773
  - app/views/govuk_publishing_components/components/docs/error_message.yml
@@ -915,6 +932,7 @@ files:
915
932
  - lib/govuk_publishing_components/presenters/contents_list_helper.rb
916
933
  - lib/govuk_publishing_components/presenters/contextual_navigation.rb
917
934
  - lib/govuk_publishing_components/presenters/curated_taxonomy_sidebar_links.rb
935
+ - lib/govuk_publishing_components/presenters/devolved_nations_helper.rb
918
936
  - lib/govuk_publishing_components/presenters/heading_helper.rb
919
937
  - lib/govuk_publishing_components/presenters/highlight_boxes_helper.rb
920
938
  - lib/govuk_publishing_components/presenters/image_card_helper.rb