govuk_publishing_components 28.6.0 → 28.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +3 -3
  4. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +7 -6
  5. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +1796 -911
  6. data/app/models/govuk_publishing_components/component_docs.rb +4 -1
  7. data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -1
  8. data/app/views/govuk_publishing_components/components/_button.html.erb +3 -3
  9. data/app/views/govuk_publishing_components/components/_input.html.erb +3 -3
  10. data/app/views/govuk_publishing_components/components/_intervention.html.erb +2 -2
  11. data/app/views/govuk_publishing_components/components/_search.html.erb +2 -4
  12. data/app/views/govuk_publishing_components/components/_select.html.erb +15 -43
  13. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +7 -8
  14. data/app/views/govuk_publishing_components/components/docs/attachment.yml +11 -0
  15. data/app/views/govuk_publishing_components/components/docs/select.yml +1 -1
  16. data/config/initializers/assets.rb +1 -0
  17. data/lib/govuk_publishing_components/presenters/attachment.rb +23 -0
  18. data/lib/govuk_publishing_components/presenters/select_helper.rb +85 -0
  19. data/lib/govuk_publishing_components/version.rb +1 -1
  20. data/lib/govuk_publishing_components.rb +1 -1
  21. metadata +7 -37
  22. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +0 -100
  23. data/lib/govuk_publishing_components/presenters/select.rb +0 -43
  24. data/lib/tasks/govuk_publishing_components_tasks.rake +0 -49
@@ -1,49 +0,0 @@
1
- namespace :component do
2
- desc "warns if component view files exist without corresponding documentation"
3
- task :validate_documentation_exists do
4
- print "Validating that each component has documentation... "
5
- components_missing_docs = []
6
- component_views = Dir["app/views/#{GovukPublishingComponents::Config.component_directory_name}/**/*.html.erb"]
7
- component_views.each do |partial|
8
- expected_component_docs_file = partial.split("/")[-1].gsub("html.erb", "yml")
9
- expected_component_docs_file.sub!(/^_/, "")
10
-
11
- expected_component_docs_path = "app/views/#{GovukPublishingComponents::Config.component_directory_name}/docs/#{expected_component_docs_file}"
12
- components_missing_docs << partial unless File.exist?(expected_component_docs_path)
13
- end
14
-
15
- if components_missing_docs.any?
16
- error = "You have components which are missing documentation. These components will not be displayed in the component guide:\n"
17
- components_missing_docs.each { |component| error += "\t#{component}\n" }
18
- error += "\n"
19
- raise NotImplementedError, error
20
- end
21
- puts "✔︎"
22
- end
23
-
24
- desc "warns if component is missing accessibility criteria"
25
- task :validate_accessibility_criteria_exist do
26
- print "Validating that each component has accessibility criteria... "
27
- errors = []
28
-
29
- component_docs = Dir["app/views/#{GovukPublishingComponents::Config.component_directory_name}/**/*.yml"]
30
- component_docs.each do |doc_file|
31
- file = YAML.load_file(doc_file)
32
-
33
- if file["accessibility_criteria"].nil? && file["shared_accessibility_criteria"].nil?
34
- errors << file["name"]
35
- end
36
- end
37
- if errors.any?
38
- error = "The following components need accessibility criteria:\n#{errors.join("\n")}"
39
- raise NotImplementedError, error
40
- end
41
- puts "✔︎"
42
- end
43
-
44
- desc "warns if component view files exist without corresponding documentation or accessibility critera"
45
- task :validate_documentation do
46
- Rake::Task["component:validate_documentation_exists"].invoke
47
- Rake::Task["component:validate_accessibility_criteria_exist"].invoke
48
- end
49
- end