govuk_publishing_components 27.7.0 → 27.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15c7bcc4d82cf3b301b7b7ba021e1bb3de52fcd8834526953c559ec6dee2c50e
4
- data.tar.gz: 46ed67c901b6561008e808d60b42d67c5c0ff6555d47ea25eb94dfb5e89e0543
3
+ metadata.gz: a177d643883dea8f63ce0c6931e9170ab46e4d50e3499b430c9a67ddb84cb2ca
4
+ data.tar.gz: e9b25ea90b6d0fd6269df2acf19a8d724884635ad0dbd84b4279e574737a30ac
5
5
  SHA512:
6
- metadata.gz: f8b1714ed5784b5e37882f50855cb5ebe51c9fa334ed3214a7b3a8703efc5dfa97cabc62c5a69f5cda8ff8047ad09eb6e8869cc525d8fb782099c2b376d20ab4
7
- data.tar.gz: ff89e8308d97f9a46ca3246e6978ea3fe24fca5852b3dac2f11f5b5822b1ac3bb7d116afe40cde48341e420347075ff52517cfd97cdb845c044a03ace9b18194
6
+ metadata.gz: b1279ab602818802cf978a9742a8ba40ccdeef9478307c8f724dfa9d8b024ba33945b7dd8eaaa1f758f48c6a70d61957a3b1936db692d04b4c5fb439a7d7bc2d
7
+ data.tar.gz: 81a267c76307c65fc8a0cca680d82421e18e9e494a1d3a31b252563a05d6b88b38c3d1bb60c1b66bac958f7be668b918b2b9aab53b19f94ab599512e7bd6a5e8
data/README.md CHANGED
@@ -47,6 +47,7 @@ bin/rake app:jasmine:ci
47
47
  - [Code documentation on rubydoc.info](http://www.rubydoc.info/gems/govuk_publishing_components)
48
48
  - [Component conventions](docs/component_conventions.md)
49
49
  - [Component principles](docs/component_principles.md)
50
+ - [Component auditing](docs/auditing.md)
50
51
 
51
52
  ## Licence
52
53
 
@@ -58,13 +58,6 @@
58
58
  '/guidance/foreign-travel-insurance': [
59
59
  ['Heading', 'What your travel insurance policy should cover']
60
60
  ],
61
- '/guidance/social-security-contributions-for-uk-and-eu-workers-if-the-uk-leaves-the-eu-with-no-deal': [
62
- ['Heading', 'UK employers'],
63
- ['Heading', 'UK employees and self-employed']
64
- ],
65
- '/guidance/student-finance-arrangements-in-a-no-deal-scenario': [
66
- ['Heading', 'Other overseas study placements']
67
- ],
68
61
  '/guidance/living-in-france': [
69
62
  ['Heading', 'Passports and travel']
70
63
  ],
@@ -74,12 +67,6 @@
74
67
  '/guidance/healthcare-for-eu-and-efta-citizens-visiting-the-uk': [
75
68
  ['Heading', 'Travel insurance']
76
69
  ],
77
- '/guidance/driving-in-the-eu-after-brexit': [
78
- ['Heading', 'GB stickers and number plates']
79
- ],
80
- '/guidance/driving-in-the-eu-after-brexit#insurance-for-your-vehicle-caravan-or-trailer': [
81
- ['Heading', 'Trailer registration']
82
- ],
83
70
  '/driving-abroad': [
84
71
  ['Heading', 'Check your insurance if you’re taking your own vehicle']
85
72
  ],
@@ -89,57 +76,15 @@
89
76
  '/driving-abroad/international-driving-permit': [
90
77
  ['Heading', 'Check which IDP you need']
91
78
  ],
92
- '/guidance/driving-in-the-eu-after-brexit#gb-stickers-and-number-plates': [
93
- ['Heading', 'GB stickers and number plates']
94
- ],
95
79
  '/guidance/guidance-for-suppliers-of-cattle-sheep-and-goat-ear-tags': [
96
80
  ['Heading', 'Tagging information for livestock keepers']
97
81
  ],
98
- '/guidance/wine-trade-regulations': [
99
- ['Heading', 'Rules for transporting wine into the UK']
100
- ],
101
- '/guidance/the-chemicals-sector-and-preparing-for-eu-exit': [
102
- ['Heading', 'Energy and climate']
103
- ],
104
82
  '/guidance/how-to-move-goods-between-or-through-common-transit-countries-including-the-eu': [
105
83
  ['Heading', 'Start moving your goods']
106
84
  ],
107
85
  '/guidance/ecmt-international-road-haulage-permits': [
108
86
  ['Heading', 'Apply for permits']
109
87
  ],
110
- '/guidance/prepare-to-drive-in-the-eu-after-brexit-lorry-and-goods-vehicle-drivers': [
111
- ['Heading', 'Driver CPC for lorry drivers']
112
- ],
113
- '/guidance/run-international-bus-or-coach-services-after-brexit': [
114
- ['Heading', 'Run regular international services']
115
- ],
116
- '/guidance/vehicle-type-approval-if-theres-no-brexit-deal': [
117
- ['Heading', 'Existing vehicle and component type-approvals']
118
- ],
119
- '/guidance/the-retail-sector-and-preparing-for-eu-exit': [
120
- ['Heading', 'Importing and exporting']
121
- ],
122
- '/guidance/the-consumer-goods-sector-and-preparing-for-eu-exit': [
123
- ['Heading', 'Importing and exporting']
124
- ],
125
- '/government/publications/banking-insurance-and-other-financial-services-if-theres-no-brexit-deal/banking-insurance-and-other-financial-services-if-theres-no-brexit-deal-information-for-financial-services-institutions': [
126
- ['Heading', '3. Action taken by the UK']
127
- ],
128
- '/government/publications/further-guidance-note-on-the-regulation-of-medicines-medical-devices-and-clinical-trials-if-theres-no-brexit-deal/further-guidance-note-on-the-regulation-of-medicines-medical-devices-and-clinical-trials-if-theres-no-brexit-deal': [
129
- ['Heading', '1.4 Orphan medicines']
130
- ],
131
- '/guidance/check-temporary-rates-of-customs-duty-on-imports-after-eu-exit': [
132
- ['Heading', 'Tariff-rate quotas (TRQ)']
133
- ],
134
- '/guidance/construction-products-regulation-if-there-is-no-brexit-deal': [
135
- ['Heading', 'UK manufacturers exporting to the EU']
136
- ],
137
- '/guidance/european-and-domestic-funding-after-brexit': [
138
- ['Heading', 'What you need to do']
139
- ],
140
- '/guidance/guidance-on-substantial-amendments-to-a-clinical-trial-if-the-uk-leaves-the-eu-with-no-deal': [
141
- ['Heading', 'Investigational medicinal product (IMP) certification and importation']
142
- ],
143
88
  '/taking-goods-out-uk-temporarily/get-an-ata-carnet': [
144
89
  ['Heading', 'Using an ATA Carnet']
145
90
  ],
@@ -94,13 +94,19 @@
94
94
 
95
95
  .gem-c-action-link--blue-arrow {
96
96
  &:before {
97
- width: 45px;
98
- height: 35px;
97
+ width: 36px;
98
+ height: 28px;
99
99
  background: image-url("govuk_publishing_components/action-link-arrow--blue.png");
100
100
  background: image-url("govuk_publishing_components/action-link-arrow--blue.svg"), linear-gradient(transparent, transparent);
101
101
  background-repeat: no-repeat;
102
- background-size: 35px auto;
102
+ background-size: 28px auto;
103
103
  background-position: 0 0;
104
+
105
+ @include govuk-media-query($from: tablet) {
106
+ width: 45px;
107
+ height: 35px;
108
+ background-size: 35px auto;
109
+ }
104
110
  }
105
111
  }
106
112
 
@@ -38,4 +38,12 @@
38
38
  @include govuk-link-hover-decoration;
39
39
  }
