forest_liana 9.3.0 → 9.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/forest_liana/ability/permission.rb +1 -1
- data/lib/forest_liana/version.rb +1 -1
- data/spec/requests/stats_spec.rb +28 -3
- 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: 4b511be2ddb8f191c6c0330ba1efbe5df8412f2fb55b73bc7b3467592d45a756
|
4
|
+
data.tar.gz: fdd3364f153150c06afb8020bb53020208e3664c9c4522937e2b423aee6c67b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79d756612c12fdf595204d2fc1fb15386e7c4050126b20be4f1e633f83387f8c5efc48e45870f42b762268d3a8df83a8c68116da33b239b7b8b2818f4eda352e
|
7
|
+
data.tar.gz: 8143c1f375b5563be084b69cd341c8506ffb3ba5efcaf245ee23fe40f81232a2923a509aa19a8ead1eb7580c34c030f7f481d0f1d643903dda83a3b1ff0bb3a6
|
@@ -97,7 +97,7 @@ module ForestLiana
|
|
97
97
|
Rails.cache.fetch('forest.stats', expires_in: TTL) do
|
98
98
|
stat_hash = []
|
99
99
|
get_permissions('/liana/v4/permissions/renderings/' + rendering_id)['stats'].each do |stat|
|
100
|
-
stat_hash << "#{stat['type']}:#{Digest::SHA1.hexdigest(stat.
|
100
|
+
stat_hash << "#{stat['type']}:#{Digest::SHA1.hexdigest(stat.deep_sort.to_s)}"
|
101
101
|
end
|
102
102
|
|
103
103
|
stat_hash
|
data/lib/forest_liana/version.rb
CHANGED
data/spec/requests/stats_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'rails_helper'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
describe "Stats", type: :request do
|
5
|
-
let(:rendering_id) { 13 }
|
5
|
+
let(:rendering_id) { '13' }
|
6
6
|
let(:scopes) { {'scopes' => {}, 'team' => {'id' => '1', 'name' => 'Operations'}} }
|
7
7
|
let(:schema) {
|
8
8
|
[
|
@@ -23,7 +23,7 @@ describe "Stats", type: :request do
|
|
23
23
|
team: 'Operations',
|
24
24
|
rendering_id: rendering_id,
|
25
25
|
exp: Time.now.to_i + 2.weeks.to_i,
|
26
|
-
permission_level: '
|
26
|
+
permission_level: 'user'
|
27
27
|
}, ForestLiana.auth_secret, 'HS256')
|
28
28
|
}
|
29
29
|
|
@@ -38,7 +38,7 @@ describe "Stats", type: :request do
|
|
38
38
|
before do
|
39
39
|
Rails.cache.write('forest.users', {'1' => { 'id' => 1, 'roleId' => 1, 'rendering_id' => '1' }})
|
40
40
|
Rails.cache.write('forest.has_permission', true)
|
41
|
-
allow_any_instance_of(ForestLiana::Ability::
|
41
|
+
allow_any_instance_of(ForestLiana::Ability::Permission)
|
42
42
|
.to receive(:get_permissions)
|
43
43
|
.and_return(
|
44
44
|
{
|
@@ -50,6 +50,31 @@ describe "Stats", type: :request do
|
|
50
50
|
"aggregateFieldName" => nil,
|
51
51
|
"sourceCollectionName" => "Owner"
|
52
52
|
},
|
53
|
+
{
|
54
|
+
"type" => "Objective",
|
55
|
+
"sourceCollectionName" => "Owner",
|
56
|
+
"aggregateFieldName" => nil,
|
57
|
+
"aggregator" => "Count",
|
58
|
+
"objective" => 200,
|
59
|
+
"filter" => nil,
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"type" => "Pie",
|
63
|
+
"sourceCollectionName" => "Owner",
|
64
|
+
"aggregateFieldName" => nil,
|
65
|
+
"groupByFieldName" => "id",
|
66
|
+
"aggregator" => "Count",
|
67
|
+
"filter" => nil,
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"type" => "Line",
|
71
|
+
"sourceCollectionName" => "Owner",
|
72
|
+
"aggregateFieldName" => nil,
|
73
|
+
"groupByFieldName" => "hired_at",
|
74
|
+
"aggregator" => "Count",
|
75
|
+
"timeRange" => "Week",
|
76
|
+
"filter" => nil,
|
77
|
+
},
|
53
78
|
{
|
54
79
|
"type" => "Value",
|
55
80
|
"query" => "SELECT COUNT(*) AS value FROM products;"
|
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.3.
|
4
|
+
version: 9.3.2
|
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-
|
11
|
+
date: 2024-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|