forest_admin_agent 1.0.0.pre.beta.71 → 1.0.0.pre.beta.72
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: c94f2a856dbe3fb0b7ab5968ccb91d1f1ea0894d84b60a9076a5a8fd98b5663a
|
4
|
+
data.tar.gz: 63706206c126f7fb68807e94ccf6b971b40a47f52eb37094c190d5694b874dd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f77e8e90b43a20e9a3b8ca08b98670d4a2f7ee4489cbfb26da5f1be11255d7048882a0a9aede0dc1ae9589d693adc4b0f89add527fc42e5884407fe7a16ab761
|
7
|
+
data.tar.gz: 51a25721acb463d04e93d31f86d4c595b91c887540c0c8bb272a9440fecfa410760578962dd2bf561f1d6bb6add323302d5779b5a9b25059ee04bd8b12434f27
|
@@ -29,7 +29,6 @@ module ForestAdminAgent
|
|
29
29
|
action = collection.schema[:actions][name]
|
30
30
|
action_index = collection.schema[:actions].keys.index(name)
|
31
31
|
slug = get_action_slug(name)
|
32
|
-
|
33
32
|
form_elements = extract_fields_and_layout(collection.get_form(nil, name))
|
34
33
|
if action.static_form?
|
35
34
|
fields = build_fields(collection, form_elements[:fields])
|
@@ -72,6 +71,14 @@ module ForestAdminAgent
|
|
72
71
|
component: field.component.camelize(:lower),
|
73
72
|
fields: field.fields.map { |f| build_layout_schema(f) }
|
74
73
|
}
|
74
|
+
elsif field.component == 'Page'
|
75
|
+
return {
|
76
|
+
**field.to_h,
|
77
|
+
component: field.component.camelize(:lower),
|
78
|
+
elements: field.elements.map do |f|
|
79
|
+
build_layout_schema(f)
|
80
|
+
end
|
81
|
+
}
|
75
82
|
end
|
76
83
|
|
77
84
|
{ **field.to_h, component: field.component.camelize(:lower) }
|
@@ -135,18 +142,15 @@ module ForestAdminAgent
|
|
135
142
|
def self.extract_fields_and_layout(form)
|
136
143
|
fields = []
|
137
144
|
layout = []
|
138
|
-
|
139
145
|
form&.each do |element|
|
140
146
|
if element.type == Actions::FieldType::LAYOUT
|
141
|
-
if element.component
|
142
|
-
extract =
|
143
|
-
element.fields = extract[:layout]
|
147
|
+
if %w[Page Row].include?(element.component)
|
148
|
+
extract = extract_fields_and_layout_for_component(element)
|
144
149
|
layout << element
|
145
150
|
fields.concat(extract[:fields])
|
146
151
|
else
|
147
152
|
layout << element
|
148
153
|
end
|
149
|
-
|
150
154
|
else
|
151
155
|
fields << element
|
152
156
|
# frontend rule
|
@@ -156,6 +160,13 @@ module ForestAdminAgent
|
|
156
160
|
|
157
161
|
{ fields: fields, layout: layout }
|
158
162
|
end
|
163
|
+
|
164
|
+
def self.extract_fields_and_layout_for_component(element)
|
165
|
+
key = element.component == 'Page' ? :elements : :fields
|
166
|
+
extract = extract_fields_and_layout(element.public_send(key))
|
167
|
+
element.public_send(:"#{key}=", extract[:layout])
|
168
|
+
extract
|
169
|
+
end
|
159
170
|
end
|
160
171
|
end
|
161
172
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_admin_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.beta.
|
4
|
+
version: 1.0.0.pre.beta.72
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthieu
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-10-
|
12
|
+
date: 2024-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|