avo 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/builds/avo.base.css +535 -325
- data/app/assets/builds/avo.base.js +865 -7386
- data/app/assets/builds/avo.base.js.map +3 -3
- data/app/components/avo/resource_component.rb +1 -1
- data/lib/avo/concerns/has_items.rb +20 -14
- data/lib/avo/version.rb +1 -1
- metadata +2 -2
@@ -114,7 +114,7 @@ class Avo::ResourceComponent < Avo::BaseComponent
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def sidebars
|
117
|
-
return if Avo.license.lacks_with_trial(:resource_sidebar)
|
117
|
+
return [] if Avo.license.lacks_with_trial(:resource_sidebar)
|
118
118
|
|
119
119
|
@item.items.select do |item|
|
120
120
|
item.is_sidebar?
|
@@ -87,19 +87,19 @@ module Avo
|
|
87
87
|
unless only_root
|
88
88
|
# Dive into panels to fetch their fields
|
89
89
|
if item.is_panel?
|
90
|
-
fields <<
|
90
|
+
fields << extract_fields(item)
|
91
91
|
end
|
92
92
|
|
93
93
|
# Dive into tabs to fetch their fields
|
94
94
|
if item.is_tab_group?
|
95
95
|
item.items.map do |tab|
|
96
|
-
fields <<
|
96
|
+
fields << extract_fields(tab)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
100
|
# Dive into sidebar to fetch their fields
|
101
101
|
if item.is_sidebar?
|
102
|
-
fields <<
|
102
|
+
fields << extract_fields(item)
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
@@ -108,11 +108,11 @@ module Avo
|
|
108
108
|
end
|
109
109
|
|
110
110
|
if item.is_row?
|
111
|
-
fields <<
|
111
|
+
fields << extract_fields(tab)
|
112
112
|
end
|
113
113
|
|
114
114
|
if item.is_main_panel?
|
115
|
-
fields <<
|
115
|
+
fields << extract_fields(item)
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
@@ -309,18 +309,24 @@ module Avo
|
|
309
309
|
end
|
310
310
|
end
|
311
311
|
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
312
|
+
# Extracts fields from a structure
|
313
|
+
# Structures can be panels, rows and sidebars
|
314
|
+
def extract_fields(structure)
|
315
|
+
structure.items.map do |item|
|
316
316
|
if item.is_field?
|
317
|
-
|
318
|
-
elsif
|
319
|
-
|
317
|
+
item
|
318
|
+
elsif extractable_structure?(item)
|
319
|
+
extract_fields(item)
|
320
|
+
else
|
321
|
+
nil
|
320
322
|
end
|
321
|
-
end
|
323
|
+
end.compact
|
324
|
+
end
|
322
325
|
|
323
|
-
|
326
|
+
# Extractable structures are panels, rows and sidebars
|
327
|
+
# Sidebars are only extractable if they are not on the index view
|
328
|
+
def extractable_structure?(structure)
|
329
|
+
structure.is_panel? || structure.is_row? || (structure.is_sidebar? && !view.index?)
|
324
330
|
end
|
325
331
|
|
326
332
|
# Standalone items are fields that don't have their own panel
|
data/lib/avo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-11-
|
12
|
+
date: 2023-11-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|