forest_admin_agent 1.0.0.pre.beta.32 → 1.0.0.pre.beta.33
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/services/permissions.rb +3 -0
- data/lib/forest_admin_agent/utils/context_variables.rb +4 -1
- data/lib/forest_admin_agent/utils/query_string_parser.rb +12 -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: a943d6f4ac59186bf4a2b032ffdd301d41239636408457c0d4f809633cc3ad49
|
|
4
|
+
data.tar.gz: a292ad6d5ffc8d1c65734729f0c31212a7a5157ffd5c93be2552cc19c3fbb092
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 407664d61c301ddaa40c049f52b7e58c5373ad73990f031e64f986349ca32dd45550787a3252d85f881486c61557507bfd09ec861f0f41d51bcb646250f80b56
|
|
7
|
+
data.tar.gz: 4b62bea51c7f25aaf6d2902e686b1280e8dcc019864c8c6848795846b2c9ee9aee92e0b0e53cb897b1485dbda2ed29161ea43ec0eccf4a45ec110e19c8440e38
|
|
@@ -103,6 +103,9 @@ module ForestAdminAgent
|
|
|
103
103
|
|
|
104
104
|
return nil if scope.nil?
|
|
105
105
|
|
|
106
|
+
team = get_team(caller.rendering_id)
|
|
107
|
+
user = get_user_data(caller.id)
|
|
108
|
+
|
|
106
109
|
context_variables = ContextVariables.new(team, user)
|
|
107
110
|
|
|
108
111
|
ContextVariablesInjector.inject_context_in_filter(scope, context_variables)
|
|
@@ -29,7 +29,10 @@ module ForestAdminAgent
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
if context_variable_key.start_with?(USER_VALUE_TAG_PREFIX)
|
|
32
|
-
|
|
32
|
+
user[:tags].each do |tag|
|
|
33
|
+
match_key = context_variable_key[USER_VALUE_TAG_PREFIX.length..]
|
|
34
|
+
return tag[match_key] if tag.key?(match_key)
|
|
35
|
+
end
|
|
33
36
|
end
|
|
34
37
|
|
|
35
38
|
user[context_variable_key[USER_VALUE_PREFIX.length..].to_sym]
|
|
@@ -104,6 +104,18 @@ module ForestAdminAgent
|
|
|
104
104
|
|
|
105
105
|
extended != '0'
|
|
106
106
|
end
|
|
107
|
+
|
|
108
|
+
def self.parse_sort(collection, args)
|
|
109
|
+
sort_string = args.dig(:params, :sort)
|
|
110
|
+
|
|
111
|
+
return SortUtils::SortFactory.by_primary_keys(collection) unless sort_string
|
|
112
|
+
|
|
113
|
+
sort = Sort.new([
|
|
114
|
+
{ field: sort_string.gsub(/^-/, '').tr('.', ':'), ascending: !sort_string.start_with?('-') }
|
|
115
|
+
])
|
|
116
|
+
|
|
117
|
+
ForestAdminDatasourceToolkit::Validations::SortValidator.validate(collection, sort)
|
|
118
|
+
end
|
|
107
119
|
end
|
|
108
120
|
end
|
|
109
121
|
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.33
|
|
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-03-
|
|
12
|
+
date: 2024-03-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|