forest_liana 9.1.9 → 9.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/app/services/forest_liana/ability/permission/smart_action_checker.rb +1 -1
  3. data/app/services/forest_liana/filters_parser.rb +1 -5
  4. data/app/services/forest_liana/leaderboard_stat_getter.rb +1 -1
  5. data/app/services/forest_liana/line_stat_getter.rb +1 -1
  6. data/app/services/forest_liana/pie_stat_getter.rb +1 -1
  7. data/app/services/forest_liana/scope_manager.rb +34 -58
  8. data/app/services/forest_liana/utils/context_variables.rb +41 -0
  9. data/app/services/forest_liana/utils/context_variables_injector.rb +53 -0
  10. data/app/services/forest_liana/value_stat_getter.rb +1 -1
  11. data/lib/forest_liana/version.rb +1 -1
  12. data/spec/requests/actions_controller_spec.rb +32 -4
  13. data/spec/requests/count_spec.rb +1 -1
  14. data/spec/requests/resources_spec.rb +6 -7
  15. data/spec/requests/stats_spec.rb +29 -28
  16. data/spec/services/forest_liana/filters_parser_spec.rb +35 -35
  17. data/spec/services/forest_liana/has_many_getter_spec.rb +13 -11
  18. data/spec/services/forest_liana/line_stat_getter_spec.rb +1 -1
  19. data/spec/services/forest_liana/pie_stat_getter_spec.rb +11 -11
  20. data/spec/services/forest_liana/resource_updater_spec.rb +25 -21
  21. data/spec/services/forest_liana/resources_getter_spec.rb +10 -10
  22. data/spec/services/forest_liana/scope_manager_spec.rb +243 -152
  23. data/spec/services/forest_liana/utils/context_variables_injector_spec.rb +107 -0
  24. data/spec/services/forest_liana/utils/context_variables_spec.rb +43 -0
  25. data/spec/services/forest_liana/value_stat_getter_spec.rb +11 -11
  26. metadata +8 -2
@@ -18,7 +18,7 @@ module ForestLiana
18
18
  describe 'with not allowed aggregator' do
19
19
  let(:model) { User }
20
20
  let(:collection) { 'users' }
21
- let(:scopes) { { } }
21
+ let(:scopes) { {'scopes' => {}, 'team' => {'id' => '1', 'name' => 'Operations'}} }
22
22
  let(:params) {
23
23
  {
24
24
  type: "Value",
@@ -50,7 +50,7 @@ module ForestLiana
50
50
  subject { ValueStatGetter.new(model, params, user) }
51
51
 
52
52
  describe 'with empty scopes' do
53
- let(:scopes) { { } }
53
+ let(:scopes) { {'scopes' => {}, 'team' => {'id' => '1', 'name' => 'Operations'}} }
54
54
 
55
55
  describe 'with a simple filter matching no entries' do
56
56
  let(:model) { User }
@@ -89,16 +89,16 @@ module ForestLiana
89
89
  describe 'with scopes' do
90
90
  let(:scopes) {
91
91
  {
92
- 'User' => {
93
- 'scope'=> {
94
- 'filter'=> {
92
+ 'scopes' =>
93
+ {
94
+ 'User' => {
95
95
  'aggregator' => 'and',
96
- 'conditions' => [
97
- { 'field' => 'title', 'operator' => 'not_equal', 'value' => 'villager' }
98
- ]
99
- },
100
- 'dynamicScopesValues' => { }
101
- }
96
+ 'conditions' => [{'field' => 'title', 'operator' => 'not_equal', 'value' => 'villager'}]
97
+ }
98
+ },
99
+ 'team' => {
100
+ 'id' => 43,
101
+ 'name' => 'Operations'
102
102
  }
103
103
  }
104
104
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.1.9
4
+ version: 9.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-28 00:00:00.000000000 Z
11
+ date: 2024-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -317,6 +317,8 @@ files:
317
317
  - app/services/forest_liana/stripe_subscriptions_getter.rb
318
318
  - app/services/forest_liana/token.rb
319
319
  - app/services/forest_liana/utils/beta_schema_utils.rb
320
+ - app/services/forest_liana/utils/context_variables.rb
321
+ - app/services/forest_liana/utils/context_variables_injector.rb
320
322
  - app/services/forest_liana/value_stat_getter.rb
321
323
  - app/views/layouts/forest_liana/application.html.erb
322
324
  - config/initializers/arel-helpers.rb
@@ -438,6 +440,8 @@ files:
438
440
  - spec/services/forest_liana/schema_adapter_spec.rb
439
441
  - spec/services/forest_liana/scope_manager_spec.rb
440
442
  - spec/services/forest_liana/smart_action_field_validator_spec.rb
443
+ - spec/services/forest_liana/utils/context_variables_injector_spec.rb
444
+ - spec/services/forest_liana/utils/context_variables_spec.rb
441
445
  - spec/services/forest_liana/value_stat_getter_spec.rb
442
446
  - spec/spec_helper.rb
443
447
  - test/dummy/README.rdoc
@@ -736,5 +740,7 @@ test_files:
736
740
  - spec/services/forest_liana/schema_adapter_spec.rb
737
741
  - spec/services/forest_liana/scope_manager_spec.rb
738
742
  - spec/services/forest_liana/smart_action_field_validator_spec.rb
743
+ - spec/services/forest_liana/utils/context_variables_injector_spec.rb
744
+ - spec/services/forest_liana/utils/context_variables_spec.rb
739
745
  - spec/services/forest_liana/value_stat_getter_spec.rb
740
746
  - spec/spec_helper.rb