govuk_publishing_components 24.6.1 → 24.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/application.js +3 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/details.js +2 -1
  4. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +1 -0
  5. data/app/assets/javascripts/govuk_publishing_components/modules.js +3 -1
  6. data/app/assets/stylesheets/component_guide/application.scss +1 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -4
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +10 -1
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +8 -7
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +15 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -32
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +0 -5
  13. data/app/controllers/govuk_publishing_components/audit_controller.rb +21 -17
  14. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +9 -0
  15. data/app/helpers/govuk_publishing_components/application_helper.rb +3 -0
  16. data/app/models/govuk_publishing_components/audit_applications.rb +3 -3
  17. data/app/models/govuk_publishing_components/audit_comparer.rb +16 -8
  18. data/app/models/govuk_publishing_components/audit_components.rb +6 -3
  19. data/app/views/govuk_publishing_components/audit/_applications.html.erb +126 -0
  20. data/app/views/govuk_publishing_components/audit/_components.html.erb +142 -0
  21. data/app/views/govuk_publishing_components/audit/show.html.erb +22 -277
  22. data/app/views/govuk_publishing_components/component_guide/index.html.erb +16 -0
  23. data/app/views/govuk_publishing_components/components/_image_card.html.erb +14 -11
  24. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +7 -2
  25. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +48 -7
  26. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +15 -12
  27. data/app/views/govuk_publishing_components/components/_success_alert.html.erb +24 -8
  28. data/app/views/govuk_publishing_components/components/_title.html.erb +6 -2
  29. data/app/views/govuk_publishing_components/components/docs/button.yml +7 -6
  30. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +3 -0
  31. data/app/views/govuk_publishing_components/components/docs/image_card.yml +12 -0
  32. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +26 -0
  33. data/app/views/govuk_publishing_components/components/docs/modal_dialogue.yml +3 -0
  34. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +12 -1
  35. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +8 -1
  36. data/config/locales/ar.yml +1 -0
  37. data/config/locales/az.yml +1 -0
  38. data/config/locales/be.yml +1 -0
  39. data/config/locales/bg.yml +1 -0
  40. data/config/locales/bn.yml +1 -0
  41. data/config/locales/cs.yml +1 -0
  42. data/config/locales/da.yml +1 -0
  43. data/config/locales/de.yml +1 -0
  44. data/config/locales/dr.yml +1 -0
  45. data/config/locales/el.yml +1 -0
  46. data/config/locales/en.yml +2 -0
  47. data/config/locales/es-419.yml +1 -0
  48. data/config/locales/es.yml +1 -0
  49. data/config/locales/fa.yml +1 -0
  50. data/config/locales/fi.yml +1 -0
  51. data/config/locales/gd.yml +1 -0
  52. data/config/locales/gu.yml +1 -0
  53. data/config/locales/he.yml +1 -0
  54. data/config/locales/hi.yml +1 -0
  55. data/config/locales/hr.yml +1 -0
  56. data/config/locales/hu.yml +1 -0
  57. data/config/locales/hy.yml +1 -0
  58. data/config/locales/id.yml +1 -0
  59. data/config/locales/is.yml +1 -0
  60. data/config/locales/it.yml +1 -0
  61. data/config/locales/ja.yml +1 -0
  62. data/config/locales/ka.yml +1 -0
  63. data/config/locales/kk.yml +1 -0
  64. data/config/locales/ko.yml +1 -0
  65. data/config/locales/lt.yml +1 -0
  66. data/config/locales/lv.yml +1 -0
  67. data/config/locales/ms.yml +1 -0
  68. data/config/locales/mt.yml +1 -0
  69. data/config/locales/nl.yml +1 -0
  70. data/config/locales/no.yml +1 -0
  71. data/config/locales/pa-pk.yml +1 -0
  72. data/config/locales/pa.yml +1 -0
  73. data/config/locales/pl.yml +1 -0
  74. data/config/locales/ps.yml +1 -0
  75. data/config/locales/pt.yml +1 -0
  76. data/config/locales/ro.yml +1 -0
  77. data/config/locales/ru.yml +1 -0
  78. data/config/locales/si.yml +1 -0
  79. data/config/locales/sk.yml +1 -0
  80. data/config/locales/sl.yml +1 -0
  81. data/config/locales/so.yml +1 -0
  82. data/config/locales/sq.yml +1 -0
  83. data/config/locales/sr.yml +1 -0
  84. data/config/locales/sv.yml +1 -0
  85. data/config/locales/sw.yml +1 -0
  86. data/config/locales/ta.yml +1 -0
  87. data/config/locales/th.yml +1 -0
  88. data/config/locales/tk.yml +1 -0
  89. data/config/locales/tr.yml +1 -0
  90. data/config/locales/uk.yml +1 -0
  91. data/config/locales/ur.yml +1 -0
  92. data/config/locales/uz.yml +1 -0
  93. data/config/locales/vi.yml +1 -0
  94. data/config/locales/zh-hk.yml +1 -0
  95. data/config/locales/zh-tw.yml +1 -0
  96. data/config/locales/zh.yml +1 -0
  97. data/lib/govuk_publishing_components/presenters/button_helper.rb +13 -2
  98. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +5 -4
  99. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +15 -31
  100. data/lib/govuk_publishing_components/presenters/shared_helper.rb +10 -0
  101. data/lib/govuk_publishing_components/version.rb +1 -1
  102. metadata +68 -6
@@ -0,0 +1 @@
1
+ el:
@@ -100,6 +100,8 @@ en:
100
100
  hide_password: "Hide password"
101
101
  announce_show: "Your password is shown"
102
102
  announce_hide: "Your password is hidden"
103
+ success_alert:
104
+ success: "Success"
103
105
  print_link:
104
106
  text: "Print this page"
105
107
  skip_link:
@@ -0,0 +1 @@
1
+ es-419:
@@ -0,0 +1 @@
1
+ es:
@@ -0,0 +1 @@
1
+ fa:
@@ -0,0 +1 @@
1
+ fi:
@@ -0,0 +1 @@
1
+ gd:
@@ -0,0 +1 @@
1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text]
32
32
  @info_text_classes = %w[gem-c-button__info-text]
33
33
  if local_assigns[:margin_bottom]
34
- @info_text_classes << "gem-c-button__info-text--bottom-margin"
34
+ margin_class = get_margin_bottom(local_assigns[:margin_bottom], true)
35
+ @info_text_classes << margin_class
35
36
  end
36
37
  @rel = local_assigns[:rel]
37
38
  @data_attributes = local_assigns[:data_attributes]
@@ -81,11 +82,21 @@ module GovukPublishingComponents
81
82
  css_classes << "gem-c-button--secondary-quiet" if secondary_quiet
82
83
  css_classes << "govuk-button--secondary" if secondary_solid
83
84
  css_classes << "govuk-button--warning" if destructive
84
- css_classes << "gem-c-button--bottom-margin" if margin_bottom && !info_text
85
+ if margin_bottom && !info_text
86
+ margin_class = get_margin_bottom(margin_bottom, false)
87
+ css_classes << margin_class
88
+ end
85
89
  css_classes << "gem-c-button--inline" if inline_layout
86
90
  css_classes << classes if classes
87
91
  css_classes.join(" ")
88
92
  end
93
+
94
+ def get_margin_bottom(margin, info_text)
95
+ legacy_class = "gem-c-button--bottom-margin"
96
+ legacy_class = "gem-c-button__info-text--bottom-margin" if info_text
97
+
98
+ [*0..9].include?(margin) ? "govuk-!-margin-bottom-#{margin}" : legacy_class
99
+ end
89
100
  end
90
101
  end
91
102
  end
@@ -206,8 +206,6 @@ module GovukPublishingComponents
206
206
  # Environment
207
207
  # International
208
208
  # Defence and armed forces
209
- # Society and culture
210
- # Government
211
209
  # Work
212
210
  # Welfare
213
211
  # Money
@@ -225,8 +223,6 @@ module GovukPublishingComponents
225
223
  3cf97f69-84de-41ae-bc7b-7e2cc238fa58
226
224
  37d0fa26-abed-4c74-8835-b3b51ae1c8b2
