govuk_publishing_components 24.18.3 → 24.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +2 -1
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +14 -0
  4. data/app/assets/javascripts/govuk_publishing_components/components/details.js +6 -4
  5. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +71 -0
  6. data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +13 -2
  7. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +2 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +1 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +5 -3
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +16 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +0 -4
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +125 -0
  13. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +9 -0
  14. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss +3 -0
  15. data/app/views/govuk_publishing_components/component_guide/index.html.erb +1 -1
  16. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +5 -5
  17. data/app/views/govuk_publishing_components/components/_details.html.erb +7 -4
  18. data/app/views/govuk_publishing_components/components/_govspeak.html.erb +2 -0
  19. data/app/views/govuk_publishing_components/components/_intervention.html.erb +15 -0
  20. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +17 -12
  21. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +121 -0
  22. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +22 -22
  23. data/app/views/govuk_publishing_components/components/docs/details.yml +1 -1
  24. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +9 -0
  25. data/app/views/govuk_publishing_components/components/docs/intervention.yml +24 -0
  26. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +4 -1
  27. data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +22 -0
  28. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +3 -4
  29. data/config/locales/ar.yml +8 -0
  30. data/config/locales/az.yml +8 -0
  31. data/config/locales/be.yml +8 -0
  32. data/config/locales/bg.yml +8 -0
  33. data/config/locales/bn.yml +8 -0
  34. data/config/locales/cs.yml +8 -0
  35. data/config/locales/cy.yml +14 -6
  36. data/config/locales/da.yml +8 -0
  37. data/config/locales/de.yml +8 -0
  38. data/config/locales/dr.yml +8 -0
  39. data/config/locales/el.yml +8 -0
  40. data/config/locales/en.yml +89 -0
  41. data/config/locales/es-419.yml +8 -0
  42. data/config/locales/es.yml +8 -0
  43. data/config/locales/et.yml +8 -0
  44. data/config/locales/fa.yml +8 -0
  45. data/config/locales/fi.yml +8 -0
  46. data/config/locales/fr.yml +8 -0
  47. data/config/locales/gd.yml +8 -0
  48. data/config/locales/gu.yml +8 -0
  49. data/config/locales/he.yml +8 -0
  50. data/config/locales/hi.yml +8 -0
  51. data/config/locales/hr.yml +8 -0
  52. data/config/locales/hu.yml +8 -0
  53. data/config/locales/hy.yml +8 -0
  54. data/config/locales/id.yml +8 -0
  55. data/config/locales/is.yml +8 -0
  56. data/config/locales/it.yml +8 -0
  57. data/config/locales/ja.yml +8 -0
  58. data/config/locales/ka.yml +8 -0
  59. data/config/locales/kk.yml +8 -0
  60. data/config/locales/ko.yml +8 -0
  61. data/config/locales/lt.yml +8 -0
  62. data/config/locales/lv.yml +8 -0
  63. data/config/locales/ms.yml +8 -0
  64. data/config/locales/mt.yml +8 -0
  65. data/config/locales/nl.yml +8 -0
  66. data/config/locales/no.yml +8 -0
  67. data/config/locales/pa-pk.yml +8 -0
  68. data/config/locales/pa.yml +8 -0
  69. data/config/locales/pl.yml +8 -0
  70. data/config/locales/ps.yml +8 -0
  71. data/config/locales/pt.yml +8 -0
  72. data/config/locales/ro.yml +8 -0
  73. data/config/locales/ru.yml +8 -0
  74. data/config/locales/si.yml +8 -0
  75. data/config/locales/sk.yml +8 -0
  76. data/config/locales/sl.yml +8 -0
  77. data/config/locales/so.yml +8 -0
  78. data/config/locales/sq.yml +8 -0
  79. data/config/locales/sr.yml +8 -0
  80. data/config/locales/sv.yml +8 -0
  81. data/config/locales/sw.yml +8 -0
  82. data/config/locales/ta.yml +8 -0
  83. data/config/locales/th.yml +8 -0
  84. data/config/locales/tk.yml +8 -0
  85. data/config/locales/tr.yml +8 -0
  86. data/config/locales/uk.yml +8 -0
  87. data/config/locales/ur.yml +8 -0
  88. data/config/locales/uz.yml +8 -0
  89. data/config/locales/vi.yml +8 -0
  90. data/config/locales/zh-hk.yml +8 -0
  91. data/config/locales/zh-tw.yml +8 -0
  92. data/config/locales/zh.yml +8 -0
  93. data/lib/govuk_publishing_components/app_helpers/environment.rb +3 -8
  94. data/lib/govuk_publishing_components/presenters/meta_tags.rb +11 -4
  95. data/lib/govuk_publishing_components/version.rb +1 -1
  96. metadata +10 -2
