govuk_publishing_components 24.6.0 → 24.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/application.js +3 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +7 -5
  4. data/app/assets/javascripts/govuk_publishing_components/components/details.js +2 -1
  5. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +1 -0
  6. data/app/assets/javascripts/govuk_publishing_components/modules.js +3 -1
  7. data/app/assets/stylesheets/component_guide/application.scss +1 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -4
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +10 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +8 -7
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +15 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -32
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +0 -5
  14. data/app/controllers/govuk_publishing_components/audit_controller.rb +21 -17
  15. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +9 -0
  16. data/app/helpers/govuk_publishing_components/application_helper.rb +3 -0
  17. data/app/models/govuk_publishing_components/audit_applications.rb +3 -3
  18. data/app/models/govuk_publishing_components/audit_comparer.rb +16 -8
  19. data/app/models/govuk_publishing_components/audit_components.rb +6 -3
  20. data/app/views/govuk_publishing_components/audit/_applications.html.erb +126 -0
  21. data/app/views/govuk_publishing_components/audit/_components.html.erb +142 -0
  22. data/app/views/govuk_publishing_components/audit/show.html.erb +22 -277
  23. data/app/views/govuk_publishing_components/component_guide/index.html.erb +16 -0
  24. data/app/views/govuk_publishing_components/components/_image_card.html.erb +14 -11
  25. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +7 -2
  26. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +48 -7
  27. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +15 -12
  28. data/app/views/govuk_publishing_components/components/_success_alert.html.erb +24 -8
  29. data/app/views/govuk_publishing_components/components/_summary_list.html.erb +2 -2
  30. data/app/views/govuk_publishing_components/components/_title.html.erb +6 -2
  31. data/app/views/govuk_publishing_components/components/docs/button.yml +7 -6
  32. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +3 -0
  33. data/app/views/govuk_publishing_components/components/docs/image_card.yml +12 -0
  34. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +26 -0
  35. data/app/views/govuk_publishing_components/components/docs/modal_dialogue.yml +3 -0
  36. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +12 -1
  37. data/app/views/govuk_publishing_components/components/docs/summary_list.yml +18 -1
  38. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +8 -1
  39. data/config/locales/ar.yml +1 -0
  40. data/config/locales/az.yml +1 -0
  41. data/config/locales/be.yml +1 -0
  42. data/config/locales/bg.yml +1 -0
  43. data/config/locales/bn.yml +1 -0
  44. data/config/locales/cs.yml +1 -0
  45. data/config/locales/da.yml +1 -0
  46. data/config/locales/de.yml +1 -0
  47. data/config/locales/dr.yml +1 -0
  48. data/config/locales/el.yml +1 -0
  49. data/config/locales/en.yml +2 -0
  50. data/config/locales/es-419.yml +1 -0
  51. data/config/locales/es.yml +1 -0
  52. data/config/locales/fa.yml +1 -0
  53. data/config/locales/fi.yml +1 -0
  54. data/config/locales/gd.yml +1 -0
  55. data/config/locales/gu.yml +1 -0
  56. data/config/locales/he.yml +1 -0
  57. data/config/locales/hi.yml +1 -0
  58. data/config/locales/hr.yml +1 -0
  59. data/config/locales/hu.yml +1 -0
  60. data/config/locales/hy.yml +1 -0
  61. data/config/locales/id.yml +1 -0
  62. data/config/locales/is.yml +1 -0
  63. data/config/locales/it.yml +1 -0
  64. data/config/locales/ja.yml +1 -0
  65. data/config/locales/ka.yml +1 -0
  66. data/config/locales/kk.yml +1 -0
  67. data/config/locales/ko.yml +1 -0
  68. data/config/locales/lt.yml +1 -0
  69. data/config/locales/lv.yml +1 -0
  70. data/config/locales/ms.yml +1 -0
  71. data/config/locales/mt.yml +1 -0
  72. data/config/locales/nl.yml +1 -0
  73. data/config/locales/no.yml +1 -0
  74. data/config/locales/pa-pk.yml +1 -0
  75. data/config/locales/pa.yml +1 -0
  76. data/config/locales/pl.yml +1 -0
  77. data/config/locales/ps.yml +1 -0
  78. data/config/locales/pt.yml +1 -0
  79. data/config/locales/ro.yml +1 -0
  80. data/config/locales/ru.yml +1 -0
  81. data/config/locales/si.yml +1 -0
  82. data/config/locales/sk.yml +1 -0
  83. data/config/locales/sl.yml +1 -0
  84. data/config/locales/so.yml +1 -0
  85. data/config/locales/sq.yml +1 -0
  86. data/config/locales/sr.yml +1 -0
  87. data/config/locales/sv.yml +1 -0
  88. data/config/locales/sw.yml +1 -0
  89. data/config/locales/ta.yml +1 -0
  90. data/config/locales/th.yml +1 -0
  91. data/config/locales/tk.yml +1 -0
  92. data/config/locales/tr.yml +1 -0
  93. data/config/locales/uk.yml +1 -0
  94. data/config/locales/ur.yml +1 -0
  95. data/config/locales/uz.yml +1 -0
  96. data/config/locales/vi.yml +1 -0
  97. data/config/locales/zh-hk.yml +1 -0
  98. data/config/locales/zh-tw.yml +1 -0
  99. data/config/locales/zh.yml +1 -0
  100. data/lib/govuk_publishing_components/presenters/button_helper.rb +13 -2
  101. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +5 -0
  102. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +15 -31
  103. data/lib/govuk_publishing_components/presenters/shared_helper.rb +10 -0
  104. data/lib/govuk_publishing_components/version.rb +1 -1
  105. metadata +68 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6831e98d8b1db5f3d0cef2f7a7e7cc5439f4bfed8e1c929aedcf9fc98774a7c
4
- data.tar.gz: 85579af6ac2c4ab5970ef2c55d64e1ef8bbbd8978635a00186514e86a53340aa
3
+ metadata.gz: d79929a27b4001f7a46caed7050ee5c3d04eda5137c21e8a28bef4cd12b8ce54
4
+ data.tar.gz: 957d3905b7989a6eda0c9bb54e262b197fee924df5cd7edc56d983018f650577
5
5
  SHA512:
6
- metadata.gz: 92158ef074a519f279584aadd38bab2d44fac46b04ee7fffe62bfb8d1d3a15f41825e12d666a692c200dee5baf827bc82190642b48443918f90cd6a62e57c277
7
- data.tar.gz: 4937053696a56e4b30b89b9190a3ab99f6c5b080774acc89395eecf6549c233a219ac857fef5d6aa0e8e93671097178f66cec5091660a13e29677ee1d030e13a
6
+ metadata.gz: b3f25112299f7b0c198c884293a3932176bb299bc0d7477434f1124facb36b03fe365ecfca09a249844e5701c881e64a359e3be2fb71995daf74bfd0f56ee38c
7
+ data.tar.gz: cbacbec44192f78e41925a071ef9e0b854e0690b4d999d8515e7828071cd8a620044ee3182ac7eb3e50069f3e077ea4d8cd560bce8c4d89da9d0b41b7104c3b2
@@ -1,2 +1,5 @@
1
1
  //= require_tree ./vendor
2
2
  //= require_tree .
3
+ //= require ../govuk_publishing_components/dependencies
4
+ //= require ../govuk_publishing_components/components/accordion
5
+ //= require ../govuk_publishing_components/components/tabs
@@ -293,8 +293,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
293
293
 
294
294
  // Navigate to and open accordions with anchored content on page load if a hash is present
295
295
  GemAccordion.prototype.openByAnchorOnLoad = function () {
296
- if (window.location.hash && this.$module.querySelector(window.location.hash)) {
297
- this.openForAnchor(window.location.hash)
296
+ var splitHash = window.location.hash.split('#')[1]
297
+
298
+ if (window.location.hash && document.getElementById(splitHash)) {
299
+ this.openForAnchor(splitHash)
298
300
  }
299
301
  }
300
302
 
@@ -305,20 +307,20 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
305
307
 
306
308
  links.forEach(function (link) {
307
309
  if (link.pathname === window.location.pathname) {
308
- link.addEventListener('click', this.openForAnchor.bind(this, link.hash))
310
+ link.addEventListener('click', this.openForAnchor.bind(this, link.hash.split('#')[1]))
309
311
  }
310
312
  }.bind(this))
311
313
  }
