govuk_publishing_components 24.15.1 → 24.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/action-link-arrow--brexit.svg +3 -0
  3. data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.png +0 -0
  4. data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.svg +2 -2
  5. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +21 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/button.js +1 -1
  7. data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +1 -1
  8. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +10 -10
  9. data/app/assets/javascripts/govuk_publishing_components/components/details.js +5 -5
  10. data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +1 -1
  11. data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +1 -1
  12. data/app/assets/javascripts/govuk_publishing_components/components/radio.js +1 -1
  13. data/app/assets/javascripts/govuk_publishing_components/components/tabs.js +1 -1
  14. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/all.js +1 -0
  15. data/app/assets/javascripts/govuk_publishing_components/modules.js +23 -20
  16. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux.js +942 -787
  17. data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/all.js +1 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +25 -0
  19. data/app/views/govuk_publishing_components/components/_action_link.html.erb +4 -0
  20. data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +2 -2
  21. data/app/views/govuk_publishing_components/components/_details.html.erb +1 -1
  22. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +8 -3
  23. data/app/views/govuk_publishing_components/components/docs/action_link.yml +6 -0
  24. data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +4 -0
  25. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +4 -0
  26. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +5 -0
  27. data/config/i18n-tasks.yml +4 -0
  28. data/config/locales/en.yml +10 -20
  29. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +25 -6
  30. data/lib/govuk_publishing_components/version.rb +1 -1
  31. metadata +20 -2
@@ -146,6 +146,31 @@
146
146
  }
147
147
  }
148
148
 
