govuk_publishing_components 28.8.0 → 28.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  3. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +1 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +2 -1
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +102 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +1 -6
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +2 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/print/_cards.scss +4 -0
  10. data/app/models/govuk_publishing_components/component_docs.rb +4 -1
  11. data/app/views/govuk_publishing_components/components/_cards.html.erb +62 -0
  12. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +2 -2
  13. data/app/views/govuk_publishing_components/components/contextual_sidebar/{_brexit_cta.html.erb → _ukraine_cta.html.erb} +6 -6
  14. data/app/views/govuk_publishing_components/components/docs/cards.yml +139 -0
  15. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +12 -21
  16. data/config/locales/ar.yml +4 -0
  17. data/config/locales/az.yml +4 -0
  18. data/config/locales/be.yml +4 -0
  19. data/config/locales/bg.yml +4 -0
  20. data/config/locales/bn.yml +4 -0
  21. data/config/locales/cs.yml +4 -0
  22. data/config/locales/cy.yml +4 -0
  23. data/config/locales/da.yml +4 -0
  24. data/config/locales/de.yml +4 -0
  25. data/config/locales/dr.yml +4 -0
  26. data/config/locales/el.yml +4 -0
  27. data/config/locales/en.yml +6 -2
  28. data/config/locales/es-419.yml +4 -0
  29. data/config/locales/es.yml +4 -0
  30. data/config/locales/et.yml +4 -0
  31. data/config/locales/fa.yml +4 -0
  32. data/config/locales/fi.yml +4 -0
  33. data/config/locales/fr.yml +4 -0
  34. data/config/locales/gd.yml +4 -0
  35. data/config/locales/gu.yml +4 -0
  36. data/config/locales/he.yml +4 -0
  37. data/config/locales/hi.yml +4 -0
  38. data/config/locales/hr.yml +4 -0
  39. data/config/locales/hu.yml +4 -0
  40. data/config/locales/hy.yml +4 -0
  41. data/config/locales/id.yml +4 -0
  42. data/config/locales/is.yml +4 -0
  43. data/config/locales/it.yml +4 -0
  44. data/config/locales/ja.yml +4 -0
  45. data/config/locales/ka.yml +4 -0
  46. data/config/locales/kk.yml +4 -0
  47. data/config/locales/ko.yml +4 -0
  48. data/config/locales/lt.yml +4 -0
  49. data/config/locales/lv.yml +4 -0
  50. data/config/locales/ms.yml +4 -0
  51. data/config/locales/mt.yml +4 -0
  52. data/config/locales/nl.yml +4 -0
  53. data/config/locales/no.yml +4 -0
  54. data/config/locales/pa-pk.yml +4 -0
  55. data/config/locales/pa.yml +4 -0
  56. data/config/locales/pl.yml +4 -0
  57. data/config/locales/ps.yml +4 -0
  58. data/config/locales/pt.yml +4 -0
  59. data/config/locales/ro.yml +4 -0
  60. data/config/locales/ru.yml +4 -0
  61. data/config/locales/si.yml +4 -0
  62. data/config/locales/sk.yml +4 -0
  63. data/config/locales/sl.yml +4 -0
  64. data/config/locales/so.yml +4 -0
  65. data/config/locales/sq.yml +4 -0
  66. data/config/locales/sr.yml +4 -0
  67. data/config/locales/sv.yml +4 -0
  68. data/config/locales/sw.yml +4 -0
  69. data/config/locales/ta.yml +4 -0
  70. data/config/locales/th.yml +4 -0
  71. data/config/locales/tk.yml +4 -0
  72. data/config/locales/tr.yml +4 -0
  73. data/config/locales/uk.yml +4 -0
  74. data/config/locales/ur.yml +4 -0
  75. data/config/locales/uz.yml +4 -0
  76. data/config/locales/vi.yml +4 -0
  77. data/config/locales/zh-hk.yml +4 -0
  78. data/config/locales/zh-tw.yml +4 -0
  79. data/config/locales/zh.yml +4 -0
  80. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +16 -45
  81. data/lib/govuk_publishing_components/version.rb +1 -1
  82. metadata +7 -17
@@ -108,51 +108,6 @@ module GovukPublishingComponents
108
108
  false
109
109
  end
110
110
 
111
- def brexit_cta_taxon_allow_list
112
- # Overseas businesses: exporting to the UK
113
- # Exporting goods and services
114
- # Exporting
115
- # Manufacturing, wholesaling, importing and exporting medicines
116
- # Importing goods and services
117
- # Importing
118
- # Manufacturing, wholesaling, importing and exporting medicines
119
- %w[
120
- 2f8b848d-23c8-4f42-a41a-df1f81c64d0f
121
- 8af13fba-d969-4d87-a02e-2e71783d47be
122
- efa9782b-a3d0-4ca0-9c92-3b89748175b7
123
- f441e630-2bba-4bbd-8c1b-22ae61cc00c2
124
- 4788b4b8-2642-47ca-bfc2-bd7e8705a1da
125
- d74faafc-781d-4087-8e0c-be4216180059
126
- f441e630-2bba-4bbd-8c1b-22ae61cc00c2
127
- ]
128
- end
129
-
130
- def brexit_cta_taxon_allow_list?
131
- taxons = content_item.dig("links", "taxons").to_a
132
- taxons.each do |taxon|
133
- if brexit_cta_taxon_allow_list.include?(taxon["content_id"]) || parent_taxon_include?(taxon, brexit_cta_taxon_allow_list)
134
- return true
135
- end
136
- end
137
- false
138
- end
139
-
140
- def parent_taxon_include?(taxon, taxon_list)
141
- if taxon.present?
142
- if taxon.dig("links", "parent_taxons").to_a.any? { |taxon_item| taxon_list.include?(taxon_item["content_id"]) }
143
- return true
144
- end
145
-
146
- taxon.dig("links", "parent_taxons").to_a.any? { |taxon_item| parent_taxon_include?(taxon_item, taxon_list) }
147
- else
148
- false
149
- end
150
- end
151
-
152
- def show_brexit_cta?
153
- brexit_cta_taxon_allow_list?
154
- end
155
-
156
111
  def content_tagged_to_current_step_by_step?
157
112
  # TODO: remove indirection here
158
113
  step_nav_helper.show_header?
@@ -166,6 +121,22 @@ module GovukPublishingComponents
166
121
  step_nav_helper.show_also_part_of_step_nav?
167
122
  end
168
123
 
124
+ def content_tagged_to_ukraine_topical_event?
125
+ ukraine_topical_event_id = "bfa79635-ffda-4b5d-8266-a9cd3a03649c"
126
+ topical_events = content_item.dig("links", "topical_events").to_a
127
+ topical_events.each do |topical_event|
128
+ if topical_event["content_id"].eql?(ukraine_topical_event_id)
129
+ return true
130
+ end
131
+ end
132
+
133
+ false
134
+ end
135
+
136
+ def show_ukraine_cta?
137
+ content_tagged_to_ukraine_topical_event?
138
+ end
139
+
169
140
  def breadcrumbs_based_on_ancestors
170
141
  ContentBreadcrumbsBasedOnAncestors.call(content_item)
171
142
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "28.8.0".freeze
2
+ VERSION = "28.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: 28.8.0
4
+ version: 28.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: 2022-03-02 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: psych
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '4'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '4'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rails
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -529,6 +515,7 @@ files:
529
515
  - app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss
530
516
  - app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss
531
517
  - app/assets/stylesheets/govuk_publishing_components/components/_button.scss
518
+ - app/assets/stylesheets/govuk_publishing_components/components/_cards.scss
532
519
  - app/assets/stylesheets/govuk_publishing_components/components/_character-count.scss
533
520
  - app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss
534
521
  - app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss
@@ -626,6 +613,7 @@ files:
626
613
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_prefixed-transform.scss
627
614
  - app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss
628
615
  - app/assets/stylesheets/govuk_publishing_components/components/print/_button.scss
616
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_cards.scss
629
617
  - app/assets/stylesheets/govuk_publishing_components/components/print/_contents-list.scss
630
618
  - app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss
631
619
  - app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss
@@ -667,6 +655,7 @@ files:
667
655
  - app/views/govuk_publishing_components/components/_big_number.html.erb
668
656
  - app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
669
657
  - app/views/govuk_publishing_components/components/_button.html.erb
658
+ - app/views/govuk_publishing_components/components/_cards.html.erb
670
659
  - app/views/govuk_publishing_components/components/_character_count.html.erb
671
660
  - app/views/govuk_publishing_components/components/_checkboxes.html.erb
672
661
  - app/views/govuk_publishing_components/components/_contents_list.html.erb
@@ -739,7 +728,7 @@ files:
739
728
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_document.html.erb
740
729
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_generic.html.erb
741
730
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_spreadsheet.html.erb
742
- - app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
731
+ - app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb
743
732
  - app/views/govuk_publishing_components/components/docs/accordion.yml
744
733
  - app/views/govuk_publishing_components/components/docs/action_link.yml
745
734
  - app/views/govuk_publishing_components/components/docs/attachment.yml
@@ -748,6 +737,7 @@ files:
748
737
  - app/views/govuk_publishing_components/components/docs/big_number.yml
749
738
  - app/views/govuk_publishing_components/components/docs/breadcrumbs.yml
750
739
  - app/views/govuk_publishing_components/components/docs/button.yml
740
+ - app/views/govuk_publishing_components/components/docs/cards.yml
751
741
  - app/views/govuk_publishing_components/components/docs/character_count.yml
752
742
  - app/views/govuk_publishing_components/components/docs/checkboxes.yml
753
743
  - app/views/govuk_publishing_components/components/docs/contents_list.yml