govuk_publishing_components 21.56.0 → 21.58.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +6 -1
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +2 -2
- data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +14 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +11 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +9 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +52 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +5 -1
- data/app/controllers/govuk_publishing_components/component_guide_controller.rb +1 -0
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +5 -6
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +11 -7
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_input.html.erb +3 -4
- data/app/views/govuk_publishing_components/components/_list.html.erb +26 -0
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +27 -0
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/input.yml +9 -1
- data/app/views/govuk_publishing_components/components/docs/list.yml +64 -0
- data/app/views/govuk_publishing_components/components/docs/print_link.yml +24 -0
- data/config/locales/en.yml +2 -0
- data/lib/govuk_publishing_components.rb +2 -1
- data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +50 -42
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors.rb +41 -0
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +1 -0
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb +4 -0
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_topic.rb +38 -0
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +15 -4
- data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +3 -1
- data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +18 -17
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/CHANGELOG.md +11 -0
- data/node_modules/axe-core/axe.js +36 -9
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/bower.json +1 -1
- data/node_modules/axe-core/lib/checks/color/color-contrast.js +2 -2
- data/node_modules/axe-core/lib/checks/lists/listitem.js +1 -1
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js +3 -0
- data/node_modules/axe-core/lib/commons/dom/is-visible.js +37 -19
- data/node_modules/axe-core/lib/core/public/configure.js +26 -0
- data/node_modules/axe-core/lib/rules/aria-input-field-name.json +1 -1
- data/node_modules/axe-core/package.json +12 -12
- data/node_modules/axe-core/sri-history.json +4 -0
- metadata +25 -3
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_parent.rb +0 -39
@@ -1,39 +0,0 @@
|
|
1
|
-
module GovukPublishingComponents
|
2
|
-
module Presenters
|
3
|
-
# @private
|
4
|
-
class ContentBreadcrumbsBasedOnParent
|
5
|
-
def initialize(content_item)
|
6
|
-
@content_item = ContentItem.new(content_item)
|
7
|
-
end
|
8
|
-
|
9
|
-
def breadcrumbs
|
10
|
-
ordered_parents = all_parents.map do |parent|
|
11
|
-
{ title: parent.title, url: parent.base_path }
|
12
|
-
end
|
13
|
-
|
14
|
-
ordered_parents << { title: "Home", url: "/" }
|
15
|
-
|
16
|
-
{
|
17
|
-
breadcrumbs: ordered_parents.reverse,
|
18
|
-
}
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
attr_reader :content_item
|
24
|
-
|
25
|
-
def all_parents
|
26
|
-
parents = []
|
27
|
-
|
28
|
-
direct_parent = content_item.parent
|
29
|
-
while direct_parent
|
30
|
-
parents << direct_parent
|
31
|
-
|
32
|
-
direct_parent = direct_parent.parent
|
33
|
-
end
|
34
|
-
|
35
|
-
parents
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|