govuk_publishing_components 21.55.3 → 21.55.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 417ac5b68c2937c585f441854215684db548772993c21ca5fcd4cda7a34fdf0f
4
- data.tar.gz: 206dc5df8e79d3d92c3a0bcc8e2823a41d6f61b5bfd1ecf6df1ce5dd01cd7004
3
+ metadata.gz: 19ad2a3cf6f68efd7fe8140b3601107d25fff6dd67c3f05b8cde19a0a0cc74f9
4
+ data.tar.gz: 0bb67a7c588c7af08bfbb26159659f6801fece123836933755ba22fac236f3d6
5
5
  SHA512:
6
- metadata.gz: 05bab4bb91aaf768e8998f8be4c3088600ee4c75e7bf8873d9023421e5e686937118d021efaa939f8bbc2e2020520369099dfcb1bda1c14dd5eb1883ffde045d
7
- data.tar.gz: 266f2889088edc5bf591597d3d6608fe023171e1d8b53895c5cd887b4a845e85e2ed61d690e3f7c85bb0f6e62b05c8648b87639ff3c8f53c5f7702c7c6c1bcc5
6
+ metadata.gz: d2ba559e148e74aec769f2fe1a4cdaa153703290c2c24da22b9607efe9930eba555fe31809f985d18fa481bb5213b24adbbb2bcda2d3b4baa754e7551c8e7e55
7
+ data.tar.gz: 8e84ad0c10264daf7b9a8898f513b9646db50ae1998b4ff3e723b1c45a2a122e135be33f1fbaa79e2dfae15def7fa939c6b162c1259c201b6603c868eefd4d22
@@ -1,8 +1,6 @@
1
1
  .gem-c-feedback {
2
2
  background: govuk-colour("white");
3
- margin: govuk-spacing(6) auto 0 auto;
4
- max-width: $govuk-page-width;
5
- position: relative;
3
+ margin-top: govuk-spacing(6);
6
4
 
7
5
  @include govuk-media-query($from: tablet) {
8
6
  margin-top: govuk-spacing(9);
@@ -182,7 +180,6 @@
182
180
  }
183
181
 
184
182
  .gem-c-feedback__form {
185
- margin: govuk-spacing(3) govuk-spacing(2) 0 govuk-spacing(2);
186
183
  padding: govuk-spacing(3) 0;
187
184
  border-top: govuk-spacing(2) solid govuk-colour("blue");
188
185
 
@@ -2,6 +2,8 @@ module GovukPublishingComponents
2
2
  class ComponentGuideController < GovukPublishingComponents::ApplicationController
3
3
  append_view_path File.join(Rails.root, "app", "views", GovukPublishingComponents::Config.component_directory_name)
4
4
 
5
+ MATCH_COMPONENTS = /(?<=govuk_publishing_components\/components\/)[\/a-zA-Z_-]+(?=['"])/.freeze
6
+
5
7
  def index
6
8
  @application_path = Rails.root
7
9
  @component_gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
@@ -86,24 +88,30 @@ module GovukPublishingComponents
86
88
 
87
89
  files.each do |file|
88
90
  data = File.read(file)
89
- matches << data.scan(/(govuk_publishing_components\/components\/[a-z_-]+)/)
91
+ matches << data.scan(MATCH_COMPONENTS)
90
92
  end
91
93
 
92
- matches.flatten.uniq.map(&:to_s).sort.map { |m| m.gsub("govuk_publishing_components/components/", "") }
94
+ matches.flatten.uniq.map(&:to_s).sort
93
95
  end
94
96
 
95
- def find_all_partials_in(components)
96
- components_to_search = components
97
- partials_found = true
97
+ def find_all_partials_in(templates)
98
+ components = [templates]
99
+
100
+ templates.each do |template|
101
+ partials_found = true
102
+ components_to_search = [template]
103
+ components_found = []
98
104
 
99
- while partials_found
100
- extra_components = find_partials_in(components_to_search)
105
+ while partials_found
106
+ extra_components = find_partials_in(components_to_search)
101
107
 
102
- if extra_components.any?
103
- components << extra_components
104
- components_to_search = extra_components
105
- else
106
- partials_found = false
108
+ if extra_components.any?
109
+ components_found << extra_components
110
+ components_to_search = extra_components
111
+ else
112
+ partials_found = false
113
+ components << components_found.uniq.sort if components_found.any?
114
+ end
107
115
  end
108
116
  end
109
117
 
@@ -113,8 +121,7 @@ module GovukPublishingComponents
113
121
  def find_partials_in(components)
114
122
  extra_components = []
115
123
  components.each do |component|
116
- components_in_component = components_within_component(component)
117
- extra_components << components_in_component
124
+ extra_components << components_within_component(component)
118
125
  end
119
126
 
120
127
  extra_components.flatten.uniq.sort
@@ -132,9 +139,12 @@ module GovukPublishingComponents
132
139
  def components_within_component(component)
133
140
  filename = @component_gem_path + "/app/views/govuk_publishing_components/components/#{component}.html.erb"
134
141
  filename = filename.sub(/.*\K\//, "/_") # files begin with _ but the method may have been passed 'filename' or 'dir/partial'
142
+
143
+ return [] unless File.file?(filename)
144
+
135
145
  data = File.read(filename)
136
- match = data.scan(/(govuk_publishing_components\/components\/[\/a-z_-]+)/)
137
- match.flatten.uniq.map(&:to_s).sort.map { |m| m.gsub("govuk_publishing_components/components/", "") }
146
+ match = data.scan(MATCH_COMPONENTS)
147
+ match.flatten.uniq.map(&:to_s).sort
138
148
  end
139
149
 
140
150
  def index_breadcrumb
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "21.55.3".freeze
2
+ VERSION = "21.55.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 21.55.3
4
+ version: 21.55.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters