govuk_publishing_components 27.18.0 → 27.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-170.jpg +0 -0
  3. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-240.jpg +0 -0
  4. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-320.jpg +0 -0
  5. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-480.jpg +0 -0
  6. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26.jpg +0 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +19 -14
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +17 -7
  9. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +7 -0
  10. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +5 -1
  11. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -0
  12. data/app/views/govuk_publishing_components/components/_intervention.html.erb +10 -1
  13. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +3 -3
  14. data/app/views/govuk_publishing_components/components/contextual_sidebar/_covid_cta.html.erb +27 -0
  15. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +15 -87
  16. data/app/views/govuk_publishing_components/components/docs/image_card.yml +29 -0
  17. data/app/views/govuk_publishing_components/components/docs/intervention.yml +9 -0
  18. data/config/locales/en.yml +4 -0
  19. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +42 -170
  20. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +11 -1
  21. data/lib/govuk_publishing_components/version.rb +1 -1
  22. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49373bd0b9e370b948f7c91c83647ca22f7f2e112bb0d12dee4686c980f831f4
4
- data.tar.gz: 4868f4234fcf242d553c90ab60f35e2354480c30f6c44f3066b5fc60079175b7
3
+ metadata.gz: 5fe93045cd00a9b553478260bc30d9f793d60d32ddeb91b65adbd1b2571465e1
4
+ data.tar.gz: f732e4835b31cc71f667fbf68db58cd413d7eaebf26871bc410a5707618f7ed8
5
5
  SHA512:
6
- metadata.gz: 7e68c23966e5498ca1ae0c386d2a91703b94bac02808fbae86755ca35b12d3fdd45859a2d3eaa6f052912890296554c0478c717354bd29fb1dd5336a8a3bad5e
7
- data.tar.gz: ada5d7c714155391431943c17850d379e4bc9fce3e20fa35bff736b21b60b13d92140dbd7102237f2c64b9c0a948723954e677ef5935b4d91b7bc6a4014bfbd9
6
+ metadata.gz: f558e8a2f476bd8c8e5282ff3bde74ec1d2c07923d953c88ca507d1efe3efb197f46748559849153c08af5295bc7f2f4c5e227b3ba3c1592f5f7d8b2705cb8e3
7
+ data.tar.gz: 460a222515c556721269935be2f702cec9fa2f33bf27afef7dc39dd50d22d7dce7e5db9369f4959834663e2cf176dd05a131a15bed886bdce41f252f74805243
@@ -1,31 +1,36 @@
1
1
  $transition-campaign-red: #ff003b;
2
+ $covid-colour: $govuk-link-colour;
2
3
 
