marty 5.1.1 → 5.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/components/marty/data_grid_user_view.rb +16 -2
- data/app/components/marty/import_view.rb +1 -1
- data/db/sql/lookup_grid_distinct_v1.sql +11 -8
- data/db/sql/query_grid_dir_v1.sql +7 -3
- data/lib/marty/rpc_call.rb +5 -1
- data/lib/marty/version.rb +1 -1
- data/other/marty/diagnostic/version.rb +1 -1
- data/spec/controllers/diagnostic/controller_spec.rb +1 -1
- data/spec/other/diagnostic/reporter_spec.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 10af0b3690a8b11f6aee67bad8c10178d4e6b73c
|
4
|
+
data.tar.gz: 3714e7d0a7d3d9130ee82c61dc27f533835627ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bd3c6021736228693d13b86f308fd7effc429ea9ea10a98c25bf79c8ecb5893972ee8728ab2505553d822a830cd9ccd7762eb57ceb3180fcc23a7a941f9376c
|
7
|
+
data.tar.gz: 425d1ee9841e00d0708151f04560e892a0752def916abe4f765b696b24cb90217d69fd075dcfd61a826fd36222667d5bfd5fa54145ecf0adc2ca244cd3d3eb3d
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Marty
|
2
2
|
class DataGridUserView < DataGridView
|
3
|
-
|
3
|
+
# permissions are handled by #get_records and #get_edit_permissions
|
4
|
+
has_marty_permissions read: :any,
|
5
|
+
update: :any
|
4
6
|
|
5
7
|
def configure(c)
|
6
8
|
super
|
@@ -10,7 +12,19 @@ module Marty
|
|
10
12
|
:name,
|
11
13
|
:created_dt,
|
12
14
|
]
|
13
|
-
c.
|
15
|
+
c.title = I18n.t('data_grid_user_view')
|
16
|
+
c.editing = :in_form
|
17
|
+
end
|
18
|
+
|
19
|
+
client_class do |c|
|
20
|
+
c.do_edit_in_form = l(<<~JS)
|
21
|
+
function(record) {
|
22
|
+
var sel = this.getSelectionModel().getSelection()[0];
|
23
|
+
var record_id = sel && sel.getId();
|
24
|
+
if (!record_id) return;
|
25
|
+
this.server.editGrid({record_id: record_id});
|
26
|
+
}
|
27
|
+
JS
|
14
28
|
end
|
15
29
|
|
16
30
|
def default_bbar
|
@@ -25,6 +25,9 @@ DECLARE
|
|
25
25
|
vertical_indexes JSONB = '[]'::JSONB;
|
26
26
|
vertical_index INTEGER;
|
27
27
|
|
28
|
+
default_index_array JSONB = '[0]'::JSONB;
|
29
|
+
empty_jsonb_array JSONB = '[]'::JSONB;
|
30
|
+
|
28
31
|
query_dir_result JSONB;
|
29
32
|
query_index_result JSONB = '[]'::JSONB;
|
30
33
|
metadata_record JSONB;
|
@@ -44,7 +47,7 @@ BEGIN
|
|
44
47
|
USING row_info ->> 'id';
|
45
48
|
|
46
49
|
|
47
|
-
data_grid_metadata := COALESCE(data_grid_metadata,
|
50
|
+
data_grid_metadata := COALESCE(data_grid_metadata, empty_jsonb_array);
|
48
51
|
|
49
52
|
FOR i IN 0 .. (jsonb_array_length(data_grid_metadata) - 1) LOOP
|
50
53
|
metadata_record := data_grid_metadata -> i;
|
@@ -66,9 +69,9 @@ BEGIN
|
|
66
69
|
|
67
70
|
IF COALESCE(array_length(data_grid_metadata_current, 1), 0) = 0 THEN
|
68
71
|
IF direction = 'h' THEN
|
69
|
-
horizontal_indexes :=
|
72
|
+
horizontal_indexes := default_index_array;
|
70
73
|
ELSE
|
71
|
-
vertical_indexes :=
|
74
|
+
vertical_indexes := default_index_array;
|
72
75
|
END IF;
|
73
76
|
CONTINUE;
|
74
77
|
END IF;
|
@@ -84,16 +87,16 @@ BEGIN
|
|
84
87
|
|
85
88
|
sql_scripts_arr := sql_scripts_arr || (query_dir_result ->> 0);
|
86
89
|
|
87
|
-
query_index_result :=
|
90
|
+
query_index_result := empty_jsonb_array;
|
88
91
|
|
89
92
|
-- execute the SQL query that has been received before and
|
90
|
-
-- add it's (possibly
|
93
|
+
-- add it's (possibly multiplt) results to query_index_result variable
|
91
94
|
FOR target IN EXECUTE query_dir_result ->> 0 USING query_dir_result -> 1 LOOP
|
92
95
|
query_index_result := query_index_result || to_jsonb(target.index);
|
93
96
|
END LOOP;
|
94
97
|
|
95
98
|
all_results := all_results || query_index_result;
|
96
|
-
query_index_result :=
|
99
|
+
query_index_result := empty_jsonb_array || query_index_result; -- Use empty JSONB array in case of NULL results
|
97
100
|
|
98
101
|
IF direction = 'h' THEN
|
99
102
|
horizontal_indexes := query_index_result;
|
@@ -108,8 +111,8 @@ BEGIN
|
|
108
111
|
|
109
112
|
END LOOP;
|
110
113
|
|
111
|
-
vertical_indexes := COALESCE(vertical_indexes,
|
112
|
-
horizontal_indexes := COALESCE(horizontal_indexes,
|
114
|
+
vertical_indexes := COALESCE(vertical_indexes, empty_jsonb_array);
|
115
|
+
horizontal_indexes := COALESCE(horizontal_indexes, empty_jsonb_array);
|
113
116
|
|
114
117
|
IF ((jsonb_array_length(vertical_indexes)) = 0
|
115
118
|
OR (jsonb_array_length(horizontal_indexes)) = 0)
|
@@ -25,15 +25,19 @@ DECLARE
|
|
25
25
|
sql_filter text;
|
26
26
|
|
27
27
|
includes_nots boolean;
|
28
|
+
default_nots_array JSONB = '[]'::JSONB;
|
29
|
+
current_info jsonb;
|
28
30
|
|
29
31
|
BEGIN
|
30
32
|
FOR i IN 1 .. COALESCE(array_upper(infos, 1), 0)
|
31
33
|
LOOP
|
32
|
-
|
33
|
-
|
34
|
+
current_info := infos[i];
|
35
|
+
|
36
|
+
attr_type := current_info ->> 'type';
|
37
|
+
attr_name := current_info ->> 'attr';
|
34
38
|
|
35
39
|
-- Use not condition only if given type indexes has rows with 'not' = true
|
36
|
-
includes_nots = COALESCE(
|
40
|
+
includes_nots = COALESCE(current_info -> 'nots', default_nots_array) @> 'true';
|
37
41
|
|
38
42
|
attr_value := h ->> attr_name;
|
39
43
|
h_key_exists := h ? attr_name;
|
data/lib/marty/rpc_call.rb
CHANGED
@@ -24,12 +24,16 @@ class Marty::RpcCall
|
|
24
24
|
res
|
25
25
|
end
|
26
26
|
|
27
|
-
def self.marty_download(
|
27
|
+
def self.marty_download(
|
28
|
+
host, port, path, job_id, ssl = false, read_timeout = 60)
|
29
|
+
|
28
30
|
params = { job_id: job_id }
|
29
31
|
url = path + '?' + URI.encode(URI.encode_www_form(params))
|
30
32
|
|
31
33
|
http = Net::HTTP.new(host, port)
|
32
34
|
http.use_ssl = ssl
|
35
|
+
http.read_timeout = read_timeout
|
36
|
+
|
33
37
|
request = Net::HTTP::Get.new(url)
|
34
38
|
|
35
39
|
begin
|
data/lib/marty/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Marty::Diagnostic; class Version < Base
|
2
2
|
diagnostic_fn do
|
3
3
|
begin
|
4
|
-
message = `cd #{Rails.root
|
4
|
+
message = `cd #{Rails.root}; git describe --tags --always;`.strip
|
5
5
|
rescue StandardError
|
6
6
|
message = error('Failed accessing git')
|
7
7
|
end
|
@@ -12,7 +12,7 @@ describe Marty::Diagnostic::Reporter do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def git
|
15
|
-
message = `cd #{Rails.root
|
15
|
+
message = `cd #{Rails.root}; git describe --tags --always;`.strip
|
16
16
|
rescue StandardError
|
17
17
|
message = error('Failed accessing git')
|
18
18
|
end
|
@@ -213,9 +213,9 @@ describe Marty::Diagnostic::Reporter do
|
|
213
213
|
|
214
214
|
it 'can detect errors in diagnostic for display and api' do
|
215
215
|
described_class.request.params = params
|
216
|
-
n
|
217
|
-
e
|
218
|
-
c
|
216
|
+
n = aggregate_data
|
217
|
+
e = aggregate_data(status: false)
|
218
|
+
c = aggregate_data(consistent: false)
|
219
219
|
ce = aggregate_data(status: false, consistent: false)
|
220
220
|
|
221
221
|
aggregate_failures do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arman Bostani
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2019-08-
|
17
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: aws-sigv4
|
@@ -1694,7 +1694,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1694
1694
|
version: '0'
|
1695
1695
|
requirements: []
|
1696
1696
|
rubyforge_project:
|
1697
|
-
rubygems_version: 2.
|
1697
|
+
rubygems_version: 2.6.14
|
1698
1698
|
signing_key:
|
1699
1699
|
specification_version: 4
|
1700
1700
|
summary: A framework for working with versioned data
|