forest_admin_agent 1.0.0.pre.beta.32 → 1.0.0.pre.beta.34

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: ba99d79966187d18f81f0e7672836a689bcbe38c5503587fe3ea720830671bb5
4
- data.tar.gz: 03ff5cd137f8a4fcfb852ae791c0291cadd5765280f4a4d3c876970da55a9888
3
+ metadata.gz: cc3820f26d233b55d406805cc98dd924e0c61b23dd49ed6af1ef36b26484a93f
4
+ data.tar.gz: 607bb5a177e34eaf1e5592a927a07e5960c2fca1fb6375d673d017d3e5516020
5
5
  SHA512:
6
- metadata.gz: 2208d4c530f1bcca9a2e36bb0ce90f88ee1224ecaf795cfc9862449397d58ed5b131577d7f836498652d61080935db8744584198fcc2e961ed4e1d54c39cb94a
7
- data.tar.gz: dda9a150ce25a95f4b1f4e88601003af2ca2b090e195bdefdd33803caf0a877f2d308431abc00f590929bc2af53962881ea66e42eed2b4ab5ed21c31e4827773
6
+ metadata.gz: e5b222f9d671239a3fccbe9c1d2023580f5645988e068e70806b35f2530313f1060c35a8d41b0e722a79623ddeb208e12dd803332708fc5df02825f87a700747
7
+ data.tar.gz: c3965962907e430214f4cafae295699de17c6dfe74647634d9811ff20839a9caf50a435e8918404575daff11821bc14fbeaa235f13450ac3ef5d4aa81f8e5787
@@ -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
- return user[:tags][context_variable_key[USER_VALUE_TAG_PREFIX.length..]]
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
@@ -7,7 +7,7 @@ module ForestAdminAgent
7
7
  class SchemaEmitter
8
8
  LIANA_NAME = "forest-rails"
9
9
 
10
- LIANA_VERSION = "1.0.0-beta.32"
10
+ LIANA_VERSION = "1.0.0-beta.34"
11
11
 
12
12
  def self.get_serialized_schema(datasource)
13
13
  schema_path = Facades::Container.cache(:schema_path)
@@ -1,3 +1,3 @@
1
1
  module ForestAdminAgent
2
- VERSION = "1.0.0-beta.32"
2
+ VERSION = "1.0.0-beta.34"
3
3
  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.32
4
+ version: 1.0.0.pre.beta.34
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-01 00:00:00.000000000 Z
12
+ date: 2024-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport