govuk_publishing_components 21.59.0 → 21.60.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -6
  3. data/app/assets/javascripts/component_guide/accessibility-test.js +21 -21
  4. data/app/assets/javascripts/component_guide/filter-components.js +19 -19
  5. data/app/assets/javascripts/component_guide/visual-regression.js +38 -37
  6. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +2 -2
  7. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +4 -4
  8. data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +31 -0
  9. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +24 -24
  10. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +17 -17
  11. data/app/assets/stylesheets/component_guide/application.scss +15 -15
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -8
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +4 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +1 -8
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +0 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +4 -5
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +3 -8
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +5 -8
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +4 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +2 -2
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +0 -1
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +0 -5
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -4
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +8 -12
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +21 -24
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +4 -8
  30. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +2 -0
  31. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -4
  32. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +2 -4
  33. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -0
  34. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +2 -0
  35. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -0
  36. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
  37. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +2 -0
  38. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -1
  39. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +2 -0
  40. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss +0 -4
  41. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -10
  42. data/app/controllers/govuk_publishing_components/audit_controller.rb +2 -2
  43. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +2 -2
  44. data/app/models/govuk_publishing_components/audit_applications.rb +19 -13
  45. data/app/models/govuk_publishing_components/audit_comparer.rb +64 -51
  46. data/app/models/govuk_publishing_components/audit_components.rb +25 -6
  47. data/app/views/govuk_publishing_components/audit/show.html.erb +198 -190
  48. data/app/views/govuk_publishing_components/component_guide/index.html.erb +3 -1
  49. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
  50. data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -1
  51. data/app/views/govuk_publishing_components/components/_radio.html.erb +13 -5
  52. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +2 -2
  53. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +4 -0
  54. data/app/views/govuk_publishing_components/components/docs/heading.yml +6 -3
  55. data/app/views/govuk_publishing_components/components/docs/radio.yml +4 -0
  56. data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +15 -7
  57. data/lib/govuk_publishing_components/presenters/heading_helper.rb +21 -1
  58. data/lib/govuk_publishing_components/version.rb +1 -1
  59. data/node_modules/axe-core/package.json +145 -220
  60. data/node_modules/govuk-frontend/package.json +14 -81
  61. data/node_modules/jquery/package.json +44 -116
  62. metadata +24 -66
  63. data/Rakefile +0 -37
@@ -37,28 +37,26 @@ $table-row-even-background-colour: govuk-colour("light-grey", $legacy: "grey-4")
37
37
  padding-right: $sort-link-arrow-size;
38
38
  color: $govuk-link-colour;
39
39
  text-decoration: none;
40
+ }
40
41
 
41
- &:focus {
42
- @include govuk-focused-text;
43
- }
44
-
45
- &::after {
46
- content: "";
47
- position: absolute;
48
- top: 5px;
49
- right: 0;
50
-
51
- @include govuk-shape-arrow($direction: up, $base: $sort-link-arrow-size-small, $display: block);
52
- }
42
+ .app-table__sort-link:focus {
43
+ @include govuk-focused-text;
44
+ }
53
45
 
54
- &::before {
55
- content: "";
56
- position: absolute;
57
- top: 13px;
58
- right: 0;
46
+ .app-table__sort-link:after {
47
+ content: "";
48
+ position: absolute;
49
+ top: 5px;
50
+ right: 0;
51
+ @include govuk-shape-arrow($direction: up, $base: $sort-link-arrow-size-small, $display: block);
52
+ }
59
53
 
60
- @include govuk-shape-arrow($direction: down, $base: $sort-link-arrow-size-small, $display: block);
61
- }
54
+ .app-table__sort-link:before {
55
+ content: "";
56
+ position: absolute;
57
+ top: 13px;
58
+ right: 0;
59
+ @include govuk-shape-arrow($direction: down, $base: $sort-link-arrow-size-small, $display: block);
62
60
  }
63
61
  }
64
62
 
@@ -81,12 +79,12 @@ $table-row-even-background-colour: govuk-colour("light-grey", $legacy: "grey-4")
81
79
  }
82
80
  }
83
81
 