149
+ .gem-c-action-link--brexit {
150
+ max-width: none;
151
+
152
+ &:before {
153
+ height: 30px;
154
+ width: 35px;
155
+ background-image: image-url("govuk_publishing_components/action-link-arrow--brexit.svg");
156
+ background-repeat: no-repeat;
157
+ background-size: 25px auto;
158
+ background-position: 0 0;
159
+ }
160
+
161
+ @include govuk-media-query($until: tablet) {
162
+ margin-bottom: govuk-spacing(2);
163
+ }
164
+
165
+ @include govuk-media-query($from: tablet) {
166
+ margin-bottom: govuk-spacing(2);
167
+
168
+ &:before {
169
+ background-position: 0 4px;
170
+ }
171
+ }
172
+ }
173
+
149
174
  .gem-c-action-link--nhs {
150
175
  &:before {
151
176
  width: 80px;
@@ -14,9 +14,11 @@
14
14
  dark_icon ||= false
15
15
  small_icon ||= false
16
16
  nhs_icon ||= false
17
+ brexit_icon ||= false
17
18
  transparent_icon ||= false
18
19
  data ||= nil
19
20
  classes ||= nil
21
+ font_size ||= nil
20
22
 
21
23
  css_classes = %w(gem-c-action-link)
22
24
  css_classes << "gem-c-action-link--light-text" if light_text
@@ -24,6 +26,7 @@
24
26
  css_classes << "gem-c-action-link--small-icon" if small_icon
25
27
  css_classes << "gem-c-action-link--transparent-icon" if transparent_icon
26
28
  css_classes << "gem-c-action-link--nhs" if nhs_icon
29
+ css_classes << "gem-c-action-link--brexit" if brexit_icon
27
30
  css_classes << "gem-c-action-link--simple" if simple
28
31
  css_classes << "gem-c-action-link--simple-light" if simple_light
29
32
  css_classes << "gem-c-action-link--with-subtext" if subtext
@@ -33,6 +36,7 @@
33
36
  link_classes = %w(govuk-link gem-c-action-link__link)
34
37
  link_classes << shared_helper.classes if classes
35
38
  link_classes << "govuk-link--inverse" if light_text
39
+ link_classes << shared_helper.get_heading_size(font_size, 'm') if font_size
36
40
  %>
37
41
  <% if text.present? %>
38
42
  <div class="<%= css_classes.join(' ') %>">
@@ -4,7 +4,7 @@
4
4
  id = cb_helper.id
5
5
  %>
6
6
 
7
- <%= tag.div id: id, class: cb_helper.css_classes, data: { module: "govuk-checkboxes" } do %>
7
+ <%= tag.div id: id, class: cb_helper.css_classes, data: { module: "gem-checkboxes" } do %>
8
8
  <% if cb_helper.should_have_fieldset %>
9
9
  <% if cb_helper.heading_markup %>
10
10
  <%= tag.fieldset class: "govuk-fieldset", "aria-describedby": cb_helper.fieldset_describedby do %>
@@ -23,7 +23,7 @@
23
23
  <% end %>
24
24
 
25
25
  <%= tag.ul class: cb_helper.list_classes, data: {
26
- module: ('checkboxes' if cb_helper.has_conditional),
26
+ module: ('govuk-checkboxes' if cb_helper.has_conditional),
27
27
  nested: ('true' if cb_helper.has_nested),
28
28
  exclusive: ('true' if cb_helper.has_exclusive)
29
29
  } do %>
@@ -7,7 +7,7 @@
7
7
  css_classes << (shared_helper.get_margin_bottom)
8
8
 
9
9
  data_attributes ||= {}
10
- data_attributes[:module] = 'govuk-details'
10
+ data_attributes[:module] = 'govuk-details gem-details'
11
11
  %>
12
12
  <%= tag.details class: css_classes, data: data_attributes, open: open do %>
13
13
  <summary class="govuk-details__summary" data-details-track-click>
@@ -1,7 +1,9 @@
1
1
  <%
2
+ omit_feedback_form ||= false
2
3
  emergency_banner ||= nil
3
4
  full_width ||= false
4
5
  global_bar ||= nil
6
+ product_name ||= nil
5
7
  html_lang ||= "en"
6
8
  layout_helper = GovukPublishingComponents::Presenters::PublicLayoutHelper.new(local_assigns)
7
9
  logo_link ||= "/"
@@ -76,6 +78,7 @@
76
78
  search: show_search,
77
79
  logo_link: logo_link,
78
80
  navigation_items: navigation_items,
81
+ product_name: product_name,
79
82
 
80
83
  # The (blue) bottom border needs to be underneath the emergency banner -
81
84
  # so it has been turned off and added in manually.
@@ -104,9 +107,11 @@
104
107
  </main>
105
108
  </div>
106
109
 
107
- <div class="govuk-width-container">
108
- <%= render "govuk_publishing_components/components/feedback" %>
109
- </div>
110
+ <% unless omit_feedback_form %>
111
+ <div class="govuk-width-container">
112
+ <%= render "govuk_publishing_components/components/feedback" %>
113
+ </div>
114
+ <% end %>
110
115
 
111
116
  <% unless local_assigns[:hide_footer_links] %>
112
117
  <%= render "govuk_publishing_components/components/layout_footer", {
@@ -101,6 +101,12 @@ examples:
101
101
  text: Coronavirus (COVID-19)
102
102
  href: "/my-test-page"
103
103
  dark_icon: true
104
+ with_brexit_icon_and_custom_font_size:
105
+ data:
106
+ text: Guidance for businesses
107
+ href: "/guidance-for-businesses"
108
+ brexit_icon: true
109
+ font_size: m
104
110
  with_nhs_icon:
105
111
  data:
106
112
  text: Something about the NHS
@@ -40,10 +40,14 @@ examples:
40
40
  items:
41
41
  - href: '/help'
42
42
  text: Help
43
+ - href: '/help/privacy-notice'
44
+ text: Privacy
43
45
  - href: '/help/cookies'
44
46
  text: Cookies
45
47
  - href: '/contact'
46
48
  text: Contact
49
+ - href: '/help/accessibility-statement'
50
+ text: Accessibility statement
47
51
  - href: '/help/terms-conditions'
48
52
  text: Terms and conditions
49
53
  - href: '/cymraeg'
@@ -27,6 +27,10 @@ examples:
27
27
  description: This allows the header to be omitted which is currently used when rendering CSV previews from Whitehall
28
28
  data:
29
29
  omit_header: true
30
+ omit_feedback:
31
+ description: This allows the feedback form to be omitted
32
+ data:
33
+ omit_feedback_form: true
30
34
  navigation:
31
35
  description: Passes the navigation through to the [header component](/component-guide/layout_header/).
32
36
  data:
@@ -18,5 +18,10 @@
18
18
  id: "site-search-text",
19
19
  margin_bottom: 0,
20
20
  no_border: true,
21
+ data_attributes: {
22
+ track_category: "headerClicked",
23
+ track_action: "searchSubmitted",
24
+ track_label: "none",
25
+ },
21
26
  } %>
22
27
  </form>
@@ -0,0 +1,4 @@
1
+ data:
2
+ yaml:
3
+ write:
4
+ line_width: -1
@@ -12,20 +12,14 @@ en:
12
12
  article_schema:
13
13
  scoped_search_description: Search within %{title}
14
14
  attachment:
15
- opendocument_html: This file is in an <a href='https://www.gov.uk/guidance/using-open-document-formats-odf-in-your-organisation'
16
- target=%{target} class='govuk-link'>OpenDocument</a> format
15
+ opendocument_html: This file is in an <a href='https://www.gov.uk/guidance/using-open-document-formats-odf-in-your-organisation' target=%{target} class='govuk-link'>OpenDocument</a> format
17
16
  order_a_copy: Order a copy
18
17
  page:
19
18
  one: 1 page
20
- other: '%{count} pages'
19
+ other: "%{count} pages"
21
20
  reference: 'Ref: %{reference}'
22
21
  request_format_cta: Request an accessible format.
23
- request_format_details_html: If you use assistive technology (such as a screen
24
- reader) and need a version of this document in a more accessible format, please
25
- email <a href='mailto:%{alternative_format_contact_email}' target='_blank'
26
- class='govuk-link'>%{alternative_format_contact_email}</a>. Please tell us
27
- what format you need. It will help us if you say what assistive technology
28
- you use.
22
+ request_format_details_html: If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Please tell us what format you need. It will help us if you say what assistive technology you use.
29
23
  request_format_text: This file may not be suitable for users of assistive technology.
30
24
  back_link:
31
25
  back: Back
@@ -44,28 +38,24 @@ en:
44
38
  buttons:
45
39
  accept_cookies: Accept additional cookies
46
40
  reject_cookies: Reject additional cookies
47
- hide: Hide this message
48
- text:
49
- - We use some essential cookies to make this website work.
50
- - We’d like to set additional cookies to understand how you use GOV.UK, remember your settings and improve government services.
51
- - We also use cookies set by other sites to help us deliver content from their services.
52
41
  confirmation_message: You can %{link} at any time.
53
42
  confirmation_message_link: change your cookie settings
43
+ hide: Hide this message
44
+ text:
45
+ - We use some essential cookies to make this website work.
46
+ - We’d like to set additional cookies to understand how you use GOV.UK, remember your settings and improve government services.
47
+ - We also use cookies set by other sites to help us deliver content from their services.
54
48
  title: Cookies on GOV.UK
55
49
  feedback:
56
50
  close: Close
57
- dont_include_personal_info: Don’t include personal or financial information
58
- like your National Insurance number or credit card details.
51
+ dont_include_personal_info: Don’t include personal or financial information like your National Insurance number or credit card details.
59
52
  email_address: Email address
60
53
  help_us_improve_govuk: Help us improve GOV.UK
61
54
  is_not_useful: this page is not useful
62
55
  is_this_page_useful: Is this page useful?
63
56
  is_useful: this page is useful
64
57
  maybe: Maybe
65
- more_about_visit: To help us improve GOV.UK, we’d like to know more about your
66
- visit today. We’ll send you a link to a feedback form. It will take only 2
67
- minutes to fill in. Don’t worry we won’t send you spam or share your email
68
- address with anyone.
58
+ more_about_visit: To help us improve GOV.UK, we’d like to know more about your visit today. We’ll send you a link to a feedback form. It will take only 2 minutes to fill in. Don’t worry we won’t send you spam or share your email address with anyone.
69
59
  'no': 'No'
70
60
  send: Send
71
61
  send_me_survey: Send me the survey
@@ -39,8 +39,7 @@ module GovukPublishingComponents
39
39
  tracking_category: "breadcrumbClicked",
40
40
  tracking_action: tracking_action,
41
41
  tracking_label: content_item["base_path"],
42
- tracking_dimension_enabled: false,
43
- }
42
+ }.merge(custom_dimension_tracking)
44
43
  end
