forest_admin_agent 1.0.0.pre.beta.32 → 1.0.0.pre.beta.33

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: a943d6f4ac59186bf4a2b032ffdd301d41239636408457c0d4f809633cc3ad49
4
+ data.tar.gz: a292ad6d5ffc8d1c65734729f0c31212a7a5157ffd5c93be2552cc19c3fbb092
5
5
  SHA512:
6
- metadata.gz: 2208d4c530f1bcca9a2e36bb0ce90f88ee1224ecaf795cfc9862449397d58ed5b131577d7f836498652d61080935db8744584198fcc2e961ed4e1d54c39cb94a
7
- data.tar.gz: dda9a150ce25a95f4b1f4e88601003af2ca2b090e195bdefdd33803caf0a877f2d308431abc00f590929bc2af53962881ea66e42eed2b4ab5ed21c31e4827773
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
- 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.33"
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.33"
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.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-01 00:00:00.000000000 Z
12
+ date: 2024-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport