forest_admin_agent 1.25.3 → 1.26.0
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/charts/api_chart_collection.rb +6 -2
- data/lib/forest_admin_agent/routes/charts/api_chart_datasource.rb +6 -2
- data/lib/forest_admin_agent/utils/query_string_parser.rb +11 -0
- data/lib/forest_admin_agent/utils/schema/schema_emitter.rb +1 -1
- data/lib/forest_admin_agent/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71adbcc35e3feebfc927861fe7dc42ac38417c3fc4858dbd48e8179d90f4505c
|
|
4
|
+
data.tar.gz: 82a14e5065e3ff8818be4831117e46cc123e0d60369b72b535d678ff27a57a29
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a032899bf6ec3093c998733825ef77b9a44a8ef7b60ff2fab216405bd05df9e7b5196d1a02bd532fc3bb0c996e55d0fe635e5e8d3ce7a9cdad372f9b6804abad
|
|
7
|
+
data.tar.gz: 9d6aa55dac46ec0003a5286402e1dd475138439d54bf0b3fb7a2097035fbebf4ee5e2e744627d4eacd7536a7f4c26fe83db34dbc2f81e30860aac61bb9b37a5f
|
|
@@ -45,12 +45,14 @@ module ForestAdminAgent
|
|
|
45
45
|
|
|
46
46
|
def handle_api_chart(args)
|
|
47
47
|
context = build(args)
|
|
48
|
+
parameters = Utils::QueryStringParser.parse_chart_parameters(args)
|
|
48
49
|
{
|
|
49
50
|
content: Serializer::ForestChartSerializer.serialize(
|
|
50
51
|
context.collection.render_chart(
|
|
51
52
|
context.caller,
|
|
52
53
|
@chart_name,
|
|
53
|
-
Id.unpack_id(context.collection, args[:params]['record_id'])
|
|
54
|
+
Id.unpack_id(context.collection, args[:params]['record_id']),
|
|
55
|
+
parameters
|
|
54
56
|
)
|
|
55
57
|
)
|
|
56
58
|
}
|
|
@@ -58,11 +60,13 @@ module ForestAdminAgent
|
|
|
58
60
|
|
|
59
61
|
def handle_smart_chart(args)
|
|
60
62
|
context = build(args)
|
|
63
|
+
parameters = Utils::QueryStringParser.parse_chart_parameters(args)
|
|
61
64
|
{
|
|
62
65
|
content: context.collection.render_chart(
|
|
63
66
|
context.caller,
|
|
64
67
|
@chart_name,
|
|
65
|
-
Id.unpack_id(context.collection, args[:params]['record_id'])
|
|
68
|
+
Id.unpack_id(context.collection, args[:params]['record_id']),
|
|
69
|
+
parameters
|
|
66
70
|
)
|
|
67
71
|
}
|
|
68
72
|
end
|
|
@@ -38,13 +38,15 @@ module ForestAdminAgent
|
|
|
38
38
|
|
|
39
39
|
def handle_api_chart(args = {})
|
|
40
40
|
caller = Utils::QueryStringParser.parse_caller(args)
|
|
41
|
+
parameters = Utils::QueryStringParser.parse_chart_parameters(args)
|
|
41
42
|
datasource = ForestAdminAgent::Facades::Container.datasource
|
|
42
43
|
|
|
43
44
|
{
|
|
44
45
|
content: Serializer::ForestChartSerializer.serialize(
|
|
45
46
|
datasource.render_chart(
|
|
46
47
|
caller,
|
|
47
|
-
@chart_name
|
|
48
|
+
@chart_name,
|
|
49
|
+
parameters
|
|
48
50
|
)
|
|
49
51
|
)
|
|
50
52
|
}
|
|
@@ -52,12 +54,14 @@ module ForestAdminAgent
|
|
|
52
54
|
|
|
53
55
|
def handle_smart_chart(args = {})
|
|
54
56
|
caller = Utils::QueryStringParser.parse_caller(args)
|
|
57
|
+
parameters = Utils::QueryStringParser.parse_chart_parameters(args)
|
|
55
58
|
datasource = ForestAdminAgent::Facades::Container.datasource
|
|
56
59
|
|
|
57
60
|
{
|
|
58
61
|
content: datasource.render_chart(
|
|
59
62
|
caller,
|
|
60
|
-
@chart_name
|
|
63
|
+
@chart_name,
|
|
64
|
+
parameters
|
|
61
65
|
)
|
|
62
66
|
}
|
|
63
67
|
end
|
|
@@ -158,6 +158,17 @@ module ForestAdminAgent
|
|
|
158
158
|
sort
|
|
159
159
|
end
|
|
160
160
|
|
|
161
|
+
def self.parse_chart_parameters(args)
|
|
162
|
+
params = args[:params] || {}
|
|
163
|
+
|
|
164
|
+
params.each_with_object({}) do |(key, value), result|
|
|
165
|
+
key_s = key.to_s
|
|
166
|
+
next if value.nil? || value.is_a?(Hash) || value.is_a?(Array)
|
|
167
|
+
|
|
168
|
+
result[key_s] = value.to_s
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
161
172
|
def self.parse_segment(collection, args)
|
|
162
173
|
segment = args.dig(:params, :data, :attributes, :all_records_subset_query,
|
|
163
174
|
:segment) || args.dig(:params, :segment)
|
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.
|
|
4
|
+
version: 1.26.0
|
|
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: 2026-03-
|
|
12
|
+
date: 2026-03-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|