govuk_publishing_components 24.2.0 → 24.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +28 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +52 -8
  4. data/app/assets/javascripts/govuk_publishing_components/components/details.js +1 -1
  5. data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +108 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +7 -2
  7. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +6 -2
  8. data/app/assets/stylesheets/component_guide/application.scss +0 -8
  9. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +1 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +11 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +8 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +117 -0
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -13
  15. data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
  16. data/app/models/govuk_publishing_components/audit_comparer.rb +2 -2
  17. data/app/models/govuk_publishing_components/component_example.rb +4 -3
  18. data/app/views/govuk_publishing_components/audit/show.html.erb +211 -199
  19. data/app/views/govuk_publishing_components/components/_accordion.html.erb +3 -3
  20. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +8 -5
  21. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +1 -1
  22. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +6 -6
  23. data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
  25. data/app/views/govuk_publishing_components/components/_list.html.erb +5 -5
  26. data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
  27. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +1 -1
  28. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +1 -1
  29. data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -1
  30. data/app/views/govuk_publishing_components/components/_reorderable_list.html.erb +45 -0
  31. data/app/views/govuk_publishing_components/components/_search.html.erb +27 -16
  32. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
  33. data/app/views/govuk_publishing_components/components/_show_password.html.erb +6 -4
  34. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -1
  35. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  36. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
  37. data/app/views/govuk_publishing_components/components/_summary_list.html.erb +67 -30
  38. data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +1 -1
  39. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
  40. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +1 -1
  41. data/app/views/govuk_publishing_components/components/docs/accordion.yml +29 -0
  42. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +22 -0
  43. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
  44. data/app/views/govuk_publishing_components/components/docs/radio.yml +14 -1
  45. data/app/views/govuk_publishing_components/components/docs/reorderable_list.yml +85 -0
  46. data/app/views/govuk_publishing_components/components/docs/search.yml +10 -0
  47. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +2 -0
  48. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +17 -3
  49. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +2 -2
  50. data/config/locales/en.yml +25 -15
  51. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +2 -1
  52. data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +1 -1
  53. data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +1 -7
  54. data/lib/govuk_publishing_components/presenters/meta_tags.rb +1 -2
  55. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +2 -2
  56. data/lib/govuk_publishing_components/version.rb +1 -1
  57. data/lib/tasks/govuk_publishing_components_tasks.rake +1 -1
  58. data/node_modules/sortablejs/LICENSE +21 -0
  59. data/node_modules/sortablejs/README.md +815 -0
  60. data/node_modules/sortablejs/Sortable.js +3721 -0
  61. data/node_modules/sortablejs/Sortable.min.js +2 -0
  62. data/node_modules/sortablejs/modular/sortable.complete.esm.js +3713 -0
  63. data/node_modules/sortablejs/modular/sortable.core.esm.js +3710 -0
  64. data/node_modules/sortablejs/modular/sortable.esm.js +3711 -0
  65. data/node_modules/sortablejs/package.json +56 -0
  66. metadata +19 -7
@@ -9,7 +9,7 @@
9
9
  taxonomy_list_helper = GovukPublishingComponents::Presenters::TaxonomyListHelper.new(image_cards)
10
10
  %>
11
11
  <% if highlight_box || document_list || image_cards %>
12
- <ul class="gem-c-taxonomy-list" data-module="track-click">
12
+ <ul class="gem-c-taxonomy-list" data-module="gem-track-click">
13
13
  <% if image_cards %>
14
14
  <% taxonomy_list_helper.image_card_data.each do |image_card| %>
15
15
  <li class="gem-c-taxonomy-list__item">
@@ -7,7 +7,7 @@
7
7
  <nav role="navigation"
8
8
  class="gem-c-translation-nav <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
9
9
  aria-label="<%= t("common.translations") %>"
10
- <%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
10
+ <%= "data-module=\"gem-track-click\"" if translation_helper.tracking_is_present? %>
11
11
  >
12
12
  <ul class="gem-c-translation-nav__list">
13
13
  <% translation_helper.translations.each.with_index do |translation, i| %>
@@ -3,7 +3,7 @@
3
3
  <% link_path = t("components.related_navigation.transition.link_path") %>
4
4
 
5
5
  <% data_attributes = {
6
- "module": "track-click",
6
+ "module": "gem-track-click",
7
7
  "track-category": "relatedLinkClicked",
8
8
  "track-action": "1.0 Transition",
9
9
  "track-label": link_path,
@@ -274,6 +274,35 @@ examples:
274
274
  text: "How people read"
275
275
  content:
276
276
  html: "<p class='govuk-body'>This is the content for How people read.</p>"
277
+ with_the_anchor_link_navigation:
278
+ description: |
279
+ Some apps require custom ids per accordion section heading for linking between those specific sections, sometimes across multiple pages. An example of this is on manuals pages where multiple manuals will each include large sets of accordions and will reference between specific sections for ease of access to that content. [Live example](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/creating-and-updating-pages#associations).
280
+
281
+ This feature automatically opens accordions when an anchor link is clicked within another accordion that links to either the id of an accordion section heading or an id within the content of an accordion. This will also automatically navigate to and open accordions on page load using the same rules.
282
+
283
+ This feature won't be used if the `anchor_navigation` flag isn't passed as true to mitigate performance risk from event listeners on a large number of links.
284
+
285
+ Unlike with the accordion-wide custom id attribute, any ids passed to accordion headings as part of this feature aren't stored in `localStorage` so don't need to be unique across your domain, but **should still be unique in the context of the page**.
286
+ data:
287
+ anchor_navigation: true
288
+ items:
289
+ - heading:
290
+ text: "Writing well for the web"
291
+ id: "writing-well-for-the-web"
292
+ content:
293
+ html: "<p class='govuk-body'>This is the content for Writing well for the web.</p>"
294
+ - heading:
295
+ text: "Writing well for specialists"
296
+ content:
297
+ html: "<p class='govuk-body'>This is the content for Writing well for specialists.</p>"
298
+ - heading:
299
+ text: "Know your audience"
300
+ content:
301
+ html: "<p class='govuk-body'>This is the content for Know your audience.</p>"
302
+ - heading:
303
+ text: "How people read"
304
+ content:
305
+ html: "<p class='govuk-body'>This is the content for How people read.</p>"
277
306
  condensed_layout:
278
307
  description: |
279
308
  This is for when a smaller accordion is required. Since smaller screens trigger a single column layout, this modifier only makes the accordion smaller when viewed on large screens.
@@ -97,3 +97,25 @@ examples:
97
97
  url: '/browse/abroad'
98
98
  - title: 'Travel abroad'
99
99
  url: '/browse/abroad/travel-abroad'
100
+ with_border:
101
+ description: "Set a border below the breadcrumb. Off by default."
102
+ data:
103
+ border: "bottom"
104
+ breadcrumbs:
105
+ - title: "Section"
106
+ url: "/section"
107
+ - title: "Sub-section"
108
+ url: "/section/sub-section"
109
+ - title: "Sub-sub-section"
110
+ url: "/section/sub-section/sub-section"
111
+ with_border_and_collapse_on_mobile:
112
+ data:
113
+ border: "bottom"
114
+ collapse_on_mobile: true
115
+ breadcrumbs:
116
+ - title: "Section"
117
+ url: "/section"
118
+ - title: "Sub-section"
119
+ url: "/section/sub-section"
120
+ - title: "Sub-sub-section"
121
+ url: "/section/sub-section/sub-section"
@@ -45,7 +45,7 @@ examples:
45
45
  data:
46
46
  padding_top: false
47
47
  block: |
48
- <div class="gem-c-breadcrumbs " data-module="track-click">
48
+ <div class="gem-c-breadcrumbs " data-module="gem-track-click">
49
49
  <ol>
50
50
  <li class="">
51
51
  <a data-track-category="breadcrumbClicked" data-track-action="1" data-track-label="/section" data-track-options="{&quot;dimension28&quot;:&quot;2&quot;,&quot;dimension29&quot;:&quot;Section&quot;}" class="gem-c-breadcrumbs--inverse" aria-current="false" href="/section">Section</a>
@@ -184,7 +184,7 @@ examples:
184
184
  text: "Blue"
185
185
  with_custom_heading_size:
186
186
  description: |
187
- 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
+ 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.
188
188
 
189
189
  If the is_page_heading option is true and heading_size is not set, the text size will be xl.
190
190
  data:
@@ -198,6 +198,19 @@ examples:
198
198
  text: "Green"
199
199
  - value: "blue"
200
200
  text: "Blue"
201
+ with_custom_heading_level:
202
+ description: This allows the heading level to be changed. Heading level will default to `h2` if nothing is passed.
203
+ data:
204
+ name: "radio-group-description"
205
+ heading: "What is your favourite colour?"
206
+ heading_level: 3
207
+ items:
208
+ - value: "red"
209
+ text: "Red"
210
+ - value: "green"
211
+ text: "Green"
212
+ - value: "blue"
213
+ text: "Blue"
201
214
  with_hint_text_on_radios:
202
215
  data:
203
216
  name: "radio-group-hint-text"
@@ -0,0 +1,85 @@
1
+ name: Reorderable list
2
+ description: A list of items that can be reordered
3
+ body: |
4
+ List items can be reordered by drag and drop or by using the up/down buttons.
5
+ On small viewports the drag and drop feature is disabled to prevent being triggered
6
+ when scrolling on touch devices.
7
+
8
+ This component uses SortableJS - a JavaScript library for drag and drop interactions.
9
+ When JavaScript is disabled a set of inputs will be shown allowing users to provide
10
+ an order index for each item.
11
+
12
+ When this component is embedded into a form and that form is submit you will receive a
13
+ parameter of `ordering` (which can be customised with the `input_name` option).
14
+ This will contain item ids and ordering positions in a hash.
15
+
16
+ For example, for two items with id "a" and "b" that are ordered accordingly,
17
+ you'd receive a submission of `ordering[a]=1&ordering[b]=2`, which Rails can
18
+ translate to `"ordering" => { "a" => "1", "b" => "2" }`.
19
+
20
+ accessibility_criteria: |
21
+ Buttons in this component must:
22
+
23
+ * be keyboard focusable
24
+ * inform the user about which item they operate on
25
+ * preserve focus after interacting with them
26
+ examples:
27
+ default:
28
+ data:
29
+ items:
30
+ - id: "ce99dd60-67dc-11eb-ae93-0242ac130002"
31
+ title: "Budget 2018"
32
+ - id: "d321cb86-67dc-11eb-ae93-0242ac130002"
33
+ title: "Budget 2018 (web)"
34
+ - id: "63a6d29e-6b6d-4157-9067-84c1a390e352"
35
+ title: "Impact on households: distributional analysis to accompany Budget 2018"
36
+ - id: "0a4d377d-68f4-472f-b2e3-ef71dc750f85"
37
+ title: "Table 2.1: Budget 2018 policy decisions"
38
+ - id: "5ebd75d7-6c37-4b93-b444-1b7c49757fb9"
39
+ title: "Table 2.2: Measures announced at Autumn Budget 2017 or earlier that will take effect from November 2018 or later (£ million)"
40
+ with_description:
41
+ data:
42
+ items:
43
+ - id: "ce99dd60-67dc-11eb-ae93-0242ac130002"
44
+ title: "Budget 2018"
45
+ description: "PDF, 2.56MB, 48 pages"
46
+ - id: "d321cb86-67dc-11eb-ae93-0242ac130002"
47
+ title: "Budget 2018 (web)"
48
+ description: "HTML attachment"
49
+ - id: "63a6d29e-6b6d-4157-9067-84c1a390e352"
50
+ title: "Impact on households: distributional analysis to accompany Budget 2018"
51
+ description: "PDF, 592KB, 48 pages"
52
+ - id: "0a4d377d-68f4-472f-b2e3-ef71dc750f85"
53
+ title: "Table 2.1: Budget 2018 policy decisions"
54
+ description: "MS Excel Spreadsheet, 248KB"
55
+ - id: "5ebd75d7-6c37-4b93-b444-1b7c49757fb9"
56
+ title: "Table 2.2: Measures announced at Autumn Budget 2017 or earlier that will take effect from November 2018 or later (£ million)"
57
+ description: "MS Excel Spreadsheet, 248KB"
58
+ within_form:
59
+ embed: |
60
+ <form>
61
+ <%= component %>
62
+ <button class="govuk-button" type="submit">Save order</button>
63
+ </form>
64
+ data:
65
+ items:
66
+ - id: "ce99dd60-67dc-11eb-ae93-0242ac130002"
67
+ title: "Budget 2018"
68
+ - id: "d321cb86-67dc-11eb-ae93-0242ac130002"
69
+ title: "Budget 2018 (web)"
70
+ - id: "63a6d29e-6b6d-4157-9067-84c1a390e352"
71
+ title: "Impact on households: distributional analysis to accompany Budget 2018"
72
+ - id: "0a4d377d-68f4-472f-b2e3-ef71dc750f85"
73
+ title: "Table 2.1: Budget 2018 policy decisions"
74
+ - id: "5ebd75d7-6c37-4b93-b444-1b7c49757fb9"
75
+ title: "Table 2.2: Measures announced at Autumn Budget 2017 or earlier that will take effect from November 2018 or later (£ million)"
76
+ with_custom_input_name:
77
+ data:
78
+ input_name: "attachments[ordering]"
79
+ items:
80
+ - id: "5ebd75d7-6c37-4b93-b444-1b7c49757fb9"
81
+ title: "Budget 2018"
82
+ description: "PDF, 2.56MB, 48 pages"
83
+ - id: "0a4d377d-68f4-472f-b2e3-ef71dc750f85"
84
+ title: "Budget 2020"
85
+ description: "PDF, 2.56MB, 48 pages"
@@ -51,6 +51,16 @@ examples:
51
51
  with_aria_controls_attribute:
52
52
  description: |
53
53
  The aria-controls attribute is a 'relationship attribute' which denotes which elements in a page an interactive element or set of elements has control over and affects.
54
+
54
55
  For places like the finders where the page is updated dynamically after value changes to the input.
55
56
  data:
56
57
  aria_controls: "wrapper"
58
+ with_custom_button_text:
59
+ description: |
60
+ The search box component may be used multiple times on a page -- for example, on a [guidance and regulation finder results page](https://www.gov.uk/search/guidance-and-regulation?keywords=bananas&order=relevance) there is both the sitewide search in the header and also for the specific finder.
61
+
62
+ To avoid confusion, the text inside the button should be different for each form. This can be done by setting the `button_text` parameter.
63
+
64
+ This is visually hidden text -- to check for changes use a screen reader or inspect the button element.
65
+ data:
66
+ button_text: "Search absolutely everywhere"
@@ -1,3 +1,5 @@
1
+ <% navigation_aria_label ||= "Top level" %>
2
+
1
3
  <% if navigation_items.any? %>
2
4
  <button role="button" class="govuk-header__menu-button gem-c-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
3
5
  <%= tag.nav class: "gem-c-header__nav", aria: { label: navigation_aria_label } do %>
@@ -1,8 +1,22 @@
1
- <button class="search-toggle js-header-toggle" data-search-toggle-for="search">Show search</button>
2
- <form id="search" class="gem-c-layout-header__search-form govuk-clearfix" action="/search" method="get" role="search">
1
+ <button
2
+ class="search-toggle js-header-toggle"
3
+ data-search-toggle-for="search"
4
+ data-show-text="<%= t("components.layout_header.show_button") %>"
5
+ data-hide-text="<%= t("components.layout_header.hide_button") %>"
6
+ >
7
+ <%= t("components.layout_header.show_button") %>
8
+ </button>
9
+ <form
10
+ action="/search"
11
+ class="gem-c-layout-header__search-form govuk-clearfix"
12
+ id="search"
13
+ method="get"
14
+ role="search"
15
+ >
3
16
  <%= render "govuk_publishing_components/components/search", {
17
+ button_text: t("components.layout_header.search_button"),
4
18
  id: "site-search-text",
19
+ margin_bottom: 0,
5
20
  no_border: true,
6
- margin_bottom: 0
7
21
  } %>
8
22
  </form>
@@ -16,7 +16,7 @@
16
16
  %>
17
17
  <% end %>
18
18
 
19
- <ul class="gem-c-related-navigation__link-list" data-module="track-click">
19
+ <ul class="gem-c-related-navigation__link-list" data-module="gem-track-click">
20
20
  <% constructed_link_array = [] %>
21
21
 
22
22
  <% section_link_limit = related_nav_helper.calculate_section_link_limit(links) %>
@@ -26,7 +26,7 @@
26
26
  link_element = link_to(
27
27
  link[:text],
28
28
  link[:path],
29
- class: related_nav_helper.section_css_class("gem-c-related-navigation__section-link", section_title, link, (index >= section_link_limit)),
29
+ class: related_nav_helper.section_css_class("gem-c-related-navigation__section-link", section_title, link: link, link_is_inline: (index >= section_link_limit)),
30
30
  rel: link[:rel],
31
31
  lang: shared_helper.t_locale_check(link[:locale]),
32
32
  data: {
@@ -4,11 +4,11 @@
4
4
  #
5
5
  # To use the locales, use `I18n.t`:
6
6
  #
7
- # I18n.t 'hello'
7
+ # I18n.t "hello"
8
8
  #
9
9
  # In views, this is aliased to just `t`:
10
10
  #
11
- # <%= t('hello') %>
11
+ # <%= t("hello") %>
12
12
  #
13
13
  # To use a different locale, set it with `I18n.locale`:
14
14
  #
@@ -31,11 +31,11 @@ en:
31
31
  article_schema:
32
32
  scoped_search_description: "Search within %{title}"
33
33
  back_link:
34
- back: 'Back'
34
+ back: "Back"
35
35
  checkboxes:
36
- or: 'or'
36
+ or: "or"
37
37
  contents_list:
38
- contents: Contents
38
+ contents: "Contents"
39
39
  feedback:
40
40
  is_this_page_useful: "Is this page useful?"
41
41
  yes: "Yes"
@@ -54,15 +54,14 @@ en:
54
54
  what_wrong: "What went wrong?"
55
55
  send_me_survey: "Send me the survey"
56
56
  send: "Send"
57
- input:
58
- show: Show
59
- hide: Hide
60
- announce_show: Your password is shown
61
- announce_hide: Your password is hidden
57
+ layout_header:
58
+ search_button: "Search GOV.UK"
59
+ show_button: "Show search"
60
+ hide_button: "Hide search"
62
61
  organisation_schema:
63
62
  all_content_search_description: "Find all content from %{organisation}"
64
63
  radio:
65
- or: 'or'
64
+ or: "or"
66
65
  related_navigation:
67
66
  collections: "Collection"
68
67
  external_links: "Elsewhere on the web"
@@ -81,15 +80,26 @@ en:
81
80
  link_path: "/transition"
82
81
  link_text: "Check what you need to do"
83
82
  take_action_list:
84
- red: Check
85
- amber: Change
86
- green: Go
87
- aria_label: Brexit campaign slogan, Check, Change, Go.
83
+ red: "Check"
84
+ amber: "Change"
85
+ green: "Go"
86
+ aria_label: "Brexit campaign slogan, Check, Change, Go."
88
87
  related_footer_navigation:
89
88
  collections: "Collections"
90
89
  policies: "Policies"
91
90
  statistical_data_sets: "Statistical data sets"
92
91
  topical_events: "Topical events"
92
+ search_box:
93
+ search_button: "Search"
94
+ label: "Search on GOV.UK"
95
+ input_title: "Search"
96
+ show_password:
97
+ show: "Show"
98
+ hide: "Hide"
99
+ show_password: "Show password"
100
+ hide_password: "Hide password"
101
+ announce_show: "Your password is shown"
102
+ announce_hide: "Your password is hidden"
93
103
  print_link:
94
104
  text: "Print this page"
95
105
  skip_link:
@@ -15,6 +15,7 @@ module GovukPublishingComponents
15
15
  yield(builder)
16
16
  end
17
17
  end
18
+
18
19
  class TableBuilder
19
20
  include ActionView::Helpers::UrlHelper
20
21
  include ActionView::Helpers::TagHelper
@@ -57,7 +58,7 @@ module GovukPublishingComponents
57
58
 
58
59
  def cell(str, opt = {})
59
60
  classes = %w[govuk-table__cell]
60
- classes << "govuk-table__cell--" + opt[:format] if opt[:format]
61
+ classes << "govuk-table__cell--#{opt[:format]}" if opt[:format]
61
62
  classes << "govuk-table__cell--empty" unless str
62
63
  str ||= "Not set"
63
64
  tag.td str, class: classes
@@ -88,7 +88,7 @@ module GovukPublishingComponents
88
88
  end
89
89
 
90
90
  def section_url(anchor)
91
- return page_url + "#" + anchor if anchor.present?
91
+ return "#{page_url}##{anchor}" if anchor.present?
92
92
 
93
93
  page_url
94
94
  end
@@ -1,12 +1,6 @@
1
1
  module GovukPublishingComponents
2
2
  module Presenters
3
3
  class HtmlPublicationSchema < FaqPageSchema
4
- attr_reader :page
5
-
6
- def initialize(page)
7
- @page = page
8
- end
9
-
10
4
  def structured_data
11
5
  return ArticleSchema.new(page).structured_data if less_than_two_headings_of_any_one_type?
12
6
 
@@ -55,7 +49,7 @@ module GovukPublishingComponents
55
49
  # {:a => :b, :b => :c}
56
50
  def pairs_hash(array)
57
51
  all_but_last = array[0..-2]
58
- all_but_first = array[1..-1]
52
+ all_but_first = array[1..]
59
53
  pairs = [all_but_last, all_but_first].transpose
60
54
  Hash[pairs]
61
55
  end
@@ -20,8 +20,7 @@ module GovukPublishingComponents
20
20
  meta_tags = add_organisation_tags(meta_tags)
21
21
  meta_tags = add_political_tags(meta_tags)
22
22
  meta_tags = add_taxonomy_tags(meta_tags)
23
- meta_tags = add_step_by_step_tags(meta_tags)
24
- meta_tags
23
+ add_step_by_step_tags(meta_tags)
25
24
  end
26
25
 
27
26
  private
@@ -58,14 +58,14 @@ module GovukPublishingComponents
58
58
  I18n.t(
59
59
  "components.related_#{@context}_navigation." + section_title,
60
60
  default: [
61
- I18n.t("components.related_navigation." + section_title),
61
+ I18n.t("components.related_navigation.#{section_title}"),
62
62
  section_title.tr("_", " "),
63
63
  ],
64
64
  )
65
65
  end
66
66
  end
67
67
 
68
- def section_css_class(css_class, section_title, link = {}, link_is_inline = false)
68
+ def section_css_class(css_class, section_title, link: {}, link_is_inline: false)
69
69
  css_classes = [css_class]
70
70
  css_classes << "#{css_class}--#{@context}" unless @context.nil?
71
71
  css_classes << "#{css_class}--inline" if link_is_inline