govuk_publishing_components 24.5.0 → 24.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) 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/accordion.js +7 -5
  4. data/app/assets/javascripts/govuk_publishing_components/components/details.js +2 -1
  5. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +1 -0
  6. data/app/assets/javascripts/govuk_publishing_components/modules.js +3 -1
  7. data/app/assets/stylesheets/component_guide/application.scss +1 -1
  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/_summary-list.scss +12 -0
  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/_layout_footer.html.erb +7 -2
  24. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +48 -7
  25. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +15 -12
  26. data/app/views/govuk_publishing_components/components/_summary_list.html.erb +18 -13
  27. data/app/views/govuk_publishing_components/components/_title.html.erb +6 -2
  28. data/app/views/govuk_publishing_components/components/docs/button.yml +7 -6
  29. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +3 -0
  30. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +26 -0
  31. data/app/views/govuk_publishing_components/components/docs/summary_list.yml +50 -19
  32. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +8 -1
  33. data/config/locales/ar.yml +1 -0
  34. data/config/locales/az.yml +1 -0
  35. data/config/locales/be.yml +1 -0
  36. data/config/locales/bg.yml +1 -0
  37. data/config/locales/bn.yml +1 -0
  38. data/config/locales/cs.yml +1 -0
  39. data/config/locales/da.yml +1 -0
  40. data/config/locales/de.yml +1 -0
  41. data/config/locales/dr.yml +1 -0
  42. data/config/locales/el.yml +1 -0
  43. data/config/locales/es-419.yml +1 -0
  44. data/config/locales/es.yml +1 -0
  45. data/config/locales/fa.yml +1 -0
  46. data/config/locales/fi.yml +1 -0
  47. data/config/locales/gd.yml +1 -0
  48. data/config/locales/gu.yml +1 -0
  49. data/config/locales/he.yml +1 -0
  50. data/config/locales/hi.yml +1 -0
  51. data/config/locales/hr.yml +1 -0
  52. data/config/locales/hu.yml +1 -0
  53. data/config/locales/hy.yml +1 -0
  54. data/config/locales/id.yml +1 -0
  55. data/config/locales/is.yml +1 -0
  56. data/config/locales/it.yml +1 -0
  57. data/config/locales/ja.yml +1 -0
  58. data/config/locales/ka.yml +1 -0
  59. data/config/locales/kk.yml +1 -0
  60. data/config/locales/ko.yml +1 -0
  61. data/config/locales/lt.yml +1 -0
  62. data/config/locales/lv.yml +1 -0
  63. data/config/locales/ms.yml +1 -0
  64. data/config/locales/mt.yml +1 -0
  65. data/config/locales/nl.yml +1 -0
  66. data/config/locales/no.yml +1 -0
  67. data/config/locales/pa-pk.yml +1 -0
  68. data/config/locales/pa.yml +1 -0
  69. data/config/locales/pl.yml +1 -0
  70. data/config/locales/ps.yml +1 -0
  71. data/config/locales/pt.yml +1 -0
  72. data/config/locales/ro.yml +1 -0
  73. data/config/locales/ru.yml +1 -0
  74. data/config/locales/si.yml +1 -0
  75. data/config/locales/sk.yml +1 -0
  76. data/config/locales/sl.yml +1 -0
  77. data/config/locales/so.yml +1 -0
  78. data/config/locales/sq.yml +1 -0
  79. data/config/locales/sr.yml +1 -0
  80. data/config/locales/sv.yml +1 -0
  81. data/config/locales/sw.yml +1 -0
  82. data/config/locales/ta.yml +1 -0
  83. data/config/locales/th.yml +1 -0
  84. data/config/locales/tk.yml +1 -0
  85. data/config/locales/tr.yml +1 -0
  86. data/config/locales/uk.yml +1 -0
  87. data/config/locales/ur.yml +1 -0
  88. data/config/locales/uz.yml +1 -0
  89. data/config/locales/vi.yml +1 -0
  90. data/config/locales/zh-hk.yml +1 -0
  91. data/config/locales/zh-tw.yml +1 -0
  92. data/config/locales/zh.yml +1 -0
  93. data/lib/govuk_publishing_components/presenters/button_helper.rb +13 -2
  94. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +5 -0
  95. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +15 -31
  96. data/lib/govuk_publishing_components/version.rb +1 -1
  97. metadata +68 -6