45
44
 
46
45
  private
@@ -80,16 +79,36 @@ module GovukPublishingComponents
80
79
  [PRIORITY_TAXONS[:brexit_business], PRIORITY_TAXONS[:brexit_individuals]]
81
80
  end
82
81
 
82
+ def brexit_taxons
83
+ brexit_child_taxons << PRIORITY_TAXONS[:brexit_taxon]
84
+ end
85
+
83
86
  def preferred_priority_taxon
84
87
  query_parameters["priority-taxon"] if query_parameters
85
88
  end
86
89
 
87
90
  def tracking_action
88
91
  action = %w[superBreadcrumb]
89
- action << "Brexitbusiness" if taxon["content_id"] == PRIORITY_TAXONS[:brexit_business]
90
- action << "Brexitcitizen" if taxon["content_id"] == PRIORITY_TAXONS[:brexit_individuals]
91
- action << "Brexitbusinessandcitizen" if taxon["content_id"] == PRIORITY_TAXONS[:brexit_taxon]
92
- action.join(" ")
92
+ action << page_name_for_tracking
93
+ action.compact.join(" ")
94
+ end
95
+
96
+ def custom_dimension_tracking
97
+ tracking = { tracking_dimension_enabled: false }
98
+ if brexit_taxons.include?(taxon["content_id"])
99
+ tracking[:tracking_dimension_enabled] = true
100
+ tracking[:tracking_dimension] = page_name_for_tracking
101
+ tracking[:tracking_dimension_index] = 111
102
+ end
103
+ tracking
104
+ end
105
+
106
+ def page_name_for_tracking
107
+ {
108
+ PRIORITY_TAXONS[:brexit_business] => "Brexitbusiness",
109
+ PRIORITY_TAXONS[:brexit_individuals] => "Brexitcitizen",
110
+ PRIORITY_TAXONS[:brexit_taxon] => "Brexitbusinessandcitizen",
111
+ }[taxon["content_id"]]
93
112
  end
94
113
 
95
114
  def tagged_to_both_brexit_child_taxons?
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.15.1".freeze
2
+ VERSION = "24.17.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: 24.15.1
4
+ version: 24.17.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-06-18 00:00:00.000000000 Z
11
+ date: 2021-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -178,6 +178,20 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: i18n-tasks
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: jasmine
183
197
  requirement: !ruby/object:Gem::Requirement
@@ -350,6 +364,7 @@ files:
350
364
  - app/assets/config/govuk_publishing_components_manifest.js
351
365
  - app/assets/images/govuk_publishing_components/action-link--nhs.png
352
366
  - app/assets/images/govuk_publishing_components/action-link--nhs.svg
367
+ - app/assets/images/govuk_publishing_components/action-link-arrow--brexit.svg
353
368
  - app/assets/images/govuk_publishing_components/action-link-arrow--dark.png
354
369
  - app/assets/images/govuk_publishing_components/action-link-arrow--dark.svg
355
370
  - app/assets/images/govuk_publishing_components/action-link-arrow--simple-light.png
@@ -472,6 +487,7 @@ files:
472
487
  - app/assets/javascripts/govuk_publishing_components/lib.js
473
488
  - app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js
474
489
  - app/assets/javascripts/govuk_publishing_components/lib/current-location.js
490
+ - app/assets/javascripts/govuk_publishing_components/lib/govspeak/all.js
475
491
  - app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
476
492
  - app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js
477
493
  - app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js
@@ -490,6 +506,7 @@ files:
490
506
  - app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-polyfill.js
491
507
  - app/assets/javascripts/govuk_publishing_components/vendor/lux/lux.js
492
508
  - app/assets/javascripts/govuk_publishing_components/vendor/modernizr.js
509
+ - app/assets/javascripts/govuk_publishing_components/vendor/polyfills/all.js
493
510
  - app/assets/javascripts/govuk_publishing_components/vendor/polyfills/closest.js
494
511
  - app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js
495
512
  - app/assets/javascripts/govuk_publishing_components/vendor/polyfills/indexOf.js
@@ -804,6 +821,7 @@ files:
804
821
  - app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
805
822
  - app/views/govuk_publishing_components/components/related_navigation/_section.html.erb
806
823
  - app/views/layouts/govuk_publishing_components/application.html.erb
824
+ - config/i18n-tasks.yml
807
825
  - config/initializers/assets.rb
808
826
  - config/locales/ar.yml
809
827
  - config/locales/az.yml