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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 4c6789a008b449b0a585b9c6f334c11f8638a6718cd01092fd85e311498a6fa1
4
- data.tar.gz: 5652a3674034c14a53356426522854ccd5d458475757ccd53b5f62a6d43e006e
2
+ SHA1:
3
+ metadata.gz: 10af0b3690a8b11f6aee67bad8c10178d4e6b73c
4
+ data.tar.gz: 3714e7d0a7d3d9130ee82c61dc27f533835627ab
5
5
  SHA512:
6
- metadata.gz: 5172bf0b5cc30b6954498b2af539314794316c0cd75cb00c232bc7f6288de91c9dbaffe048de3cef3c438fff93af45b7b1f5e7b12293d71d965d62dff4880cdd
7
- data.tar.gz: 5b5015dd73fe163c2ad24b8855ec9e0e122417a81b458950e94214a57d2cf31e85d8d3dce1b3d907077a6e4241c4a42c203d68a5003787a387d851019ad594dc
6
+ metadata.gz: 8bd3c6021736228693d13b86f308fd7effc429ea9ea10a98c25bf79c8ecb5893972ee8728ab2505553d822a830cd9ccd7762eb57ceb3180fcc23a7a941f9376c
7
+ data.tar.gz: 425d1ee9841e00d0708151f04560e892a0752def916abe4f765b696b24cb90217d69fd075dcfd61a826fd36222667d5bfd5fa54145ecf0adc2ca244cd3d3eb3d
@@ -1,6 +1,8 @@
1
1
  module Marty
2
2
  class DataGridUserView < DataGridView
3
- has_marty_permissions read: [:data_grid_editor, :admin, :dev]
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.editing = :inline
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
@@ -80,7 +80,7 @@ class Marty::ImportView < Marty::Form
80
80
  res = import(processed)
81
81
  result = res.map { |k, v| format_message(k, v) }
82
82
 
83
- messages = post_import
83
+ messages = post_import
84
84
  result << messages if messages
85
85
 
86
86
  client.set_result result.join('<br/>')
@@ -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, '[]'::JSONB);
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 := '[0]'::JSONB;
72
+ horizontal_indexes := default_index_array;
70
73
  ELSE
71
- vertical_indexes := '[0]'::JSONB;
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 := '[]'::JSONB;
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 multiple) results to query_index_result variable
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 := '[]'::JSONB || query_index_result; -- Use empty JSONB array in case of NULL results
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, '[]'::JSONB);
112
- horizontal_indexes := COALESCE(horizontal_indexes, '[]'::JSONB);
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
- attr_type := infos[i] ->> 'type';
33
- attr_name := infos[i] ->> 'attr';
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(infos[i] -> 'nots', '[]'::JSONB) @> 'true';
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;
@@ -24,12 +24,16 @@ class Marty::RpcCall
24
24
  res
25
25
  end
26
26
 
27
- def self.marty_download(host, port, path, job_id, ssl = false)
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
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = '5.1.1'
2
+ VERSION = '5.1.2'
3
3
  end
@@ -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.to_s}; git describe --tags --always;`.strip
4
+ message = `cd #{Rails.root}; git describe --tags --always;`.strip
5
5
  rescue StandardError
6
6
  message = error('Failed accessing git')
7
7
  end
@@ -15,7 +15,7 @@ module Marty::Diagnostic
15
15
  end
16
16
 
17
17
  def git
18
- `cd #{Rails.root.to_s}; git describe --tags --always;`.
18
+ `cd #{Rails.root}; git describe --tags --always;`.
19
19
  strip rescue 'Failed accessing git'
20
20
  end
21
21
 
@@ -12,7 +12,7 @@ describe Marty::Diagnostic::Reporter do
12
12
  end
13
13
 
14
14
  def git
15
- message = `cd #{Rails.root.to_s}; git describe --tags --always;`.strip
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 = aggregate_data
217
- e = aggregate_data(status: false)
218
- c = aggregate_data(consistent: false)
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.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-07 00:00:00.000000000 Z
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.7.8
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