@@ -0,0 +1 @@
1
+ ar:
@@ -0,0 +1 @@
1
+ az:
@@ -0,0 +1 @@
1
+ be:
@@ -0,0 +1 @@
1
+ bg:
@@ -0,0 +1 @@
1
+ bn:
@@ -0,0 +1 @@
1
+ cs:
@@ -0,0 +1 @@
1
+ da:
@@ -0,0 +1 @@
1
+ de:
@@ -0,0 +1 @@
1
+ dr:
@@ -0,0 +1 @@
1
+ el:
@@ -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
+ gu:
@@ -0,0 +1 @@
1
+ he:
@@ -0,0 +1 @@
1
+ hi:
@@ -0,0 +1 @@
1
+ hr:
@@ -0,0 +1 @@
1
+ hu:
@@ -0,0 +1 @@
1
+ hy:
@@ -0,0 +1 @@
1
+ id:
@@ -0,0 +1 @@
1
+ is:
@@ -0,0 +1 @@
1
+ it:
@@ -0,0 +1 @@
1
+ ja:
@@ -0,0 +1 @@
1
+ ka:
@@ -0,0 +1 @@
1
+ kk:
@@ -0,0 +1 @@
1
+ ko:
@@ -0,0 +1 @@
1
+ lt:
@@ -0,0 +1 @@
1
+ lv:
@@ -0,0 +1 @@
1
+ ms:
@@ -0,0 +1 @@
1
+ mt:
@@ -0,0 +1 @@
1
+ nl:
@@ -0,0 +1 @@
1
+ "no":
@@ -0,0 +1 @@
1
+ pa-pk:
@@ -0,0 +1 @@
1
+ pa:
@@ -0,0 +1 @@
1
+ pl:
@@ -0,0 +1 @@
1
+ ps:
@@ -0,0 +1 @@
1
+ pt:
@@ -0,0 +1 @@
1
+ ro:
@@ -0,0 +1 @@
1
+ ru:
@@ -0,0 +1 @@
1
+ si:
@@ -0,0 +1 @@
1
+ sk:
@@ -0,0 +1 @@
1
+ sl:
@@ -0,0 +1 @@
1
+ so:
@@ -0,0 +1 @@
1
+ sq:
@@ -0,0 +1 @@
1
+ sr:
@@ -0,0 +1 @@
1
+ sv:
@@ -0,0 +1 @@
1
+ sw:
@@ -0,0 +1 @@
1
+ ta:
@@ -0,0 +1 @@
1
+ th:
@@ -0,0 +1 @@
1
+ tk:
@@ -0,0 +1 @@
1
+ tr:
@@ -0,0 +1 @@
1
+ uk:
@@ -0,0 +1 @@
1
+ ur:
@@ -0,0 +1 @@
1
+ uz:
@@ -0,0 +1 @@
1
+ vi:
@@ -0,0 +1 @@
1
+ zh-hk:
@@ -0,0 +1 @@
1
+ zh-tw:
@@ -0,0 +1 @@
1
+ zh:
@@ -31,7 +31,8 @@ module GovukPublishingComponents
31
31
  @info_text = local_assigns[:info_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
@@ -249,6 +249,10 @@ module GovukPublishingComponents
249
249
  false
250
250
  end
251
251
 
252
+ def brexit_cta_lang_allow_list?
253
+ %w[en cy].include?(content_item["locale"])
254
+ end
255
+
252
256
  def parent_taxon_include?(taxon, taxon_list)
253
257
  if taxon.present?
254
258
  if taxon.dig("links", "parent_taxons").to_a.any? { |taxon_item| taxon_list.include?(taxon_item["content_id"]) }
@@ -294,6 +298,7 @@ module GovukPublishingComponents
294
298
 
295
299
  def show_brexit_cta?
296
300
  brexit_cta_taxon_allow_list? &&
301
+ brexit_cta_lang_allow_list? &&
297
302
  step_by_step_count.zero? &&
298
303
  !brexit_cta_exception?
299
304
  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
  },
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.5.0".freeze
2
+ VERSION = "24.8.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.5.0
4
+ version: 24.8.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-03-10 00:00:00.000000000 Z
11
+ date: 2021-03-29 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