40
40
  }
41
+
42
+ &:focus,
43
+ &:focus:hover {
44
+ .gem-c-big-number__label,
45
+ .gem-c-big-number__value--decorated {
46
+ text-decoration: none;
47
+ }
48
+ }
41
49
  }
@@ -1,8 +1,18 @@
1
1
  @import "govuk/components/input/input";
2
+ $search-icon-size: 40px;
2
3
 
3
- .gem-c-input--search-icon {
4
- background: govuk-colour("white") url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E") no-repeat -5px -3px;
5
- padding-left: govuk-spacing(6);
4
+ .gem-c-input__search-icon {
5
+ display: block;
6
+ position: relative;
7
+ margin-bottom: -$search-icon-size;
8
+ z-index: 1;
9
+ width: $search-icon-size;
10
+ height: $search-icon-size;
11
+ @if $govuk-typography-use-rem {
12
+ margin-bottom: -(govuk-px-to-rem($search-icon-size));
13
+ height: govuk-px-to-rem($search-icon-size);
14
+ }
15
+ background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E") no-repeat -3px center;
6
16
  }
7
17
 
8
18
  // this overrides styles from static that break the look of the component
@@ -14,7 +24,7 @@
14
24
  padding: govuk-spacing(1);
15
25
  box-sizing: border-box;
16
26
 
17
- &.gem-c-input--search-icon {
27
+ &.gem-c-input--with-search-icon {
18
28
  padding-left: govuk-spacing(6);
19
29
  }
20
30
  }
@@ -31,9 +31,14 @@ module GovukPublishingComponents
31
31
 
32
32
  gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
33
33
  gem_path = Dir.pwd if ENV["MAIN_COMPONENT_GUIDE"]
34
+ host_dir = File.expand_path("..")
35
+ path = File.expand_path("..", gem_path)
36
+
37
+ @in_application = false
38
+ @in_application = true unless path.to_s == host_dir.to_s
34
39
 
35
40
  components = AuditComponents.new(gem_path, false)
36
- applications = analyse_applications(File.expand_path("..", gem_path), application_dirs)
41
+ applications = analyse_applications(host_dir, application_dirs)
37
42
  compared_data = AuditComparer.new(components.data, applications, false)
38
43
 
39
44
  @applications = compared_data.applications_data || []
@@ -44,15 +49,18 @@ module GovukPublishingComponents
44
49
 
45
50
  def analyse_applications(path, application_dirs)
46
51
  results = []
47
- @applications_found = false
52
+ applications_found = 0
48
53
 
49
54
  application_dirs.each do |application|
50
55
  application_path = [path, application].join("/")
51
56
  app = AuditApplications.new(application_path, application)
52
- @applications_found = true if app.data[:application_found]
57
+ applications_found += 1 if app.data[:application_found]
53
58
  results << app.data
54
59
  end
55
60
 
61
+ @other_applications = false
62
+ @other_applications = true if applications_found > 1
63
+
56
64
  results
57
65
  end
58
66
  end
@@ -1,4 +1,4 @@
1
- <% if @applications_found %>
1
+ <% if @other_applications %>
2
2
  <%= render "govuk_publishing_components/components/heading", {
3
3
  text: "Components",
4
4
  font_size: "l",
@@ -101,7 +101,7 @@
101
101
  }
102
102
  %>
103
103
 
104
- <% if @applications_found %>
104
+ <% if @other_applications %>
105
105
  <% components_by_application = capture do %>
106
106
  <% if @components[:components_by_application].any? %>
107
107
  <dl class="govuk-summary-list">
@@ -10,7 +10,7 @@
10
10
  <%= render "components" %>
11
11
  <% end %>
12
12
 
13
- <% if @applications_found %>
13
+ <% if @in_application or @other_applications %>
14
14
  <%= render "govuk_publishing_components/components/tabs", {
15
15
  tabs: [
16
16
  {
@@ -4,6 +4,7 @@
4
4
  label ||= nil
5
5
  href ||= nil
6
6
  data_attributes ||= nil
7
+ aria ||= nil
7
8
  classes = ["gem-c-big-number__value"]
8
9
 
9
10
  if label.nil? && href
@@ -25,7 +26,7 @@
25
26
  <% end %>
26
27
  <% end %>
27
28
 
28
- <%= tag.div class: "gem-c-big-number" do %>
29
+ <%= tag.div class: "gem-c-big-number", aria: aria do %>
29
30
  <% unless href.nil? %>
30
31
  <%= link_to big_number_value, href, class: "govuk-link gem-c-big-number__link", data: data_attributes %>
31
32
  <% else %>
@@ -31,7 +31,7 @@
31
31
  css_classes = %w(gem-c-input govuk-input)
32
32
  css_classes << "govuk-input--error" if has_error
33
33
  css_classes << "govuk-input--width-#{width}" if [2, 3, 4, 5, 10, 20, 30].include?(width)
34
- css_classes << "gem-c-input--search-icon" if search_icon
34
+ css_classes << "gem-c-input--with-search-icon" if search_icon
35
35
  form_group_css_classes = %w(govuk-form-group)
36
36
  form_group_css_classes << "govuk-form-group--error" if has_error && !grouped
37
37
 
@@ -120,6 +120,7 @@
120
120
  <%= input_tag %><%= tag.span suffix, class: "govuk-input__suffix", aria: { hidden: true } %>
121
121
  <% end %>
122
122
  <% else %>
123
+ <%= tag.span class: "gem-c-input__search-icon" if search_icon %>
123
124
  <%= input_tag %>
124
125
  <% end %>
125
126
  <% end %>
@@ -6,10 +6,15 @@
6
6
  list_type ||= "unordered"
7
7
  visible_counters ||= nil
8
8
 
9
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
10
+
9
11
  classes = %w[gem-c-list govuk-list]
10
- classes << "govuk-list--bullet" if visible_counters && list_type === "unordered"
11
- classes << "govuk-list--number" if visible_counters && list_type === "number"
12
+ classes << "govuk-list--bullet" if visible_counters and list_type === "unordered"
13
+ classes << "govuk-list--number" if visible_counters and list_type === "number"
12
14
  classes << "govuk-list--spaced" if extra_spacing
15
+ # Setting the `margin_bottom` to 4 is the same as the default margin - so we
16
+ # can omit the override class. To do this we leave out `4` from the array:
17
+ classes << (shared_helper.get_margin_bottom) if [0,1,2,3,5,6,7,8,9].include?(local_assigns[:margin_bottom])
13
18
 
14
19
  # Default list type is unordered list.
15
20
  list_tag = "ul"
@@ -54,3 +54,10 @@ examples:
54
54
  label: Ministerial departments
55
55
  data_attributes:
56
56
  department-count: true
57
+ with_aria_attributes:
58
+ description: Aria attributes are applied to the whole component instance
59
+ data:
60
+ number: 23
61
+ label: Ministerial departments
62
+ aria:
63
+ hidden: true
@@ -439,16 +439,16 @@ examples:
439
439
  statistic_headlines:
440
440
  data:
441
441
  block: |
442
- <aside class="stat-headline">
442
+ <div class="stat-headline">
443
443
  <p><em>£6bn</em>
444
444
  Total Departmental Expenditure Limit (<abbr title="Departmental Expenditure Limit">DEL</abbr>) in financial year 2015 to 2016</p>
445
- </aside>
445
+ </div>
446
446
  <p>This includes £5.8 billion Resource <abbr title="Departmental Expenditure Limit">DEL</abbr> and £0.2 billion Capital <abbr title="Departmental Expenditure Limit">DEL</abbr>. In addition, <abbr title="Department for Work and Pensions">DWP</abbr> Annually Managed Expenditure (<abbr title="Annually Managed Expenditure">AME</abbr>) in financial year 2015 to 2016 is £170.5 billion, as forecast by the Office for Budget Responsibility.</p>
447
- <aside class="stat-headline">
447
+ <div class="stat-headline">
448
448
  <p>UK employment rate
449
449
  <em>74.1%</em>
450
450
  between October and December 2015</p>
451
- </aside>
451
+ </div>
452
452
  specialist_content:
453
453
  data:
454
454
  block: |
@@ -62,3 +62,11 @@ examples:
62
62
  data:
63
63
  id: 'super-fantastic-chocolate-list'
64
64
  <<: *default-example-data
65
+ with_margin:
66
+ description: |
67
+ Sets the margin on the bottom of the list element.
68
+
69
+ The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a 20px margin.
70
+ data:
71
+ margin_bottom: 9
72
+ <<: *default-example-data
@@ -11,7 +11,7 @@ accessibility_criteria: |
11
11
  - be focusable with a keyboard
12
12
  - be usable with a keyboard
13
13
  - indicate when they have focus
14
- - change in appearance when touched (in the touch-down state)
14
+ - change in appearance when active (in the active state)
15
15
  - be usable with touch
16
16
  - have label with a touch area similar to the input
17
17
  - be usable with [voice commands](https://www.w3.org/WAI/perspectives/voice.html)
@@ -53,7 +53,7 @@ examples:
53
53
  - value: "govuk-verify"
54
54
  text: "Use GOV.UK Verify"
55
55
  with_bold:
56
- description: 'Used to provide better contrast between long labels and hint text, Note that the `:or` option [is documented as a string due to a bug](https://github.com/alphagov/govuk_publishing_components/issues/102)'
56
+ description: Used to provide better contrast between long labels and hint text, Note that the `:or` option [is documented as a string due to a bug](https://github.com/alphagov/govuk_publishing_components/issues/102)
57
57
  data:
58
58
  name: "radio-group-bold"
59
59
  items:
@@ -66,7 +66,7 @@ examples:
66
66
  hint_text: "You'll have an account if you've already proved your identity with a certified company, such as the Post Office."
67
67
  bold: true
68
68
  with_bottom_margin:
69
- description: "The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to a margin bottom of 30px (6)."
69
+ description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to a margin bottom of `30px` (`6`).
70
70
  data:
71
71
  name: "radio-group"
72
72
  margin_bottom: 9
@@ -85,16 +85,50 @@ examples:
85
85
  text: "Use Government Gateway"
86
86
  - value: "govuk-verify"
87
87
  text: "Use GOV.UK Verify"
88
- with_heading:
89
- description: This adds a legend element containing the text supplied.
88
+ with_legend:
89
+ description: |
90
+ Legend text is automatically wrapped inside a `h2`. To render the text without it, `heading_level` must be set to `0`.
90
91
  data:
91
- name: "radio-group-heading"
92
- heading: "Are you hungry?"
92
+ name: "radio-group-legend"
93
+ heading: "What's it to do with?"
94
+ heading_level: 0
93
95
  items:
94
96
  - value: "yes"
95
97
  text: "Yes"
96
98
  - value: "no"
97
99
  text: "No"
100
+ with_heading:
101
+ description: |
102
+ By default, text supplied for the `legend` is wrapped inside a `h2`.
103
+
104
+ The font size of this heading can be changed using the `heading_size` option. Valid options are `s`, `m`, `l`, `xl`, defaulting to `m` if no option is passed.
105
+ data:
106
+ name: "radio-group-description"
107
+ heading: "What is your favourite colour?"
108
+ heading_size: "s"
109
+ items:
110
+ - value: "red"
111
+ text: "Red"
112
+ - value: "green"
113
+ text: "Green"
114
+ - value: "blue"
115
+ text: "Blue"
116
+ with_different_heading_level:
117
+ description: |
118
+ By default, text supplied for the `legend` is wrapped inside a `h2`. This can be changed using the `heading_level` option.
119
+
120
+ If `heading_level` is `1` and `heading_size` is not set, the text size will be `xl`.
121
+ data:
122
+ name: "radio-group-description"
123
+ heading: "What is your favourite colour?"
124
+ heading_level: 1
125
+ items:
126
+ - value: "red"
127
+ text: "Red"
128
+ - value: "green"
129
+ text: "Green"
130
+ - value: "blue"
131
+ text: "Blue"
98
132
  with_heading_and_hint:
99
133
  data:
100
134
  name: "radio-group-heading"
@@ -109,9 +143,9 @@ examples:
109
143
  text: "Blue"
110
144
  with_page_header_and_caption:
111
145
  description: |
112
- If a caption text is provided with a page heading, it will be displayed above the heading.
113
- A caption can only be used with a page heading. If a heading is not provided the caption will not render.
114
- The pattern is used across GOV.UK to show a high-level section that this page question falls into.
146
+ A caption can be added using the `heading_caption` option. Captions will only be displayed if text for the heading option is present.
147
+
148
+ The pattern is used across GOV.UK to show a high-level section that this page belongs to.
115
149
  data:
116
150
  name: "radio-group-heading"
117
151
  heading: "Is it snowing?"
@@ -181,35 +215,6 @@ examples:
181
215
  text: "Green"
182
216
  - value: "blue"
183
217
  text: "Blue"
184
- with_custom_heading_size:
185
- description: |
186
- This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
187
-
188
- If heading_level is 1 and heading_size is not set, the text size will be xl.
189
- data:
190
- name: "radio-group-description"
191
- heading: "What is your favourite colour?"
192
- heading_size: "s"
193
- items:
194
- - value: "red"
195
- text: "Red"
196
- - value: "green"
197
- text: "Green"
198
- - value: "blue"
199
- text: "Blue"
200
- with_custom_heading_level:
201
- description: This allows the heading level to be changed. Heading level will default to `h2` if nothing is passed.
202
- data:
203
- name: "radio-group-description"
204
- heading: "What is your favourite colour?"
205
- heading_level: 3
206
- items:
207
- - value: "red"
208
- text: "Red"
209
- - value: "green"
210
- text: "Green"
211
- - value: "blue"
212
- text: "Blue"
213
218
  with_hint_text_on_radios:
214
219
  data:
215
220
  name: "radio-group-hint-text"
@@ -248,7 +253,7 @@ examples:
248
253
  - value: "govuk-verify"
249
254
  text: "Use GOV.UK Verify"
250
255
  with_or_divider:
251
- description: "See [related service manual gudiance for this pattern](https://www.gov.uk/service-manual/design/writing-for-user-interfaces#ask-questions-that-users-can-understand)"
256
+ description: "See [related service manual guidance for this pattern](https://www.gov.uk/service-manual/design/writing-for-user-interfaces#ask-questions-that-users-can-understand)"
252
257
  data:
253
258
  name: "radio-group-or-divider"
254
259
  items:
@@ -4,18 +4,12 @@ module GovukPublishingComponents
4
4
  # keys are labels, values are the content_ids for the matching taxons
5
5
  # Where multiple matching taxons are present, the top most one is the highest priority
6
6
  # and the bottom one the lowest priority
7
- BREXIT_TAXONS = {
7
+ PRIORITY_TAXONS = {
8
8
  brexit_business: "634fd193-8039-4a70-a059-919c34ff4bfc",
9
9
  brexit_individuals: "614b2e65-56ac-4f8d-bb9c-d1a14167ba25",
10
10
  brexit_taxon: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
11
11
  }.freeze
12
12
 
13
- PRIORITY_TAXONS = {
14
- education_coronavirus: "272308f4-05c8-4d0d-abc7-b7c2e3ccd249",
15
- worker_coronavirus: "b7f57213-4b16-446d-8ded-81955d782680",
16
- business_coronavirus: "65666cdf-b177-4d79-9687-b9c32805e450",
17
- }.merge(BREXIT_TAXONS).freeze
18
-
19
13
  # Returns the highest priority taxon that has a content_id matching those in PRIORITY_TAXONS
20
14
  def self.call(content_item, query_parameters = nil)
21
15
  new(content_item, query_parameters).breadcrumbs
@@ -37,9 +31,9 @@ module GovukPublishingComponents
37
31
 
38
32
  def priority_brexit_taxon
39
33
  if tagged_to_both_brexit_child_taxons?
40
- priority_brexit_taxons.find { |t| t["content_id"] == BREXIT_TAXONS[:brexit_taxon] }
34
+ priority_taxons.find { |t| t["content_id"] == PRIORITY_TAXONS[:brexit_taxon] }
41
35
  else
42
- priority_brexit_taxons.min_by { |t| BREXIT_TAXONS.values.index(t["content_id"]) }
36
+ priority_taxons.min_by { |t| PRIORITY_TAXONS.values.index(t["content_id"]) }
43
37
  end
44
38
  end
45
39
 
@@ -83,10 +77,6 @@ module GovukPublishingComponents
83
77
  end
84
78
  end
85
79
 
86
- def priority_brexit_taxons
87
- priority_taxons.select { |t| priority_brexit_taxon?(t) }
88
- end
89
-
90
80
  def taxon_tree(taxons)
91
81
  return [] if taxons.blank?
92
82
 
@@ -97,10 +87,6 @@ module GovukPublishingComponents
97
87
  PRIORITY_TAXONS.values.include?(taxon["content_id"])
98
88
  end
99
89
 
100
- def priority_brexit_taxon?(taxon)
101
- BREXIT_TAXONS.values.include?(taxon["content_id"])
102
- end
103
-
104
90
  def brexit_child_taxon?(taxon)
105
91
  brexit_child_taxons.include?(taxon["content_id"])
106
92
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "27.7.0".freeze
2
+ VERSION = "27.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: 27.7.0
4
+ version: 27.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-10-13 00:00:00.000000000 Z
11
+ date: 2021-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 3.9.2
215
+ version: 3.10.0
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 3.9.2
222
+ version: 3.10.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: jasmine_selenium_runner
225
225
  requirement: !ruby/object:Gem::Requirement