84
- .app-table__sort-link--ascending::before,
85
- .app-table__sort-link--descending::before {
82
+ .app-table__sort-link--ascending:before,
83
+ .app-table__sort-link--descending:before {
86
84
  content: none;
87
85
  }
88
86
 
89
- .app-table__sort-link--ascending::after {
87
+ .app-table__sort-link--ascending:after {
90
88
  content: "";
91
89
  position: absolute;
92
90
  top: $sort-link-arrow-spacing;
@@ -96,7 +94,7 @@ $table-row-even-background-colour: govuk-colour("light-grey", $legacy: "grey-4")
96
94
  @include govuk-shape-arrow($direction: up, $base: $sort-link-arrow-size, $display: inline-block);
97
95
  }
98
96
 
99
- .app-table__sort-link--descending::after {
97
+ .app-table__sort-link--descending:after {
100
98
  content: "";
101
99
  position: absolute;
102
100
  top: $sort-link-arrow-spacing;
@@ -105,7 +103,6 @@ $table-row-even-background-colour: govuk-colour("light-grey", $legacy: "grey-4")
105
103
 
106
104
  @include govuk-shape-arrow($direction: down, $base: $sort-link-arrow-size, $display: inline-block);
107
105
  }
108
-
109
106
  }
110
107
 
111
108
  .govuk-table__row {
@@ -11,25 +11,21 @@
11
11
  // We have some styles within GOVUK (.content-block) which can leak into the list styles for this component.
12
12
  // These styles are defined in Static: https://github.com/alphagov/static/blob/a815620cada7ea1c65428c1c3b3ac4dbe28977bf/app/assets/stylesheets/helpers/_text.scss
13
13
  // This sets more specific selectors so those unwanted styles are overidden
14
- // scss-lint:disable QualifyingElement
15
- // sass-lint:disable no-qualifying-elements
16
- ul.govuk-tabs__list {
14
+ ul.govuk-tabs__list { // stylelint-disable-line selector-no-qualifying-type
17
15
  margin: 0;
18
16
  padding: 0;
19
17
  list-style: none;
20
18
  @include govuk-responsive-margin(6, "bottom");
21
19
  }
22
20
 
23
- li.govuk-tabs__list-item {
21
+ li.govuk-tabs__list-item { // stylelint-disable-line selector-no-qualifying-type
24
22
  margin-left: govuk-spacing(5);
25
23
  }
26
24
 
27
- .js-enabled {
25
+ .js-enabled { // stylelint-disable-line no-duplicate-selectors
28
26
  @include govuk-media-query($from: tablet) {
29
- ul.govuk-tabs__list {
27
+ ul.govuk-tabs__list { // stylelint-disable-line selector-no-qualifying-type
30
28
  margin-bottom: 0;
31
29
  }
32
30
  }
33
31
  }
34
- // scss-lint:enable QualifyingElement
35
- // sass-lint:enable no-qualifying-elements
@@ -5,6 +5,8 @@
5
5
  // - alphagov/whitehall: ✔︎
6
6
  // - alphagov/govspeak: ✔︎
7
7
 
8
+ // stylelint-disable max-nesting-depth
9
+
8
10
  .gem-c-govspeak {
9
11
 
10
12
  // Scope attachment and attachment-link component styles to gem-c-govspeak
@@ -1,7 +1,6 @@
1
1
  @import "govuk/components/button/button";
2
2
 
3
- // scss-lint:disable PlaceholderInExtend
4
- // sass-lint:disable placeholder-in-extend
3
+ // stylelint-disable scss/at-extend-no-missing-placeholder
5
4
  .gem-c-govspeak {
6
5
  .gem-c-button {
7
6
  @extend .govuk-button;
@@ -11,5 +10,3 @@
11
10
  @extend .govuk-button--start;
12
11
  }
13
12
  }
14
- // sass-lint:enable placeholder-in-extend
15
- // scss-lint:enable PlaceholderInExtend
@@ -9,6 +9,8 @@
9
9
  // adapted from magna-charta example stylesheet
10
10
  // https://github.com/alphagov/magna-charta/blob/master/demo/stylesheets/magna-charta.css
11
11
 
12
+ // stylelint-disable max-nesting-depth
13
+
12
14
  .gem-c-govspeak {
13
15
  // DEFAULT CHART STYLES
14
16
 
@@ -266,10 +268,6 @@
266
268
  text-align: left;
267
269
  }
268
270
 
269
- .mc-chart.mc-negative .mc-td.mc-key-cell {
270
- padding-right: 25px;
271
- }
272
-
273
271
  .mc-toggle-link {
274
272
  display: block;
275
273
  margin-top: 30px;
@@ -5,6 +5,8 @@
5
5
  // - alphagov/whitehall: ✔︎
6
6
  // - alphagov/govspeak: ✔︎
7
7
 
8
+ // stylelint-disable max-nesting-depth
9
+
8
10
  .gem-c-govspeak {
9
11
  // .address is used by the `$A` markdown pattern
10
12
  .address,
@@ -9,6 +9,8 @@
9
9
  // - alphagov/whitehall: ✔︎
10
10
  // - alphagov/govspeak: ✔︎
11
11
 
12
+ // stylelint-disable max-nesting-depth
13
+
12
14
  .gem-c-govspeak {
13
15
  .footnotes {
14
16
  border-top: 1px solid govuk-colour("mid-grey", $legacy: "grey-2");
@@ -1,3 +1,5 @@
1
+ // stylelint-disable max-nesting-depth
2
+
1
3
  $highlight-answer-bg-color: govuk-colour("green");
2
4
  $highlight-answer-color: govuk-colour("white");
3
5
 
@@ -1,4 +1,4 @@
1
- .gem-c-govspeak .place {
1
+ .gem-c-govspeak .place {
2
2
  margin: 1.5em 0;
3
3
  border-bottom: solid 1px govuk-colour("mid-grey", $legacy: "grey-2");
4
4
  padding-bottom: 1.5em;
@@ -9,6 +9,8 @@
9
9
  // - alphagov/whitehall: ✔︎
10
10
  // - alphagov/govspeak: ✔︎
11
11
 
12
+ // stylelint-disable max-nesting-depth
13
+
12
14
  .gem-c-govspeak {
13
15
  @include markdown-typography;
14
16
 
@@ -105,7 +105,7 @@
105
105
  }
106
106
 
107
107
  li {
108
- margin: 0 0 5px 0;
108
+ margin: 0 0 5px;
109
109
  padding: 0;
110
110
 
111
111
  p {
@@ -1,3 +1,5 @@
1
+ // stylelint-disable max-nesting-depth
2
+
1
3
  .gem-c-govspeak {
2
4
  .media-player {
3
5
  display: none;
@@ -1,5 +1,3 @@
1
- // scss-lint:disable SelectorFormat
2
-
3
1
  .gem-c-step-nav-header__part-of {
4
2
  display: block;
5
3
  }
@@ -11,5 +9,3 @@
11
9
  .gem-c-step-nav-header__skip-link {
12
10
  display: none;
13
11
  }
14
-
15
- // scss-lint:enable SelectorFormat
@@ -1,5 +1,3 @@
1
- // scss-lint:disable SelectorFormat
2
-
3
1
  $grey-2: #bfc1c3;
4
2
  $white: #ffffff;
5
3
  $number-circle-size: 35px;
@@ -40,6 +38,7 @@ $stroke-width: 3px;
40
38
  }
41
39
 
42
40
  .gem-c-step-nav__step {
41
+ padding-left: 60px;
43
42
  position: relative;
44
43
  }
45
44
 
@@ -74,14 +73,9 @@ $stroke-width: 3px;
74
73
  padding-bottom: 1em;
75
74
  }
76
75
 
77
- .gem-c-step-nav__step {
78
- position: relative;
79
- padding-left: 60px;
80
- }
81
-
82
76
  .gem-c-step-nav__title {
83
77
  @include govuk-font(19, $weight: bold);
84
- margin: 0 0 .5em 0;
78
+ margin: 0 0 .5em;
85
79
  padding: 0;
86
80
  }
87
81
 
@@ -120,5 +114,3 @@ $stroke-width: 3px;
120
114
  .gem-c-step-nav__circle-step-colon {
121
115
  display: none;
122
116
  }
123
-
124
- // scss-lint:enable SelectorFormat
@@ -7,8 +7,8 @@ module GovukPublishingComponents
7
7
  applications = analyse_applications(File.expand_path("..", path))
8
8
  compared_data = AuditComparer.new(components.data, applications)
9
9
 
10
- @applications = compared_data.data
11
- @components = compared_data.gem_data
10
+ @applications = compared_data.applications_data || []
11
+ @components = compared_data.gem_data || []
12
12
  end
13
13
 
14
14
  private
@@ -83,9 +83,9 @@ module GovukPublishingComponents
83
83
  def components_in_use
84
84
  matches = []
85
85
 
86
- files = Dir["#{@application_path}/app/views/**/*.html.erb"]
86
+ files = Dir["#{@application_path}/app/views/**/*.erb"]
87
87
  files.concat Dir["#{@application_path}/app/**/*.rb"]
88
- files.concat Dir["#{@application_path}/lib/**/*.rb"]
88
+ files.concat Dir["#{@application_path}/lib/**/*.{rb,erb}"]
89
89
 
90
90
  files.each do |file|
91
91
  data = File.read(file)
@@ -3,14 +3,14 @@ module GovukPublishingComponents
3
3
  attr_reader :data
4
4
 
5
5
  def initialize(path, name)
6
- templates = Dir["#{path}/app/views/**/*.html.erb"]
6
+ templates = Dir["#{path}/app/views/**/*.erb"]
7
7
  stylesheets = Dir["#{path}/app/assets/stylesheets/**/*.scss"]
8
8
  javascripts = Dir["#{path}/app/assets/javascripts/**/*.js"]
9
9
 
10
- find_templates = /(?<=govuk_publishing_components\/components\/)[\/a-zA-Z_-]+(?=['"])/
10
+ find_components = /(?<=govuk_publishing_components\/components\/)[\/a-zA-Z_-]+(?=['"])/
11
11
 
12
12
  @find_all_stylesheets = /@import ["']{1}govuk_publishing_components\/all_components/
13
- find_stylesheets = /(?<=@import ["']{1}govuk_publishing_components\/components\/)(?!print)+[a-zA-Z_-]+(?=['"])/
13
+ find_stylesheets = /(?<=@import ["']{1}govuk_publishing_components\/components\/)(?!print\/)+[a-zA-Z_-]+(?=['"])/
14
14
 
15
15
  @find_all_print_stylesheets = /@import ["']{1}govuk_publishing_components\/all_components_print/
16
16
  find_print_stylesheets = /(?<=@import ["']{1}govuk_publishing_components\/components\/print\/)[a-zA-Z_-]+(?=['"])/
@@ -18,25 +18,23 @@ module GovukPublishingComponents
18
18
  @find_all_javascripts = /\/\/[ ]*= require govuk_publishing_components\/all_components/
19
19
  find_javascripts = /(?<=require govuk_publishing_components\/components\/)[a-zA-Z_-]+/
20
20
 
21
- components_in_templates = find_components(templates, find_templates, "templates") || []
21
+ components_in_templates = find_components(templates, find_components, "templates") || []
22
22
  components_in_stylesheets = find_components(stylesheets, find_stylesheets, "stylesheets") || []
23
23
  components_in_print_stylesheets = find_components(stylesheets, find_print_stylesheets, "print_stylesheets") || []
24
24
  components_in_javascripts = find_components(javascripts, find_javascripts, "javascripts") || []
25
25
 
26
- find_ruby = /(?<=render\(["']{1}govuk_publishing_components\/components\/)[a-zA-Z_-]+/
27
26
  ruby_paths = %w[/app/helpers/ /app/presenters/ /lib/]
28
-
29
27
  components_in_ruby = []
30
28
  ruby_paths.each do |ruby_path|
31
- components_in_ruby << find_components(Dir["#{path}#{ruby_path}**/*.rb"], find_ruby, "ruby") || []
29
+ components_in_ruby << find_components(Dir["#{path}#{ruby_path}**/*.{rb,erb}"], find_components, "ruby") || []
32
30
  end
33
-
34
31
  components_in_ruby = components_in_ruby.flatten.uniq
35
32
 
36
- @data = {
37
- name: name,
38
- application_found: application_exists(path),
39
- components_found: [
33
+ application_found = application_exists(path)
34
+ components_found = []
35
+
36
+ if application_found
37
+ components_found = [
40
38
  {
41
39
  location: "templates",
42
40
  components: components_in_templates,
@@ -57,7 +55,13 @@ module GovukPublishingComponents
57
55
  location: "ruby",
58
56
  components: components_in_ruby,
59
57
  },
60
- ],
58
+ ]
59
+ end
60
+
61
+ @data = {
62
+ name: name,
63
+ application_found: application_found,
64
+ components_found: components_found,
61
65
  }
62
66
  end
63
67
 
@@ -69,6 +73,8 @@ module GovukPublishingComponents
69
73
  files.each do |file|
70
74
  src = File.read(file)
71
75
  components_found << find_match(find, src, type)
76
+ rescue StandardError
77
+ puts "File #{file} not found"
72
78
  end
73
79
 
74
80
  components_found.flatten.uniq.sort
@@ -1,11 +1,13 @@
1
1
  module GovukPublishingComponents
2
2
  class AuditComparer
3
- attr_reader :data, :gem_data
3
+ attr_reader :applications_data, :gem_data
4
4
 
5
5
  def initialize(gem_data, results)
6
- @gem_data = gem_data
7
- @data = sort_results(results)
8
- @gem_data[:components_by_application] = get_components_by_application
6
+ if gem_data[:gem_found]
7
+ @gem_data = gem_data
8
+ @applications_data = sort_results(results)
9
+ @gem_data[:components_by_application] = get_components_by_application || []
10
+ end
9
11
  end
10
12
 
11
13
  private
@@ -18,51 +20,58 @@ module GovukPublishingComponents
18
20
  data = []
19
21
 
20
22
  results.each do |result|
21
- templates = result[:components_found].find { |c| c[:location] == "templates" }
22
- stylesheets = result[:components_found].find { |c| c[:location] == "stylesheets" }
23
- print_stylesheets = result[:components_found].find { |c| c[:location] == "print_stylesheets" }
24
- javascripts = result[:components_found].find { |c| c[:location] == "javascripts" }
25
- ruby = result[:components_found].find { |c| c[:location] == "ruby" }
26
-
27
- @all_stylesheets = true if stylesheets[:components].include?("all")
28
- @all_print_stylesheets = true if print_stylesheets[:components].include?("all")
29
- @all_javascripts = true if javascripts[:components].include?("all")
30
-
31
- templates[:components] = include_any_components_within_components(templates[:components])
32
-
33
- warnings = []
34
- warnings << warn_about_missing_components(result[:components_found])
35
- warnings << warn_about_missing_assets(result[:components_found])
36
- warnings = warnings.flatten
37
-
38
- data << {
39
- name: result[:name],
40
- application_found: result[:application_found],
41
- summary: [
42
- {
43
- name: "Components in templates",
44
- value: templates[:components].flatten.uniq.sort.join(", "),
45
- },
46
- {
47
- name: "Components in stylesheets",
48
- value: stylesheets[:components].join(", "),
49
- },
50
- {
51
- name: "Components in print stylesheets",
52
- value: print_stylesheets[:components].join(", "),
53
- },
54
- {
55
- name: "Components in javascripts",
56
- value: javascripts[:components].join(", "),
57
- },
58
- {
59
- name: "Components in ruby",
60
- value: ruby[:components].join(", "),
61
- },
62
- ],
63
- warnings: warnings,
64
- warning_count: warnings.length,
65
- }
23
+ if result[:application_found]
24
+ templates = result[:components_found].find { |c| c[:location] == "templates" }
25
+ stylesheets = result[:components_found].find { |c| c[:location] == "stylesheets" }
26
+ print_stylesheets = result[:components_found].find { |c| c[:location] == "print_stylesheets" }
27
+ javascripts = result[:components_found].find { |c| c[:location] == "javascripts" }
28
+ ruby = result[:components_found].find { |c| c[:location] == "ruby" }
29
+
30
+ @all_stylesheets = true if stylesheets[:components].include?("all")
31
+ @all_print_stylesheets = true if print_stylesheets[:components].include?("all")
32
+ @all_javascripts = true if javascripts[:components].include?("all")
33
+
34
+ templates[:components] = include_any_components_within_components(templates[:components])
35
+
36
+ warnings = []
37
+ warnings << warn_about_missing_components(result[:components_found])
38
+ warnings << warn_about_missing_assets(result[:components_found])
39
+ warnings = warnings.flatten
40
+
41
+ data << {
42
+ name: result[:name],
43
+ application_found: result[:application_found],
44
+ summary: [
45
+ {
46
+ name: "Components in templates",
47
+ value: templates[:components].flatten.uniq.sort.join(", "),
48
+ },
49
+ {
50
+ name: "Components in stylesheets",
51
+ value: stylesheets[:components].join(", "),
52
+ },
53
+ {
54
+ name: "Components in print stylesheets",
55
+ value: print_stylesheets[:components].join(", "),
56
+ },
57
+ {
58
+ name: "Components in javascripts",
59
+ value: javascripts[:components].join(", "),
60
+ },
61
+ {
62
+ name: "Components in ruby",
63
+ value: ruby[:components].join(", "),
64
+ },
65
+ ],
66
+ warnings: warnings,
67
+ warning_count: warnings.length,
68
+ }
69
+ else
70
+ data << {
71
+ name: result[:name],
72
+ application_found: result[:application_found],
73
+ }
74
+ end
66
75
  end
67
76
 
68
77
  data
@@ -147,12 +156,16 @@ module GovukPublishingComponents
147
156
 
148
157
  def get_components_by_application
149
158
  results = []
159
+ found_something = false
150
160
 
151
161
  @gem_data[:component_listing].each do |component|
152
162
  found_in_applications = []
153
163
 
154
- @data.each do |application|
164
+ @applications_data.each do |application|
165
+ next unless application[:application_found]
166
+
155
167
  name = application[:name]
168
+ found_something = true
156
169
 
157
170
  application[:summary].each do |item|
158
171
  found_in_applications << name if item[:value].include?(component[:name])
@@ -166,7 +179,7 @@ module GovukPublishingComponents
166
179
  }
167
180
  end
168
181
 
169
- results
182
+ results if found_something
170
183
  end
171
184
  end
172
185
  end