govuk_publishing_components 35.3.4 → 35.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/audit-filter.js +81 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +4 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +4 -3
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-specialist-link-tracker.js +5 -1
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +1 -1
  7. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +1 -1
  8. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +245 -176
  9. data/app/assets/stylesheets/component_guide/application.scss +16 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +0 -5
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +0 -12
  12. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +0 -11
  13. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +0 -24
  14. data/app/models/govuk_publishing_components/audit_applications.rb +14 -0
  15. data/app/models/govuk_publishing_components/audit_comparer.rb +14 -0
  16. data/app/models/govuk_publishing_components/audit_components.rb +34 -32
  17. data/app/views/govuk_publishing_components/audit/_applications.html.erb +40 -32
  18. data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +56 -12
  19. data/app/views/govuk_publishing_components/audit/_components.html.erb +9 -7
  20. data/app/views/govuk_publishing_components/audit/show.html.erb +5 -1
  21. data/app/views/govuk_publishing_components/components/_hint.html.erb +5 -1
  22. data/app/views/govuk_publishing_components/components/_label.html.erb +6 -6
  23. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +3 -1
  24. data/app/views/govuk_publishing_components/components/docs/hint.yml +1 -1
  25. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +1 -1
  26. data/config/locales/en.yml +2 -2
  27. data/lib/generators/govuk_publishing_components/component_generator.rb +2 -2
  28. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +8 -8
  29. data/lib/govuk_publishing_components/version.rb +1 -1
  30. data/node_modules/axe-core/README.md +1 -3
  31. data/node_modules/axe-core/axe.js +4385 -1157
  32. data/node_modules/axe-core/axe.min.js +2 -2
  33. data/node_modules/axe-core/locales/_template.json +12 -0
  34. data/node_modules/axe-core/package.json +2 -1
  35. data/node_modules/axe-core/sri-history.json +4 -0
  36. metadata +4 -3
@@ -18,8 +18,8 @@ module GovukPublishingComponents
18
18
  create_directory_if_not_exists(docs_dir)
19
19
  create_directory_if_not_exists(scss_dir)
20
20
 
21
- template "_component.html.erb", "#{template_dir}_#{@public_name}.html.erb"
22
- template "component.yml.erb", "#{docs_dir}#{@public_name}.yml"
21
+ template "_component.html.erb", "#{template_dir}_#{@public_name.gsub('-', '_')}.html.erb"
22
+ template "component.yml.erb", "#{docs_dir}#{@public_name.gsub('-', '_')}.yml"
23
23
  template "_component.scss", "#{scss_dir}_#{@public_name}.scss"
24
24
  end
25
25
 
@@ -12,9 +12,6 @@ module GovukPublishingComponents
12
12
  world_locations
13
13
  statistical_data_sets
14
14
  ].freeze
15
- WORLD_LOCATION_SPECIAL_CASES = {
16
- "UK Mission to the European Union" => "uk-mission-to-the-eu",
17
- }.freeze
18
15
 
19
16
  attr_reader :related_navigation, :index_section_count
20
17
 
@@ -127,11 +124,14 @@ module GovukPublishingComponents
127
124
  end
128
125
 
129
126
  def related_world_locations
130
- content_item_links_for("world_locations")
131
- .map do |link|
132
- slug = WORLD_LOCATION_SPECIAL_CASES[link[:text]] || link[:text].parameterize
133
- link.merge(path: "/world/#{slug}/news")
134
- end
127
+ content_item_links_for("world_locations").each do |link|
128
+ build_world_locations_path_for link
129
+ end
130
+ end
131
+
132
+ def build_world_locations_path_for(link)
133
+ slug = link[:text].parameterize
134
+ link[:path] ||= "/world/#{slug}/news"
135
135
  end
136
136
 
137
137
  def related_statistical_data_sets
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "35.3.4".freeze
2
+ VERSION = "35.4.0".freeze
3
3
  end
@@ -14,14 +14,12 @@ Axe is an accessibility testing engine for websites and other HTML-based user in
14
14
 
15
15
  ## The Accessibility Rules
16
16
 
17
- Axe-core has different types of rules, for WCAG 2.0 and 2.1 on level A and AA, as well as a number of best practices that help you identify common accessibility practices like ensuring every page has an `h1` heading, and to help you avoid "gotchas" in ARIA like where an ARIA attribute you used will get ignored.
17
+ Axe-core has different types of rules, for WCAG 2.0, 2.1, 2.2 on level A, AA and AAA as well as a number of best practices that help you identify common accessibility practices like ensuring every page has an `h1` heading, and to help you avoid "gotchas" in ARIA like where an ARIA attribute you used will get ignored. The complete list of rules, grouped WCAG level and best practice, can found in [doc/rule-descriptions.md](./doc/rule-descriptions.md).
18
18
 
19
19
  With axe-core, you can find **on average 57% of WCAG issues automatically**. Additionally, axe-core will return elements as "incomplete" where axe-core could not be certain, and manual review is needed.
20
20
 
21
21
  To catch bugs earlier in the development cycle we recommend using the [axe-linter vscode extension](https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter). To improve test coverage even further we recommend the [intelligent guided tests](https://www.youtube.com/watch?v=AtsX0dPCG_4&feature=youtu.be&ab_channel=DequeSystems) in the [axe Extension](https://www.deque.com/axe/browser-extensions/).
22
22
 
23
- The complete list of rules, grouped WCAG level and best practice, can found in [doc/rule-descriptions.md](./doc/rule-descriptions.md).
24
-
25
23
  ## Getting started
26
24
 
27
25
  First download the package: