forest_admin_agent 1.19.2 → 1.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/forest_admin_agent/routes/capabilities/collections.rb +4 -2
- data/lib/forest_admin_agent/serializer/forest_serializer.rb +1 -4
- data/lib/forest_admin_agent/services/permissions.rb +1 -1
- data/lib/forest_admin_agent/utils/schema/schema_emitter.rb +1 -1
- data/lib/forest_admin_agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e96dce4393e473082f182c844d8eb326f13d17e0c218491e8ada351f163e3f1d
|
|
4
|
+
data.tar.gz: 33d5ddd5ab3b12d4894149ce64c7cd5e30cdf9e88c04b4b9f8703139012953b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c575d698994b03c2b70efdaf09d51892c4801040f988e02c0c11c4eb9243a61582d95a96adfab95cb46d75a1b498de2c76fca0a11afa0f45eba211244ce21890
|
|
7
|
+
data.tar.gz: 1d2e9f9e5f1da2256feac3d0b6ce4d8b35836b0da660f15d3907728a651275af801a7dba9f84944af87b6c7230143ef49685bda46d4cbd78871817ab11d1099d
|
|
@@ -24,11 +24,13 @@ module ForestAdminAgent
|
|
|
24
24
|
collection = datasource.get_collection(collection_name)
|
|
25
25
|
{
|
|
26
26
|
name: collection.name,
|
|
27
|
-
fields: collection.schema[:fields].
|
|
27
|
+
fields: collection.schema[:fields].filter_map do |name, field|
|
|
28
|
+
next unless field.is_a?(ColumnSchema)
|
|
29
|
+
|
|
28
30
|
{
|
|
29
31
|
name: name,
|
|
30
32
|
type: field.column_type,
|
|
31
|
-
operators: field.filter_operators.
|
|
33
|
+
operators: field.filter_operators.to_a
|
|
32
34
|
}
|
|
33
35
|
end
|
|
34
36
|
}
|
|
@@ -29,10 +29,7 @@ module ForestAdminAgent
|
|
|
29
29
|
@options[:class_name].gsub('::', '__')
|
|
30
30
|
)
|
|
31
31
|
primary_keys = ForestAdminDatasourceToolkit::Utils::Schema.primary_keys(forest_collection)
|
|
32
|
-
|
|
33
|
-
primary_keys.each { |key| id << @object[key] }
|
|
34
|
-
|
|
35
|
-
id.join('|')
|
|
32
|
+
primary_keys.map { |key| @object[key] }.join('|')
|
|
36
33
|
end
|
|
37
34
|
|
|
38
35
|
def format_name(attribute_name)
|
|
@@ -263,7 +263,7 @@ module ForestAdminAgent
|
|
|
263
263
|
def find_action_from_endpoint(collection_name, path, http_method)
|
|
264
264
|
endpoint = path.partition('/forest/')[1..].join
|
|
265
265
|
schema_file = JSON.parse(File.read(Facades::Container.config_from_cache[:schema_path]))
|
|
266
|
-
actions = schema_file['collections']&.
|
|
266
|
+
actions = schema_file['collections']&.find { |collection| collection['name'] == collection_name }&.dig('actions')
|
|
267
267
|
|
|
268
268
|
return nil if actions.nil? || actions.empty?
|
|
269
269
|
|