227
225
  e491505c-77ae-45b2-84be-8c94b94f6a2b
228
- e2ca2f1a-0ff3-43ce-b813-16645ff27904
229
- e48ab80a-de80-4e83-bf59-26316856a5f9
230
226
  d0f1e5a3-c8f4-4780-8678-994f19104b21
231
227
  dded88e2-f92e-424f-b73e-6ad24a839c51
232
228
  6acc9db4-780e-4a46-92b4-1812e3c2c48a
@@ -249,6 +245,10 @@ module GovukPublishingComponents
249
245
  false
250
246
  end
251
247
 
248
+ def brexit_cta_lang_allow_list?
249
+ %w[en cy].include?(content_item["locale"])
250
+ end
251
+
252
252
  def parent_taxon_include?(taxon, taxon_list)
253
253
  if taxon.present?
254
254
  if taxon.dig("links", "parent_taxons").to_a.any? { |taxon_item| taxon_list.include?(taxon_item["content_id"]) }
@@ -294,6 +294,7 @@ module GovukPublishingComponents
294
294
 
295
295
  def show_brexit_cta?
296
296
  brexit_cta_taxon_allow_list? &&
297
+ brexit_cta_lang_allow_list? &&
297
298
  step_by_step_count.zero? &&
298
299
  !brexit_cta_exception?
299
300
  end
@@ -3,50 +3,34 @@ module GovukPublishingComponents
3
3
  class PublicLayoutHelper