3
- .gem-c-contextual-sidebar__brexit-related-links {
4
+ .gem-c-contextual-sidebar__related-links {
4
5
  border-top: 2px solid $govuk-brand-colour;
5
6
  }
6
7
 
7
- .gem-c-contextual-sidebar__brexit-heading {
8
+ .gem-c-contextual-sidebar__heading {
8
9
  margin-top: govuk-spacing(3);
9
10
  margin-bottom: govuk-spacing(2);
11
+ color: $govuk-text-colour;
10
12
  }
11
13
 
12
- .gem-c-contextual-sidebar__brexit-cta {
14
+ .gem-c-contextual-sidebar__text {
15
+ @include govuk-font(16);
16
+ margin-bottom: govuk-spacing(1);
17
+ @include govuk-media-query($from: tablet) {
18
+ margin-bottom: govuk-spacing(2);
19
+ }
20
+ }
21
+
22
+ .gem-c-contextual-sidebar__cta {
13
23
  margin-bottom: govuk-spacing(6);
14
24
  background-color: govuk-colour('light-grey', $legacy: 'grey-4');
15
- border-top: 2px solid $transition-campaign-red;
16
25
  display: block;
17
26
  padding: 0 govuk-spacing(3) govuk-spacing(3);
18
27
  text-decoration: none;
28
+ }
19
29
 
20
- .gem-c-contextual-sidebar__brexit-heading {
21
- color: $govuk-text-colour;
22
- }
30
+ .gem-c-contextual-sidebar__cta--brexit {
31
+ border-top: 2px solid $transition-campaign-red;
32
+ }
23
33
 
24
- .gem-c-contextual-sidebar__brexit-text {
25
- @include govuk-font(16);
26
- margin-bottom: govuk-spacing(1);
27
- @include govuk-media-query($from: tablet) {
28
- margin-bottom: govuk-spacing(2);
29
- }
30
- }
34
+ .gem-c-contextual-sidebar__cta--covid {
35
+ border-top: 2px solid $covid-colour;
31
36
  }
@@ -45,17 +45,21 @@
45
45
  }
46
46
 
47
47
  .gem-c-image-card__image-wrapper {
48
- @include govuk-grid-column($width: one-third, $at: mobile);
48
+ @include govuk-grid-column($width: one-half, $at: mobile);
49
49
  }
50
50
 
51
51
  .gem-c-image-card__text-wrapper {
52
- @include govuk-grid-column($width: two-thirds, $at: mobile);
52
+ @include govuk-grid-column($width: one-half, $at: mobile);
53
53
  }
54
54
  }
55
55
 
56
56
  .gem-c-image-card__image {
57
57
  display: block;
58
58
  max-width: 100%;
59
+ border-top: 1px solid $govuk-border-colour;
60
+ border-left: none;
61
+ border-right: none;
62
+ border-bottom: none;
59
63
  }
60
64
 
61
65
  .gem-c-image-card__title {
@@ -100,7 +104,13 @@
100
104
 
101
105
  .gem-c-image-card__context,
102
106
  .gem-c-image-card__metadata {
103
- @include govuk-font(14);
107
+ @include govuk-font($size: false);
108
+ font-size: 16px;
109
+
110
+ @if $govuk-typography-use-rem {
111
+ font-size: govuk-px-to-rem(16px);
112
+ }
113
+
104
114
  margin: 0 0 (govuk-spacing(3) / 2);
105
115
  color: govuk-colour("dark-grey", $legacy: "grey-1");
106
116
 
@@ -110,13 +120,13 @@
110
120
  }
111
121
 
112
122
  .gem-c-image-card__description {
113
- @include govuk-font($size: 16);
123
+ @include govuk-font($size: 19);
114
124
  padding-top: (govuk-spacing(3) / 2);
115
125
  word-wrap: break-word;
116
126
  }
117
127
 
118
128
  .gem-c-image-card__list {
119
- @include govuk-font($size: 16);
129
+ @include govuk-font($size: 19);
120
130
  position: relative;
121
131
  z-index: 2;
122
132
  padding: (govuk-spacing(3) / 2) 0 0 0;
@@ -160,7 +170,7 @@
160
170
 
161
171
  .gem-c-image-card--large {
162
172
  .gem-c-image-card__image-wrapper {
163
- @include govuk-grid-column($width: two-thirds, $at: tablet);
173
+ @include govuk-grid-column($width: one-half, $at: tablet);
164
174
 
165
175
  margin-bottom: govuk-spacing(2);
166
176
  float: none;
@@ -175,7 +185,7 @@
175
185
  }
176
186
 
177
187
  .gem-c-image-card__text-wrapper {
178
- @include govuk-grid-column($width: one-third, $at: tablet);
188
+ @include govuk-grid-column($width: one-half, $at: tablet);
179
189
 
180
190
  padding: 0;
181
191
  overflow: hidden;
@@ -34,4 +34,11 @@
34
34
  margin-left: 1em;
35
35
  }
36
36
  }
37
+
38
+ // Prevent excessive spacing when placed in a call-to-action block
39
+ .call-to-action {
40
+ .help-notice:first-child {
41
+ margin-top: 0;
42
+ }
43
+ }
37
44
  }
@@ -24,7 +24,11 @@
24
24
  } %>
25
25
  <% end %>
26
26
 
27
- <% if navigation.show_brexit_cta? || navigation.show_brexit_related_links? %>
27
+ <% if navigation.show_brexit_cta? %>
28
28
  <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta', content_item: content_item %>
29
29
  <% end %>
30
+
31
+ <% if navigation.show_covid_booster_cta? %>
32
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/covid_cta', content_item: content_item %>
33
+ <% end %>
30
34
  </div>
@@ -1,4 +1,5 @@
1
1
  <%
2
+ sizes ||= false
2
3
  brand ||= false
3
4
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
4
5
  card_helper = GovukPublishingComponents::Presenters::ImageCardHelper.new(local_assigns)
@@ -3,8 +3,10 @@
3
3
  suggestion_link_text ||= false
4
4
  suggestion_link_url ||= false
5
5
  suggestion_text ||= nil
6
+ hide ||= false
6
7
  new_tab ||= false
7
8
 
9
+
8
10
  data_attributes ||= {}
9
11
  data_attributes[:module] = 'intervention'
10
12
  suggestion_data_attributes ||= {}
@@ -34,9 +36,16 @@
34
36
 
35
37
  suggestion_link_text = intervention_helper.accessible_text
36
38
  end
39
+
40
+ section_options = {
41
+ class: "gem-c-intervention",
42
+ role: "region", aria: aria_attributes,
43
+ data: data_attributes,
44
+ }
45
+ section_options.merge!({ hidden: true }) if hide
37
46
  %>
38
47
  <% if suggestion_text || (suggestion_link_text && suggestion_link_url) %>
39
- <%= tag.section class: "gem-c-intervention", role: "region", aria: aria_attributes, data: data_attributes do %>
48
+ <%= tag.section section_options do %>
40
49
  <p class="govuk-body">
41
50
  <%= tag.span suggestion_text, class: "gem-c-intervention__textwrapper" if suggestion_text %>
42
51
  <% if suggestion_link_text && suggestion_link_url %>
@@ -15,9 +15,9 @@
15
15
  "track-dimension-index": "29",
16
16
  } %>
17
17
 
18
- <%= tag.div class: "gem-c-contextual-sidebar__brexit-cta" do %>
19
- <%= tag.h2 title, class: "gem-c-contextual-sidebar__brexit-heading govuk-heading-s" %>
20
- <%= tag.p class: "gem-c-contextual-sidebar__brexit-text govuk-body" do %>
18
+ <%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--brexit" do %>
19
+ <%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
20
+ <%= tag.p class: "gem-c-contextual-sidebar__text govuk-body" do %>
21
21
  <%= link_to link_text,
22
22
  link_path,
23
23
  class: "govuk-link",
@@ -0,0 +1,27 @@
1
+ <% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
2
+ <%
3
+ title = t("components.related_navigation.covid_booster.title")
4
+ link_text = t("components.related_navigation.covid_booster.link_text")
5
+ link_path = t("components.related_navigation.covid_booster.link_path")
6
+ lang = shared_helper.t_locale("components.related_navigation.covid_booster.title")
7
+ %>
8
+
9
+ <% data_attributes = {
10
+ "module": "gem-track-click",
11
+ "track-category": "relatedLinkClicked",
12
+ "track-action": "1.0 Coronavirus",
13
+ "track-label": link_path,
14
+ "track-dimension": link_text,
15
+ "track-dimension-index": "29",
16
+ } %>
17
+
18
+ <%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--covid" do %>
19
+ <%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
20
+ <%= tag.p class: "gem-c-contextual-sidebar__text govuk-body" do %>
21
+ <%= link_to link_text,
22
+ link_path,
23
+ class: "govuk-link",
24
+ data: data_attributes,
25
+ lang: lang %>
26
+ <% end %>
27
+ <% end %>
@@ -11,6 +11,8 @@ body: |
11
11
 
12
12
  It must always be used [with the contextual breadcrumbs component][contextual_breadcrumbs].
13
13
 
14
+ The COVID CTA will displayed on all pages except for a few exemptions documented below.
15
+
14
16
  [preview]: /contextual-navigation
15
17
  [step-by-step]: /component-guide/step_by_step_nav
16
18
  [related_navigation]: /component-guide/related_navigation
@@ -86,69 +88,6 @@ examples:
86
88
  - text: The Highway Code
87
89
  href: "/guidance/the-highway-code"
88
90
  optional: false
89
- with_brexit_and_other_related_links:
90
- data:
91
- content_item:
92
- title: "A content item"
93
- links:
94
- taxons:
95
- - content_id: "test"
96
- title: "Not Brexit"
97
- phase: "live"
98
- links:
99
- parent_taxons:
100
- - content_id: "d6c2de5d-ef90-45d1-82d4-5f2438369eea"
101
- title: "Brexit"
102
- ordered_related_items:
103
- - title: Find an apprenticeship
104
- base_path: /apply-apprenticeship
105
- - title: Training and study at work
106
- base_path: /training-study-work-your-rights
107
- - title: Careers helpline for teenagers
108
- base_path: /careers-helpline-for-teenagers
109
- document_collections:
110
- - title: Recruit an apprentice (formerly apprenticeship vacancies)
111
- base_path: /government/collections/apprenticeship-vacancies
112
- document_type: document_collection
113
- - title: The future of jobs and skills
114
- base_path: /government/collections/the-future-of-jobs-and-skills
115
- document_type: document_collection
116
- with_brexit_related_links_and_step_by_steps:
117
- data:
118
- content_item:
119
- title: "A content item"
120
- links:
121
- taxons:
122
- - content_id: "d6c2de5d-ef90-45d1-82d4-5f2438369eea"
123
- title: "Brexit"
124
- phase: "live"
125
- part_of_step_navs:
126
- - title: "Choosing a micropig or micropug: step by step"
127
- base_path: "/micropigs-vs-micropugs"
128
- details:
129
- step_by_step_nav:
130
- title: 'Stay in the UK after it leaves the EU (''settled status''): step by step'
131
- steps:
132
- - title: Check if you need to apply to the EU Settlement Scheme
133
- contents:
134
- - type: paragraph
135
- text: 'You may need to apply to the EU Settlement Scheme to continue living
136
- in the UK. '
137
- - type: list
138
- contents:
139
- - text: Check if you need to apply
140
- href: "/settled-status-eu-citizens-families/eligibility"
141
- optional: false
142
- - title: Find out what status you’ll get
143
- contents:
144
- - type: paragraph
145
- text: You’ll get settled or pre-settled status depending on how long you’ve
146
- been living in the UK. This might affect when you choose to apply.
147
- - type: list
148
- contents:
149
- - text: Find out what you’ll get
150
- href: "/settled-status-eu-citizens-families/what-settled-and-presettled-status-means"
151
- optional: false
152
91
  with_brexit_cta:
153
92
  description: For documents tagged with certain taxons defined in `brexit_cta_taxon_allow_list` we show a custom Brexit call to action element.
154
93
  data:
@@ -172,17 +111,19 @@ examples:
172
111
  base_path: /government/collections/the-future-of-jobs-and-skills
173
112
  document_type: document_collection
174
113
  taxons:
175
- - content_id: "a4038b29-b332-4f13-98b1-1c9709e216bc"
176
- title: "Transport"
114
+ - content_id: "2f8b848d-23c8-4f42-a41a-df1f81c64d0f"
115
+ title: "Exporting"
177
116
  phase: "live"
178
- with_brexit_cta_document_exception:
179
- description: Illustrates an exception to showing the custom Brexit call to action element as defined in `brexit_cta_document_type_exceptions`.
117
+ with_covid_cta_taxon_exception:
118
+ description: The COVID Booster call to action element is not displayed on content tagged to taxons in `covid_booster_cta_taxon_exception_list`.
180
119
  data:
181
120
  content_item:
182
- title: "30 creative teams awarded up to £100,000 each for Festival UK* 2022 R&D project"
183
- content_id: "c3752802-f091-43a9-ba90-33568fccf391"
184
- locale: "en"
121
+ title: "A content item"
185
122
  links:
123
+ taxons:
124
+ - content_id: ac7b8472-5d09-4679-9551-87847b0ac827
125
+ title: "Not Covid"
126
+ phase: "live"
186
127
  ordered_related_items:
187
128
  - title: Find an apprenticeship
188
129
  base_path: /apply-apprenticeship
@@ -197,17 +138,12 @@ examples:
197
138
  - title: The future of jobs and skills
198
139
  base_path: /government/collections/the-future-of-jobs-and-skills
199
140
  document_type: document_collection
200
- taxons:
201
- - content_id: "e2ca2f1a-0ff3-43ce-b813-16645ff27904"
202
- title: "Society and culture"
203
- phase: "live"
204
- with_brexit_cta_taxon_exception:
205
- description: Illustrates an exception to showing the custom Brexit call to action element as defined in `brexit_cta_taxon_exception_list`.
141
+ with_covid_cta_document_type_exception:
142
+ description: Illustrates an exception to showing the custom COVID Booster call to action element as defined in `covid_booster_cta_document_type_exceptions`.
206
143
  data:
207
144
  content_item:
208
- title: "Local transport news story"
209
- content_id: "5c82db20-7631-11e4-a3cb-005056011aef"
210
- locale: "en"
145
+ title: "A content item"
146
+ document_type: smart_answer
211
147
  links:
212
148
  ordered_related_items:
213
149
  - title: Find an apprenticeship
@@ -223,11 +159,3 @@ examples:
223
159
  - title: The future of jobs and skills
224
160
  base_path: /government/collections/the-future-of-jobs-and-skills
225
161
  document_type: document_collection
226
- taxons:
227
- - content_id: "3b4d6319-fcef-4637-b35a-e3df76321894"
228
- title: "Local transport"
229
- phase: "live"
230
- links:
231
- parent_taxons:
232
- - content_id: "a4038b29-b332-4f13-98b1-1c9709e216bc"
233
- title: "Transport"
@@ -253,3 +253,32 @@ examples:
253
253
  image_alt: "some meaningful alt text please"
254
254
  heading_text: Yr hyn rydym ni'n ei wneud
255
255
  lang: cy
256
+ with_sizes_attribute:
257
+ description: |
258
+ `sizes` is an attribute that makes use of html's native responsive images functionality.
259
+
260
+ [Read more about responsive images](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images)
261
+ data:
262
+ href: "/not-a-page"
263
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
264
+ image_alt: "some meaningful alt text please"
265
+ heading_text: "News headline"
266
+ sizes: "(max-width: 640px) 100vw, (max-width: 1020px) 33vw, 300px"
267
+ with_srcset:
268
+ description: |
269
+ `srcset` is another responsive images attribute (see `sizes` section above for info on how responsive images work).
270
+
271
+ `srcset` strings typically pull from the `asset/images` directory of a repo so use this as a starting point when writing paths for your `srcset` image keys.
272
+
273
+ Note that the below example will appear to render incorrectly as we don't want to include `srcset` example images in our component guide as this will get served to frontend apps, adding weight to the user to download.
274
+ data:
275
+ href: "/not-a-page"
276
+ image_src: "/assets/govuk_publishing_components/image-card-srcset/afghan-image-promo.jpg"
277
+ image_alt: "some meaningful alt text please"
278
+ heading_text: "News headline"
279
+ srcset:
280
+ /assets/govuk_publishing_components/image-card-srcset/cop26.jpg: 610w
281
+ /assets/govuk_publishing_components/image-card-srcset/cop26-480.jpg: 480w
282
+ /assets/govuk_publishing_components/image-card-srcset/cop26-320.jpg: 320w
283
+ /assets/govuk_publishing_components/image-card-srcset/cop26-240.jpg: 240w
284
+ /assets/govuk_publishing_components/image-card-srcset/cop26-170.jpg: 170w
@@ -38,6 +38,15 @@ examples:
38
38
  suggestion_link_text: "You can now apply for a permit online."
39
39
  suggestion_link_url: "/permit"
40
40
 
41
+ with_hide:
42
+ description: |
43
+ This example is for when we want to hide by default and display to the user based on some logic,
44
+ either in the backend or with Javascript.
45
+ data:
46
+ suggestion_link_text: "You may be invited to fill in a questionnaire"
47
+ suggestion_link_url: "/questionnaire"
48
+ hide: true
49
+
41
50
  open_suggestion_link_in_new_tab:
42
51
  description: |
43
52
  When sending users to another online task, you don't want to completely hijack
@@ -244,6 +244,10 @@ en:
244
244
  link_path: "/brexit"
245
245
  link_text: Check what you need to do
246
246
  title: Brexit
247
+ covid_booster:
248
+ link_path: "https://www.nhs.uk/conditions/coronavirus-covid-19/coronavirus-vaccination/"
249
+ link_text: Book your coronavirus vaccination and booster dose on the NHS website
250
+ title: COVID-19 vaccinations
247
251
  world_locations: World locations
248
252
  search_box:
249
253
  input_title: Search
@@ -108,146 +108,22 @@ module GovukPublishingComponents
108
108
  false
109
109
  end
110
110
 
111
- def show_brexit_related_links?
112
- # If tagged directly to /brexit or /world/brexit
113
- # Or if tagged to a taxon which has /brexit as a parent
114
- # And is not the brexit hub pages
115
- return false if brexit_hub_pages.include?(content_item["content_id"])
116
-
117
- tagged_to_brexit?
118
- end
119
-
120
- def brexit_cta_document_exceptions
121
- # /government/news/30-creative-teams-awarded-up-to-100000-each-for-festival-uk-2022-rd-project
122
- # and answer pages that have a start button (tracked in https://docs.google.com/spreadsheets/d/1ynH8zIjvElvK-u8JLI8KOYylxTbzJsoXRqEnqrnqv_4/edit)
123
- %w[
124
- c3752802-f091-43a9-ba90-33568fccf391
125
- e1a9ce2b-4085-4761-b70f-d125a6571de3
126
- 6a2bf66e-2313-4204-afd5-9940de5e1d66
127
- f65b0ac7-b8cd-476b-bd5d-738268517659
128
- 45ad868a-2e79-4029-991b-c29559d7eb29
129
- e4e9c4ec-385e-4758-93ac-388bc154815e
130
- cee73f76-83f0-44e2-b657-3b51a9cbc76e
131
- 9a945506-60bc-44d8-a2ec-0eb2824732d6
132
- 6ae16c12-a554-44e2-b3e3-596375aa1b9a
133
- 9add4ccc-dc4c-44cf-9b69-6878c162d431
134
- 4f5cf1cd-efda-4c49-8292-1db1c6c3cfb0
135
- 73058592-dedf-4379-9a1d-d8222a796c0a
136
- c9259172-5432-43a6-b710-409d463c7627
137
- 59ecfc6d-cb9e-49b8-b013-fc368ebdf8ed
138
- 9897695d-624b-4cb9-b873-f3113f0332a1
139
- 715f4659-b058-46ec-84c8-cc346c210778
140
- c63890f9-2356-4be3-9e07-6cf4b8de7081
141
- e7661ec8-b678-444e-b4d0-a221fa83a7f7
142
- 723f9c0a-bcdb-4d8f-952c-6df0ed468c57
143
- a1c420b7-11d7-4b9c-a97e-406fb73c0200
144
- c1347936-839b-4547-a570-0c315c34ee45
145
- 1396f68b-6ffa-47ef-a049-414e7b548e81
146
- 3b054acf-d0af-470e-b912-9481204d1a9a
147
- 317b9c08-928b-4fd2-bc8e-4c6acf287c58
148
- 44d6cb7a-d853-4cd8-a9cb-69eff0299d9e
149
- 15517245-f142-4e45-ad84-773250f7d5a2
150
- 6fe6644d-d037-4ea4-baf6-800dc1966ed0
151
- 4a63625c-a195-4b86-9562-cb6653dd26ff
152
- 47521233-20a8-4d02-ba31-6e1977448fd1
153
- 7b8ca4ac-f3a3-41b8-9555-9e244c36575b
154
- be1a82d1-e53c-431a-9e7a-337ed4b2654f
155
- 6c445001-4e29-4853-8c14-444d7f9374ee
156
- c8cf2a7c-5c13-4f3d-b1ff-6a7eb5533973
157
- 2422a237-f8f1-4e9f-ad51-f1d44fde9755
158
- ae000c08-c74f-467b-b8a4-90f138252a5c
159
- 7eec7800-9c4d-4160-af53-57b5d3e02972
160
- eb545b3b-111b-4c3c-890c-c9ec29b9090d
161
- 8d705ade-8977-480d-9080-72a19e341c2a
162
- 2a0dd317-0252-4c7c-8c13-b43af28406bc
163
- f27e5792-a84b-4164-9890-7e86767634e8
164
- b0b9a600-1fe6-4257-9e68-2be0f59ea25d
165
- 28fa04ea-42e1-46ad-9abc-acf132c5666d
166
- 64b27b8a-ae53-4034-a812-f4805cd7e3ad
167
- 1dd5a75f-18b4-419d-b2b6-6d4808f2c7e4
168
- b21b9e34-455c-4305-b4cc-4e6b8d3f7522
169
- 0ab53a0d-b098-43a8-b3cc-8b3224697228
170
- e3862156-ba5a-41ba-8ee6-22e5cd6a6144
171
- 2e8f7fae-7164-459c-898b-0c0538eee3e0
172
- 6087439c-26d2-4881-b345-5160e23f3b5e
173
- cac78a0a-9c28-436a-a29e-8ccbe8fbc956
174
- c2fd13a5-537b-4368-ac2e-6078b2c463f1
175
- 98f0a21d-7b67-4089-a98c-f0a0177291a2
176
- 06692612-8c39-464c-8aee-2aa62e6c8887
177
- df943977-69cb-479d-a921-9410d603c471
178
- 2656eb6b-f2eb-4982-8a90-e40d03a34a4d
179
- 4ca8698b-4a24-45ff-baea-7633cc24b679
180
- ed73581f-9bf8-48b5-bb66-935581a255e3
181
- 15f1c594-af1d-4f16-97cc-ad4d12017509
182
- ] + brexit_hub_pages
183
- end
184
-
185
- # we don't want to show the standard Brexit sidebar nav on
186
- # https://www.gov.uk/guidance/brexit-guidance-for-individuals-and-families or
187
- # https://www.gov.uk/guidance/brexit-guidance-for-businesses
188
- # as it might result in circular journeys
189
- def brexit_hub_pages
190
- %w[
191
- 91cd6143-69d5-4f27-99ff-a52fb0d51c78
192
- 6555e0bf-c270-4cf9-a0c5-d20b95fab7f1
193
- ]
194
- end
195
-
196
- def brexit_cta_document_exception?
197
- brexit_cta_document_exceptions.include?(content_item["content_id"])
198
- end
199
-
200
- def brexit_cta_document_type_exceptions
201
- %w[
202
- aaib_report
203
- asylum_support_decision
204
- fatality_notice
205
- maib_report
206
- raib_report
207
- simple_smart_answer
208
- smart_answer
209
- transaction
210
- ]
211
- end
212
-
213
- def brexit_cta_document_type_exception?
214
- brexit_cta_document_type_exceptions.include?(content_item["document_type"])
215
- end
216
-
217
111
  def brexit_cta_taxon_allow_list
