govuk_publishing_components 24.14.1 → 24.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,7 @@
17
17
  transparent_icon ||= false
18
18
  data ||= nil
19
19
  classes ||= nil
20
+ font_size ||= nil
20
21
 
21
22
  css_classes = %w(gem-c-action-link)
22
23
  css_classes << "gem-c-action-link--light-text" if light_text
@@ -33,6 +34,7 @@
33
34
  link_classes = %w(govuk-link gem-c-action-link__link)
34
35
  link_classes << shared_helper.classes if classes
35
36
  link_classes << "govuk-link--inverse" if light_text
37
+ link_classes << shared_helper.get_heading_size(font_size, 'm') if font_size
36
38
  %>
37
39
  <% if text.present? %>
38
40
  <div class="<%= css_classes.join(' ') %>">
@@ -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_custom_font_size:
105
+ data:
106
+ text: Guidance for businesses
107
+ href: "/guidance-for-businesses"
108
+ dark_icon: true
109
+ font_size: m
104
110
  with_nhs_icon:
105
111
  data:
106
112
  text: Something about the NHS
@@ -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.14.1".freeze
2
+ VERSION = "24.16.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.14.1
4
+ version: 24.16.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-15 00:00:00.000000000 Z
11
+ date: 2021-06-25 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
@@ -804,6 +818,7 @@ files:
804
818
  - app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
805
819
  - app/views/govuk_publishing_components/components/related_navigation/_section.html.erb
806
820
  - app/views/layouts/govuk_publishing_components/application.html.erb
821
+ - config/i18n-tasks.yml
807
822
  - config/initializers/assets.rb
808
823
  - config/locales/ar.yml
809
824
  - config/locales/az.yml