312
314
 
313
315
  // Find the parent accordion section for the given id and open it
314
316
  GemAccordion.prototype.openForAnchor = function (hash) {
315
- var target = document.querySelector(hash)
317
+ var target = document.getElementById(hash)
316
318
  var section = this.getContainingSection(target)
317
319
 
318
320
  this.setExpanded(true, section)
319
321
  }
320
322
 
321
- // Loop through the given ids ancestors until the parent section class is found
323
+ // Loop through the given id's ancestors until the parent section class is found
322
324
  GemAccordion.prototype.getContainingSection = function (target) {
323
325
  while (!target.classList.contains(this.sectionClass)) {
324
326
  target = target.parentElement
@@ -1,7 +1,8 @@
1
1
  /* eslint-env jquery */
2
2
  // = require govuk/components/details/details.js
3
3
  window.GOVUK = window.GOVUK || {}
4
- window.GOVUK.Modules = window.GOVUK.Modules || {};
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.Details = window.GOVUKFrontend;
5
6
 
6
7
  (function (Modules) {
7
8
  function GovukDetails () { }
@@ -25,6 +25,7 @@
25
25
  govuk_browser_upgrade_dismisssed: 'settings',
26
26
  govuk_not_first_visit: 'settings',
27
27
  analytics_next_page_call: 'usage',
28
+ user_nation: 'settings',
28
29
  _ga: 'usage',
29
30
  _gid: 'usage',
30
31
  _gat: 'usage',
@@ -40,7 +40,9 @@
40
40
  module = new GOVUK.Modules[moduleName]()
41
41
  module.start(element)
42
42
  element.data('module-started', true)
43
- } else if ( // GOV.UK Frontend Modules
43
+ }
44
+
45
+ if ( // GOV.UK Frontend Modules
44
46
  typeof GOVUK.Modules[frontendModuleName] === 'function' &&
45
47
  GOVUK.Modules[frontendModuleName].prototype.init &&
46
48
  !started
@@ -148,7 +148,7 @@ $gem-guide-border-width: 1px;
148
148
 
149
149
  .component-guide-preview--simple {
150
150
  border: 0;
151
- padding: 0;
151
+ padding: govuk-spacing(2);
152
152
 
153
153
  &:before {
154
154
  display: none;
@@ -59,12 +59,10 @@
59
59
  }
60
60
 
61
61
  .gem-c-image-card__title {
62
- @include govuk-font(19, $weight: bold);
63
62
  margin: 0;
64
63
  }
65
64
 
66
65
  .gem-c-image-card__title-link {
67
- @extend %govuk-link;
68
66
  text-decoration: none;
69
67
 
70
68
  &:hover {
@@ -136,7 +134,6 @@
136
134
  }
137
135
 
138
136
  .gem-c-image-card__list-item-link {
139
- @extend %govuk-link;
140
137
  line-height: 1.35em;
141
138
  }
142
139
 
@@ -193,7 +190,6 @@
193
190
  }
194
191
 
195
192
  .gem-c-image-card__title {
196
- @include govuk-font(24, $weight: bold);
197
193
  padding-bottom: govuk-spacing(2);
198
194
  }
199
195
 
@@ -1,4 +1,13 @@
1
1
  .gem-c-layout-for-public {
2
- margin: 0;
3
2
  font-family: $govuk-font-family;
4
3
  }
4
+
5
+ .gem-c-layout-for-public__blue-bar {
6
+ background: $govuk-brand-colour;
7
+ height: govuk-spacing(2);
8
+ }
9
+
10
+ .js-enabled .gem-c-layout-for-public__global-banner-wrapper {
11
+ margin-top: - govuk-spacing(2);
12
+ position: relative;
13
+ }
@@ -78,12 +78,14 @@
78
78
  }
79
79
  }
80
80
 
81
- .gem-c-layout-header__search.govuk-grid-column-one-third-from-desktop,
82
- .gem-c-layout-header__logo.govuk-grid-column-one-third-from-desktop,
83
- .gem-c-layout-header__search.govuk-grid-column-one-third,
84
- .gem-c-layout-header__logo.govuk-grid-column-two-thirds {
85
- padding-right: 0;
86
- padding-left: 0;
81
+ @include govuk-compatibility(govuk_template) {
82
+ .gem-c-layout-header__search.govuk-grid-column-one-third-from-desktop,
83
+ .gem-c-layout-header__logo.govuk-grid-column-one-third-from-desktop,
84
+ .gem-c-layout-header__search.govuk-grid-column-one-third,
85
+ .gem-c-layout-header__logo.govuk-grid-column-two-thirds {
86
+ padding-right: 0;
87
+ padding-left: 0;
88
+ }
87
89
  }
88
90
 
89
91
  .gem-c-layout-header__logo,
@@ -104,7 +106,6 @@
104
106
 
105
107
  .gem-c-header__content.govuk-header__content {
106
108
  width: auto;
107
- padding-left: 0;
108
109
 
109
110
  @include govuk-media-query($from: desktop) {
110
111
  float: right;
@@ -9,7 +9,6 @@ $large-input-size: 50px;
9
9
  .gem-c-search__label {
10
10
  @include govuk-font($size: 19, $line-height: $input-size);
11
11
  display: block;
12
- background: govuk-colour("white");
13
12
  color: $govuk-text-colour;
14
13
 
15
14
  h1 {
@@ -25,6 +24,7 @@ $large-input-size: 50px;
25
24
  padding-left: govuk-spacing(3);
26
25
  z-index: 1;
27
26
  color: $govuk-secondary-text-colour;
27
+ background: govuk-colour("white");
28
28
  }
29
29
 
30
30
  // match label colour with the label component colour
@@ -144,6 +144,10 @@ $large-input-size: 50px;
144
144
  }
145
145
 
146
146
  .gem-c-search--on-govuk-blue {
147
+ .gem-c-search__label {
148
+ color: govuk-colour("white");
149
+ }
150
+
147
151
  .gem-c-search__input {
148
152
  border-width: 0;
149
153
 
@@ -191,9 +195,19 @@ $large-input-size: 50px;
191
195
  }
192
196
 
193
197
  .gem-c-search--no-border {
198
+ .gem-c-search__label {
199
+ color: govuk-colour("white");
200
+ }
201
+
194
202
  .gem-c-search__input[type="search"] {
195
203
  border: 0;
196
204
  }
205
+
206
+ .js-enabled & {
207
+ .gem-c-search__label {
208
+ color: $govuk-secondary-text-colour;
209
+ }
210
+ }
197
211
  }
198
212
 
199
213
  .gem-c-search--large {
@@ -1,36 +1,5 @@
1
- .gem-c-success-alert {
2
- color: $govuk-text-colour;
3
- padding: govuk-spacing(3);
4
- border: $govuk-border-width-narrow solid $govuk-success-colour;
5
- @include govuk-responsive-margin(8, "bottom");
6
-
7
- @include govuk-media-query($from: tablet) {
8
- padding: govuk-spacing(4);
9
- border-width: $govuk-border-width;
10
- }
11
- }
1
+ @import "govuk/components/notification-banner/notification-banner";
12
2
 
13
3
  .gem-c-success-alert__message {
14
4
  @include govuk-font(19, $weight: bold);
15
- margin: 0;
16
- }
17
-
18
- .gem-c-success-summary__title {
19
- margin-top: 0;
20
- margin-bottom: govuk-spacing(3);
21
-
22
- @include govuk-media-query($from: tablet) {
23
- margin-bottom: govuk-spacing(4);
24
- }
25
-
26
- @include govuk-font(24, $weight: bold);
27
- }
28
-
29
- .gem-c-success-summary__body {
30
- @include govuk-font(19);
31
- margin: 0;
32
- }
33
-
34
- .gem-c-success-alert:focus {
35
- outline: $govuk-focus-width solid $govuk-focus-colour;
36
5
  }
@@ -26,10 +26,5 @@
26
26
  }
27
27
 
28
28
  .gem-c-title__text {
29
- @extend %govuk-heading-xl;
30
29
  margin: 0;
31
30
  }
32
-
33
- .gem-c-title__text--long {
34
- @extend %govuk-heading-l;
35
- }
@@ -1,22 +1,7 @@
1
1
  module GovukPublishingComponents
2
2
  class AuditController < GovukPublishingComponents::ApplicationController
3
3
  def show
4
- path = Dir.pwd
5
-
6
- components = AuditComponents.new(path)
7
- applications = analyse_applications(File.expand_path("..", path))
8
- compared_data = AuditComparer.new(components.data, applications)
9
-
10
- @applications = compared_data.applications_data || []
11
- @components = compared_data.gem_data || []
12
- end
13
-
14
- private
15
-
16
- def analyse_applications(path)
17
- results = []
18
- applications = %w[
19
- calculators
4
+ application_dirs = %w[
20
5
  collections
21
6
  collections-publisher
22
7
  content-data-admin
@@ -42,10 +27,29 @@ module GovukPublishingComponents
42
27
  travel-advice-publisher
43
28
  whitehall
44
29
  ].sort
30
+ application_dirs = [GovukPublishingComponents::ApplicationHelper.get_application_name_from_path(Rails.root)] unless ENV["MAIN_COMPONENT_GUIDE"]
31
+
32
+ gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
33
+ gem_path = Dir.pwd if ENV["MAIN_COMPONENT_GUIDE"]
34
+
35
+ components = AuditComponents.new(gem_path, false)
36
+ applications = analyse_applications(File.expand_path("..", gem_path), application_dirs)
37
+ compared_data = AuditComparer.new(components.data, applications, false)
38
+
39
+ @applications = compared_data.applications_data || []
40
+ @components = compared_data.gem_data || []
41
+ end
42
+
43
+ private
44
+
45
+ def analyse_applications(path, application_dirs)
46
+ results = []
47
+ @applications_found = false
45
48
 
46
- applications.each do |application|
49
+ application_dirs.each do |application|
47
50
  application_path = [path, application].join("/")
48
51
  app = AuditApplications.new(application_path, application)
52
+ @applications_found = true if app.data[:application_found]
49
53
  results << app.data
50
54
  end
51
55
 
@@ -13,6 +13,7 @@ module GovukPublishingComponents
13
13
  @components_in_use_sass = components_in_use_sass(false)
14
14
  @components_in_use_print_sass = components_in_use_sass(true)
15
15
  @components_in_use_js = components_in_use_js
16
+ @index_audit_summary = index_audit_summary
16
17
  end
17
18
 
18
19
  def show
@@ -161,5 +162,13 @@ module GovukPublishingComponents
161
162
  h[:url] = component_doc_path(component_doc.id) if component_example
162
163
  end
163
164
  end
165
+
166
+ def index_audit_summary
167
+ components_gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
168
+ components = AuditComponents.new(components_gem_path, true)
169
+ application = AuditApplications.new(@application_path, GovukPublishingComponents::ApplicationHelper.get_application_name_from_path(@application_path))
170
+ compared_data = AuditComparer.new(components.data, [application.data], true)
171
+ compared_data.applications_data[0]
172
+ end
164
173
  end
165
174
  end
@@ -1,4 +1,7 @@
1
1
  module GovukPublishingComponents
2
2
  module ApplicationHelper
3
+ def self.get_application_name_from_path(path)
4
+ path.to_s.split("/")[-1]
5
+ end
3
6
  end
4
7
  end
@@ -86,8 +86,8 @@ module GovukPublishingComponents
86
86
  gem_style_references = find_code_references(file, src, /gem-c-[-_a-zA-Z]+/)
87
87
  @gem_style_references << gem_style_references if gem_style_references
88
88
  end
89
- rescue StandardError
90
- puts "File #{file} not found"
89
+ rescue StandardError => e
90
+ puts e.message
91
91
  end
92
92
 
93
93
  components_found.flatten.uniq.sort
@@ -108,7 +108,7 @@ module GovukPublishingComponents
108
108
  end
109
109
 
110
110
  def find_code_references(file, src, regex)
111
- clean_file_path = /(?<=#{Regexp.escape(@path)}\/)[\/a-zA-Z_-]+.[a-zA-Z.]+/
111
+ clean_file_path = /(?<=#{Regexp.escape(@path.to_s)}\/)[\/a-zA-Z_-]+.[a-zA-Z.]+/
112
112
 
113
113
  return file[clean_file_path] if regex.match?(src)
114
114
  end
@@ -2,10 +2,10 @@ module GovukPublishingComponents
2
2
  class AuditComparer
3
3
  attr_reader :applications_data, :gem_data
4
4
 
5
- def initialize(gem_data, results)
5
+ def initialize(gem_data, results, simple)
6
6
  if gem_data[:gem_found]
7
7
  @gem_data = gem_data
8
- @applications_data = sort_results(results)
8
+ @applications_data = sort_results(results, simple)
9
9
  @gem_data[:components_by_application] = get_components_by_application || []
10
10
  end
11
11
  end
@@ -16,7 +16,8 @@ module GovukPublishingComponents
16
16
  key.to_s.gsub("_", " ").capitalize
17
17
  end
18
18
 
19
- def sort_results(results)
19
+ def sort_results(results, simple)
20
+ @simple = simple
20
21
  data = []
21
22
 
22
23
  results.each do |result|
@@ -40,10 +41,9 @@ module GovukPublishingComponents
40
41
  warnings << warn_about_jquery_references(result[:jquery_references])
41
42
  warnings = warnings.flatten
42
43
 
43
- data << {
44
- name: result[:name],
45
- application_found: result[:application_found],
46
- summary: [
44
+ summary = []
45
+ unless @simple
46
+ summary = [
47
47
  {
48
48
  name: "Components in templates",
49
49
  value: templates[:components].flatten.uniq.sort.join(", "),
@@ -64,7 +64,13 @@ module GovukPublishingComponents
64
64
  name: "Components in ruby",
65
65
  value: ruby[:components].join(", "),
66
66
  },
67
- ],
67
+ ]
68
+ end
69
+
70
+ data << {
71
+ name: result[:name],
72
+ application_found: result[:application_found],
73
+ summary: summary,
68
74
  warnings: warnings,
69
75
  warning_count: warnings.length,
70
76
  gem_style_references: result[:gem_style_references],
@@ -180,6 +186,8 @@ module GovukPublishingComponents
180
186
  end
181
187
 
182
188
  def get_components_by_application
189
+ return [] if @simple
190
+
183
191
  results = []
184
192
  found_something = false
185
193
 
@@ -2,16 +2,17 @@ module GovukPublishingComponents
2
2
  class AuditComponents
3
3
  attr_reader :data
4
4
 
5
- def initialize(path)
5
+ def initialize(path, simple)
6
6
  @data = {
7
7
  gem_found: false,
8
8
  }
9
- @data = compile_data(path) if Dir.exist?(path)
9
+ @data = compile_data(path, simple) if Dir.exist?(path)
10
10
  end
11
11
 
12
12
  private
13
13
 
14
- def compile_data(path)
14
+ def compile_data(path, simple)
15
+ @simple = simple
15
16
  templates_path = "app/views/govuk_publishing_components/components"
16
17
  stylesheets_path = "app/assets/stylesheets/govuk_publishing_components/components"
17
18
  print_stylesheets_path = "app/assets/stylesheets/govuk_publishing_components/components/print"
@@ -128,6 +129,8 @@ module GovukPublishingComponents
128
129
  end
129
130
 
130
131
  def list_all_component_details
132
+ return [] if @simple
133
+
131
134
  all_component_information = []
132
135
 
133
136
  @components.each do |component|