218
- # Entering and staying in the UK
219
- # Going and being abroad
220
- # Corporate information
221
- # Transport
222
- # Environment
223
- # International
224
- # Defence and armed forces
225
- # Work
226
- # Welfare
227
- # Money
228
- # Business and industry
229
- # Health and social care
230
- # Education > Further and higher education
231
- # Education > Teaching and leadership
232
- # Education > Funding and finance for students
233
- # Coronavirus (COVID-19)
112
+ # Overseas businesses: exporting to the UK
113
+ # Exporting goods and services
114
+ # Exporting
115
+ # Manufacturing, wholesaling, importing and exporting medicines
116
+ # Importing goods and services
117
+ # Importing
118
+ # Manufacturing, wholesaling, importing and exporting medicines
234
119
  %w[
235
- ba3a9702-da22-487f-86c1-8334a730e559
236
- 9597c30a-605a-4e36-8bc1-47e5cdae41b3
237
- a544d48b-1e9e-47fb-b427-7a987c658c14
238
- a4038b29-b332-4f13-98b1-1c9709e216bc
239
- 3cf97f69-84de-41ae-bc7b-7e2cc238fa58
240
- 37d0fa26-abed-4c74-8835-b3b51ae1c8b2
241
- e491505c-77ae-45b2-84be-8c94b94f6a2b
242
- d0f1e5a3-c8f4-4780-8678-994f19104b21
243
- dded88e2-f92e-424f-b73e-6ad24a839c51
244
- 6acc9db4-780e-4a46-92b4-1812e3c2c48a
245
- 495afdb6-47be-4df1-8b38-91c8adb1eefc
246
- 8124ead8-8ebc-4faf-88ad-dd5cbcc92ba8
247
- dd767840-363e-43ad-8835-c9ab516633de
248
- ff00b8b2-dcdb-4659-93c2-291c9be354f3
249
- 23265b25-7ec3-4960-8517-4ff8d4d92cac
250
- 5b7b9532-a775-4bd2-a3aa-6ce380184b6c
120
+ 2f8b848d-23c8-4f42-a41a-df1f81c64d0f
121
+ 8af13fba-d969-4d87-a02e-2e71783d47be
122
+ efa9782b-a3d0-4ca0-9c92-3b89748175b7
123
+ f441e630-2bba-4bbd-8c1b-22ae61cc00c2
124
+ 4788b4b8-2642-47ca-bfc2-bd7e8705a1da
125
+ d74faafc-781d-4087-8e0c-be4216180059
126
+ f441e630-2bba-4bbd-8c1b-22ae61cc00c2
251
127
  ]
252
128
  end
253
129
 
@@ -261,10 +137,6 @@ module GovukPublishingComponents
261
137
  false
262
138
  end
263
139
 
264
- def brexit_cta_lang_allow_list?
265
- %w[en cy].include?(content_item["locale"])
266
- end
267
-
268
140
  def parent_taxon_include?(taxon, taxon_list)
269
141
  if taxon.present?
270
142
  if taxon.dig("links", "parent_taxons").to_a.any? { |taxon_item| taxon_list.include?(taxon_item["content_id"]) }
@@ -277,46 +149,46 @@ module GovukPublishingComponents
277
149
  end
278
150
  end
279
151
 
280
- def brexit_cta_taxon_exception_list
281
- # Entering and staying in the UK > Immigration offences
282
- # Entering and staying in the UK > Inspections of border, immigration and asylum services
283
- # Entering and staying in the UK > Refugees, asylum and human rights
284
- # Transport > Local transport
285
- # Education > Further and higher education > Education in prisons
152
+ def show_brexit_cta?
153
+ brexit_cta_taxon_allow_list?
154
+ end
155
+
156
+ def show_covid_booster_cta?
157
+ !covid_booster_cta_document_type_exempt? &&
158
+ !covid_booster_cta_taxon_exception_list?
159
+ end
160
+
161
+ def covid_booster_cta_document_type_exempt?
162
+ covid_booster_cta_document_type_exceptions.include?(content_item["document_type"])
163
+ end
164
+
165
+ def covid_booster_cta_document_type_exceptions
286
166
  %w[
287
- fa13521f-9285-45b0-bd65-4a472a8037e7
288
- 0fab9131-f877-4286-b4d8-922fbfb402b6
289
- 08a8a69f-2825-4fe2-a4cf-c83458a5629e
290
- 3b4d6319-fcef-4637-b35a-e3df76321894
291
- 6426d1c5-93c8-4659-85d5-1f0d3368a124
167
+ simple_smart_answer
168
+ smart_answer
169
+ step_by_step_nav
292
170
  ]
293
171
  end
294
172
 
295
- def brexit_cta_taxon_exception_list?
173
+ def covid_booster_cta_taxon_exception_list?
296
174
  taxons = content_item.dig("links", "taxons").to_a
297
175
  taxons.each do |taxon|
298
- if brexit_cta_taxon_exception_list.include?(taxon["content_id"]) || parent_taxon_include?(taxon, brexit_cta_taxon_exception_list)
176
+ if covid_booster_cta_taxon_exception_list.include?(taxon["content_id"]) || parent_taxon_include?(taxon, covid_booster_cta_taxon_exception_list)
299
177
  return true
300
178
  end
301
179
  end
302
180
  false
303
181
  end
304
182
 
305
- def brexit_cta_exception?
306
- brexit_cta_document_exception? ||
307
- brexit_cta_document_type_exception? ||
308
- brexit_cta_taxon_exception_list?
309
- end
310
-
311
- def show_brexit_cta?
312
- brexit_cta_taxon_allow_list? &&
313
- brexit_cta_lang_allow_list? &&
314
- step_by_step_count.zero? &&
315
- !brexit_cta_exception?
316
- end
317
-
318
- def step_by_step_count
319
- step_nav_helper.step_navs.count
183
+ def covid_booster_cta_taxon_exception_list
184
+ # Welfare > Death and benefits
185
+ # Life circumstances > Death and bereavement
186
+ # Life circumstances > Death registration disclosure
187
+ %w[
188
+ ac7b8472-5d09-4679-9551-87847b0ac827
189
+ 0fffa994-b76d-4539-8bf9-2a6c6751580d
190
+ de978199-11e8-49b9-965e-4fa6a7ae79a8
191
+ ]
320
192
  end
321
193
 
322
194
  def content_tagged_to_current_step_by_step?
@@ -13,6 +13,9 @@ module GovukPublishingComponents
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"
16
+ @srcset = local_assigns[:srcset] || nil
17
+ @sizes = local_assigns[:sizes] || nil
18
+ @image_loading = local_assigns[:image_loading] || "auto"
16
19
  @context = local_assigns[:context]
17
20
  @description = local_assigns[:description]
18
21
  @large = local_assigns[:large]
@@ -36,7 +39,14 @@ module GovukPublishingComponents
36
39
  def image
37
40
  if @image_src
38
41
  content_tag(:figure, class: "gem-c-image-card__image-wrapper") do
39
- image_tag(@image_src, class: "gem-c-image-card__image", alt: @image_alt, loading: @image_loading)
42
+ image_tag(
43
+ @image_src,
44
+ class: "gem-c-image-card__image",
45
+ alt: @image_alt,
46
+ loading: @image_loading,
47
+ sizes: @sizes,
48
+ srcset: @srcset,
49
+ )
40
50
  end
41
51
  end
42
52
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "27.18.0".freeze
2
+ VERSION = "27.19.0".freeze
3
3
  end
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: 27.18.0
4
+ version: 27.19.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-12-15 00:00:00.000000000 Z
11
+ date: 2021-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -452,6 +452,11 @@ files:
452
452
  - app/assets/images/govuk_publishing_components/icon-important.svg
453
453
  - app/assets/images/govuk_publishing_components/icon-print-2x.png
454
454
  - app/assets/images/govuk_publishing_components/icon-print.png
455
+ - app/assets/images/govuk_publishing_components/image-card-srcset/cop26-170.jpg
456
+ - app/assets/images/govuk_publishing_components/image-card-srcset/cop26-240.jpg
457
+ - app/assets/images/govuk_publishing_components/image-card-srcset/cop26-320.jpg
458
+ - app/assets/images/govuk_publishing_components/image-card-srcset/cop26-480.jpg
459
+ - app/assets/images/govuk_publishing_components/image-card-srcset/cop26.jpg
455
460
  - app/assets/images/govuk_publishing_components/search-button.png
456
461
  - app/assets/images/govuk_publishing_components/take-action-amber.svg
457
462
  - app/assets/images/govuk_publishing_components/take-action-green.svg
@@ -758,6 +763,7 @@ files:
758
763
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_generic.html.erb
759
764
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_spreadsheet.html.erb
760
765
  - app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
766
+ - app/views/govuk_publishing_components/components/contextual_sidebar/_covid_cta.html.erb
761
767
  - app/views/govuk_publishing_components/components/docs/accordion.yml
762
768
  - app/views/govuk_publishing_components/components/docs/action_link.yml
763
769
  - app/views/govuk_publishing_components/components/docs/admin_analytics.yml