4
4
  FOOTER_NAV = [
5
5
  {
6
- title: "Prepare for Brexit",
6
+ title: "Coronavirus (COVID-19)",
7
7
  columns: 2,
8
8
  items: [
9
9
  {
10
- href: "/business-uk-leaving-eu",
11
- text: "Prepare your business or organisation for Brexit",
10
+ href: "/coronavirus",
11
+ text: "Coronavirus (COVID-19): guidance and support",
12
12
  attributes: {
13
13
  data: {
14
14
  track_category: "footerClicked",
15
- track_action: "brexitLinks",
16
- track_label: "Prepare your business or organisation for the UK leaving the EU",
17
- },
18
- },
19
- },
20
- {
21
- href: "/prepare-eu-exit",
22
- text: "Prepare for Brexit if you live in the UK",
23
- attributes: {
24
- data: {
25
- track_category: "footerClicked",
26
- track_action: "brexitLinks",
27
- track_label: "Prepare for Brexit if you live in the UK",
28
- },
29
- },
30
- },
31
- {
32
- href: "/uk-nationals-living-eu",
33
- text: "Living in Europe after Brexit",
34
- attributes: {
35
- data: {
36
- track_category: "footerClicked",
37
- track_action: "brexitLinks",
38
- track_label: "Living in Europe after Brexit",
15
+ track_action: "coronavirusLinks",
16
+ track_label: "Coronavirus (COVID-19): guidance and support",
39
17
  },
40
18
  },
41
19
  },
20
+ ],
21
+ },
22
+ {
23
+ title: "Brexit",
24
+ columns: 1,
25
+ items: [
42
26
  {
43
- href: "/staying-uk-eu-citizen",
44
- text: "Continue to live in the UK after Brexit",
27
+ href: "/transition",
28
+ text: "Check what you need to do",
45
29
  attributes: {
46
30
  data: {
47
31
  track_category: "footerClicked",
48
- track_action: "brexitLinks",
49
- track_label: "Continue to live in the UK after Brexit",
32
+ track_action: "transitionLinks",
33
+ track_label: "Check what you need to do",
50
34
  },
51
35
  },
52
36
  },
@@ -31,6 +31,16 @@ module GovukPublishingComponents
31
31
  "span"
32
32
  end
33
33
 
34
+ def get_heading_size(option, fallback)
35
+ govuk_class = "govuk-heading-"
36
+
37
+ if %w[xl l m s].include? option
38
+ "#{govuk_class}#{option}"
39
+ else
40
+ "#{govuk_class}#{fallback}"
41
+ end
42
+ end
43
+
34
44
  def t_locale(content, options = {})
35
45
  # Check if the content string has a translation
36
46
  content_translation_available = translation_present?(content)
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.6.1".freeze
2
+ VERSION = "24.9.1".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.6.1
4
+ version: 24.9.1
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-03-16 00:00:00.000000000 Z
11
+ date: 2021-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 3.6.0
173
+ version: 3.7.0
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 3.6.0
180
+ version: 3.7.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: jasmine_selenium_runner
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '4.0'
229
+ version: '5.0'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '4.0'
236
+ version: '5.0'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: rubocop-govuk
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -592,6 +592,8 @@ files:
592
592
  - app/models/govuk_publishing_components/component_docs.rb
593
593
  - app/models/govuk_publishing_components/component_example.rb
594
594
  - app/models/govuk_publishing_components/shared_accessibility_criteria.rb
595
+ - app/views/govuk_publishing_components/audit/_applications.html.erb
596
+ - app/views/govuk_publishing_components/audit/_components.html.erb
595
597
  - app/views/govuk_publishing_components/audit/show.html.erb
596
598
  - app/views/govuk_publishing_components/component_guide/_application_stylesheet.html.erb
597
599
  - app/views/govuk_publishing_components/component_guide/component_doc/_call.html.erb
@@ -766,10 +768,70 @@ files:
766
768
  - app/views/govuk_publishing_components/components/related_navigation/_section.html.erb
767
769
  - app/views/layouts/govuk_publishing_components/application.html.erb
768
770
  - config/initializers/assets.rb
771
+ - config/locales/ar.yml
772
+ - config/locales/az.yml
773
+ - config/locales/be.yml
774
+ - config/locales/bg.yml
775
+ - config/locales/bn.yml
776
+ - config/locales/cs.yml
769
777
  - config/locales/cy.yml
778
+ - config/locales/da.yml
779
+ - config/locales/de.yml
780
+ - config/locales/dr.yml
781
+ - config/locales/el.yml
770
782
  - config/locales/en.yml
783
+ - config/locales/es-419.yml
784
+ - config/locales/es.yml
771
785
  - config/locales/et.yml
786
+ - config/locales/fa.yml
787
+ - config/locales/fi.yml
772
788
  - config/locales/fr.yml
789
+ - config/locales/gd.yml
790
+ - config/locales/gu.yml
791
+ - config/locales/he.yml
792
+ - config/locales/hi.yml
793
+ - config/locales/hr.yml
794
+ - config/locales/hu.yml
795
+ - config/locales/hy.yml
796
+ - config/locales/id.yml
797
+ - config/locales/is.yml
798
+ - config/locales/it.yml
799
+ - config/locales/ja.yml
800
+ - config/locales/ka.yml
801
+ - config/locales/kk.yml
802
+ - config/locales/ko.yml
803
+ - config/locales/lt.yml
804
+ - config/locales/lv.yml
805
+ - config/locales/ms.yml
806
+ - config/locales/mt.yml
807
+ - config/locales/nl.yml
808
+ - config/locales/no.yml
809
+ - config/locales/pa-pk.yml
810
+ - config/locales/pa.yml
811
+ - config/locales/pl.yml
812
+ - config/locales/ps.yml
813
+ - config/locales/pt.yml
814
+ - config/locales/ro.yml
815
+ - config/locales/ru.yml
816
+ - config/locales/si.yml
817
+ - config/locales/sk.yml
818
+ - config/locales/sl.yml
819
+ - config/locales/so.yml
820
+ - config/locales/sq.yml
821
+ - config/locales/sr.yml
822
+ - config/locales/sv.yml
823
+ - config/locales/sw.yml
824
+ - config/locales/ta.yml
825
+ - config/locales/th.yml
826
+ - config/locales/tk.yml
827
+ - config/locales/tr.yml
828
+ - config/locales/uk.yml
829
+ - config/locales/ur.yml
830
+ - config/locales/uz.yml
831
+ - config/locales/vi.yml
832
+ - config/locales/zh-hk.yml
833
+ - config/locales/zh-tw.yml
834
+ - config/locales/zh.yml
773
835
  - config/routes.rb
774
836
  - lib/generators/govuk_publishing_components/USAGE
775
837
  - lib/generators/govuk_publishing_components/component_generator.rb