@@ -79,6 +79,14 @@ sl:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ so:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ sq:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ sr:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ sv:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ sw:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ ta:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ th:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ tk:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ tr:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ uk:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ ur:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ uz:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ vi:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ zh-hk:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ zh-tw:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -79,6 +79,14 @@ zh:
79
79
  search_button:
80
80
  show_button:
81
81
  top_level:
82
+ layout_super_navigation_header:
83
+ logo_link_title:
84
+ logo_text:
85
+ navigation_menu_heading:
86
+ search_text:
87
+ popular_links_heading:
88
+ popular_links:
89
+ navigation_links:
82
90
  metadata:
83
91
  from:
84
92
  history:
@@ -1,19 +1,14 @@
1
1
  module GovukPublishingComponents
2
2
  module AppHelpers
3
3
  class Environment
4
- GOVUK_ENVIRONMENTS = {
5
- "production" => "production",
6
- "staging" => "staging",
7
- "integration-blue-aws" => "integration",
8
- }.freeze
4
+ GOVUK_ENVIRONMENTS = %w[integration staging production].freeze
9
5
 
10
6
  # The "acceptance environment" we're in - not the same as Rails env.
11
- #
12
- # Can be "production", "staging", "integration", or "development"
7
+ # Can be "production", "staging", "integration", "development" or "example" (if running on Heroku)
13
8
  def self.current_acceptance_environment
14
9
  return "example" if ENV["HEROKU"]
15
10
 
16
- GOVUK_ENVIRONMENTS.fetch(ENV["ERRBIT_ENVIRONMENT_NAME"], "development")
11
+ GOVUK_ENVIRONMENTS.include?(ENV["GOVUK_ENVIRONMENT_NAME"]) ? ENV["GOVUK_ENVIRONMENT_NAME"] : "development"
17
12
  end
18
13
  end
19
14
  end
@@ -21,7 +21,11 @@ module GovukPublishingComponents
21
21
  meta_tags = add_political_tags(meta_tags)
22
22
  meta_tags = add_taxonomy_tags(meta_tags)
23
23
  meta_tags = add_step_by_step_tags(meta_tags)
24
- add_brexit_tags(meta_tags)
24
+ add_brexit_tags("govuk:brexit-audience", meta_tags)
25
+ end
26
+
27
+ def brexit_priority_breadcrumb_tag
28
+ add_brexit_tags("govuk:brexit-superbreadcrumb")
25
29
  end
26
30
 
27
31
  private
@@ -112,15 +116,14 @@ module GovukPublishingComponents
112
116
  meta_tags
113
117
  end
114
118
 
115
- def add_brexit_tags(meta_tags)
119
+ def add_brexit_tags(tag_key, meta_tags = {})
116
120
  links = content_item[:links]
117
121
  taxons = links[:taxons] unless links.nil?
118
122
 
119
123
  return meta_tags if taxons.blank?
120
124
  return meta_tags unless tagged_to_priority_taxon?
121
125
 
122
- audience = priority_taxon_helper.brexit_audience
123
- meta_tags["govuk:brexit-audience"] = audience if audience.present?
126
+ meta_tags[tag_key] = brexit_audience if brexit_audience.present?
124
127
 
125
128
  meta_tags
126
129
  end
@@ -133,6 +136,10 @@ module GovukPublishingComponents
133
136
  @priority_taxon_helper ||= ContentBreadcrumbsBasedOnPriority.new(content_item.deep_stringify_keys, request.query_parameters)
134
137
  end
135
138
 
139
+ def brexit_audience
140
+ priority_taxon_helper.brexit_audience
141
+ end
142
+
136
143
  def has_content_history?
