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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19ad2a3cf6f68efd7fe8140b3601107d25fff6dd67c3f05b8cde19a0a0cc74f9
|
4
|
+
data.tar.gz: 0bb67a7c588c7af08bfbb26159659f6801fece123836933755ba22fac236f3d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
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(
|
91
|
+
matches << data.scan(MATCH_COMPONENTS)
|
90
92
|
end
|
91
93
|
|
92
|
-
matches.flatten.uniq.map(&:to_s).sort
|
94
|
+
matches.flatten.uniq.map(&:to_s).sort
|
93
95
|
end
|
94
96
|
|
95
|
-
def find_all_partials_in(
|
96
|
-
|
97
|
-
|
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
|
-
|
100
|
-
|
105
|
+
while partials_found
|
106
|
+
extra_components = find_partials_in(components_to_search)
|
101
107
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
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
|
-
|
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(
|
137
|
-
match.flatten.uniq.map(&:to_s).sort
|
146
|
+
match = data.scan(MATCH_COMPONENTS)
|
147
|
+
match.flatten.uniq.map(&:to_s).sort
|
138
148
|
end
|
139
149
|
|
140
150
|
def index_breadcrumb
|
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.
|
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-
|
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
|