137
144
  (content_item[:public_updated_at] && details[:first_public_at] && content_item[:public_updated_at] != details[:first_public_at]) ||
138
145
  (details[:change_history] && details[:change_history].size > 1)
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.18.3".freeze
2
+ VERSION = "24.20.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.18.3
4
+ version: 24.20.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-07-06 00:00:00.000000000 Z
11
+ date: 2021-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -475,6 +475,7 @@ files:
475
475
  - app/assets/javascripts/govuk_publishing_components/components/feedback.js
476
476
  - app/assets/javascripts/govuk_publishing_components/components/govspeak.js
477
477
  - app/assets/javascripts/govuk_publishing_components/components/layout-header.js
478
+ - app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js
478
479
  - app/assets/javascripts/govuk_publishing_components/components/modal-dialogue.js
479
480
  - app/assets/javascripts/govuk_publishing_components/components/print-link.js
480
481
  - app/assets/javascripts/govuk_publishing_components/components/radio.js
@@ -546,12 +547,14 @@ files:
546
547
  - app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss
547
548
  - app/assets/stylesheets/govuk_publishing_components/components/_input.scss
548
549
  - app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss
550
+ - app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss
549
551
  - app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss
550
552
  - app/assets/stylesheets/govuk_publishing_components/components/_label.scss
551
553
  - app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss
552
554
  - app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss
553
555
  - app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss
554
556
  - app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss
557
+ - app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss
555
558
  - app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss
556
559
  - app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss
557
560
  - app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss
@@ -624,6 +627,7 @@ files:
624
627
  - app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss
625
628
  - app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss
626
629
  - app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss
630
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss
627
631
  - app/assets/stylesheets/govuk_publishing_components/components/print/_metadata.scss
628
632
  - app/assets/stylesheets/govuk_publishing_components/components/print/_search.scss
629
633
  - app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss
@@ -694,12 +698,14 @@ files:
694
698
  - app/views/govuk_publishing_components/components/_image_card.html.erb
695
699
  - app/views/govuk_publishing_components/components/_input.html.erb
696
700
  - app/views/govuk_publishing_components/components/_inset_text.html.erb
701
+ - app/views/govuk_publishing_components/components/_intervention.html.erb
697
702
  - app/views/govuk_publishing_components/components/_inverse_header.html.erb
698
703
  - app/views/govuk_publishing_components/components/_label.html.erb
699
704
  - app/views/govuk_publishing_components/components/_layout_footer.html.erb
700
705
  - app/views/govuk_publishing_components/components/_layout_for_admin.html.erb
701
706
  - app/views/govuk_publishing_components/components/_layout_for_public.html.erb
702
707
  - app/views/govuk_publishing_components/components/_layout_header.html.erb
708
+ - app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
703
709
  - app/views/govuk_publishing_components/components/_lead_paragraph.html.erb
704
710
  - app/views/govuk_publishing_components/components/_list.html.erb
705
711
  - app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb
@@ -773,12 +779,14 @@ files:
773
779
  - app/views/govuk_publishing_components/components/docs/image_card.yml
774
780
  - app/views/govuk_publishing_components/components/docs/input.yml
775
781
  - app/views/govuk_publishing_components/components/docs/inset_text.yml
782
+ - app/views/govuk_publishing_components/components/docs/intervention.yml
776
783
  - app/views/govuk_publishing_components/components/docs/inverse_header.yml
777
784
  - app/views/govuk_publishing_components/components/docs/label.yml
778
785
  - app/views/govuk_publishing_components/components/docs/layout_footer.yml
779
786
  - app/views/govuk_publishing_components/components/docs/layout_for_admin.yml
780
787
  - app/views/govuk_publishing_components/components/docs/layout_for_public.yml
781
788
  - app/views/govuk_publishing_components/components/docs/layout_header.yml
789
+ - app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml
782
790
  - app/views/govuk_publishing_components/components/docs/lead_paragraph.yml
783
791
  - app/views/govuk_publishing_components/components/docs/list.yml
784
792
  - app/views/govuk_publishing_components/components/docs/machine_readable_metadata.yml