marty 2.3.5 → 2.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/components/marty/api_log_view.rb +27 -0
- data/app/components/marty/grid.rb +5 -3
- data/app/components/marty/log_view.rb +2 -0
- data/lib/marty/schema_helper.rb +4 -1
- data/lib/marty/version.rb +1 -1
- data/spec/controllers/rpc_controller_spec.rb +10 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56b3f0f54fc31cab7647f2955183a57624d2e250
|
4
|
+
data.tar.gz: fe7e62a123c5a0e8189076e9f5d20dd290705a26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 479aa0ed5a85663ae336e151c4c512fe92dc3da39c8fc5fa661f5307454cf6ed2b7bc0a4ad8e46698e80c32a637edb848ec245d826add0e95fbc7bc9a3e53cc0
|
7
|
+
data.tar.gz: c225c6156c6ca637c51a4fbd69af307d50304e0d83e43da28aca9fa4c56ecf5255318b01d4124ed165a261fb920421d53770d01f1aa69a094f9b39452c674f83
|
data/Gemfile.lock
CHANGED
@@ -10,6 +10,7 @@ class Marty::ApiLogView < Marty::Grid
|
|
10
10
|
}
|
11
11
|
|
12
12
|
@@attrs = [
|
13
|
+
:timestamp_custom,
|
13
14
|
:script,
|
14
15
|
:node,
|
15
16
|
:attrs,
|
@@ -80,6 +81,10 @@ class Marty::ApiLogView < Marty::Grid
|
|
80
81
|
c.getter = lambda { |r| r.details[a.to_s].pretty_inspect }
|
81
82
|
c.width = 900
|
82
83
|
c.read_only = true
|
84
|
+
c.filter_with = lambda {
|
85
|
+
|r, v, op|
|
86
|
+
r.where("(details->>'#{a.to_s}')::text #{op} '%#{v}%'")
|
87
|
+
}
|
83
88
|
end
|
84
89
|
end
|
85
90
|
end
|
@@ -90,5 +95,27 @@ class Marty::ApiLogView < Marty::Grid
|
|
90
95
|
c.getter = lambda { |r| r.details[a.to_s].to_json }
|
91
96
|
end
|
92
97
|
end
|
98
|
+
|
99
|
+
#copied from log_view.rb
|
100
|
+
attribute :timestamp_custom do |c|
|
101
|
+
c.text = I18n.t("log_grid.timestamp")
|
102
|
+
c.width = 200
|
103
|
+
c.read_only = true
|
104
|
+
c.filterable = true
|
105
|
+
c.xtype = :datecolumn
|
106
|
+
c.format = 'Y-m-d h:i:s.u'
|
107
|
+
c.field_config = {
|
108
|
+
xtype: :displayfield,
|
109
|
+
}
|
110
|
+
c.getter = lambda { |r| Time.at(r.timestamp) }
|
111
|
+
c.sorting_scope = lambda {|r, dir| r.order("timestamp " + dir.to_s)}
|
112
|
+
|
113
|
+
# FIXME?: The UI AR/PG DateTime workaround requires the timestamp to be cast
|
114
|
+
# to text in order to compare filter input using the LIKE operator.
|
115
|
+
# Otherwise it will fail. '<' and '>' functionality is missing.
|
116
|
+
c.filter_with = lambda {|r, v, op|
|
117
|
+
r.where("timestamp::text #{op} '#{v}%'")}
|
118
|
+
end
|
119
|
+
|
93
120
|
end
|
94
121
|
ApiLogView = Marty::ApiLogView
|
@@ -56,9 +56,11 @@ class Marty::Grid < ::Netzke::Grid::Base
|
|
56
56
|
var rid = null;
|
57
57
|
if (has_sel) {
|
58
58
|
if (m.type == 'spreadsheet') {
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
var cell = m.getSelected().startCell;
|
60
|
+
rid = cell && cell.record.getId();
|
61
|
+
}
|
62
|
+
if (!rid) {
|
63
|
+
rid = m.getSelection()[0].getId();
|
62
64
|
}
|
63
65
|
}
|
64
66
|
|
data/lib/marty/schema_helper.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
class Marty::SchemaHelper
|
2
2
|
include Delorean::Model
|
3
|
+
|
3
4
|
delorean_fn :enum_is, sig: 2 do
|
4
5
|
|var, value|
|
5
6
|
{"properties"=> {var => { "enum"=> value}}}
|
6
7
|
end
|
8
|
+
|
7
9
|
delorean_fn :bool_is, sig: 2 do
|
8
10
|
|var, value|
|
9
|
-
{"
|
11
|
+
{"allOf"=>[{"required"=>[var]},
|
12
|
+
{"properties"=> {var => { "type"=> "boolean", "enum"=> [value]}}}]}
|
10
13
|
end
|
11
14
|
|
12
15
|
delorean_fn :or, sig: [1, 20] do
|
data/lib/marty/version.rb
CHANGED
@@ -101,6 +101,8 @@ A:
|
|
101
101
|
req1 =?
|
102
102
|
req2 =?
|
103
103
|
req3 =?
|
104
|
+
newtf =?
|
105
|
+
newfield =?
|
104
106
|
|
105
107
|
optif = if opttf == true
|
106
108
|
then opttrue
|
@@ -271,7 +273,9 @@ A:
|
|
271
273
|
"optfalse" : { "type" : "string" },
|
272
274
|
"optdisallow" : { "type" : "string" },
|
273
275
|
"req1" : { "pg_enum" : "CondEnum" },
|
274
|
-
"req2" : { "pg_enum" : "CondEnum" }
|
276
|
+
"req2" : { "pg_enum" : "CondEnum" },
|
277
|
+
"newtf" : { "type" : "boolean" },
|
278
|
+
"newfield": { "type" : "string" }
|
275
279
|
}
|
276
280
|
|
277
281
|
req1_is_opt1 = Marty::SchemaHelper.enum_is('req1', ['opt1'])
|
@@ -280,6 +284,9 @@ A:
|
|
280
284
|
req3_is_opttf = Marty::SchemaHelper.enum_is('req3', ['opttf'])
|
281
285
|
opttf_is_true = Marty::SchemaHelper.bool_is('opttf', true)
|
282
286
|
opttf_is_false = Marty::SchemaHelper.bool_is('opttf', false)
|
287
|
+
newtf_is_true = Marty::SchemaHelper.bool_is('newtf', true)
|
288
|
+
new_check = Marty::SchemaHelper.required_if(['newfield'],
|
289
|
+
Marty::SchemaHelper.and(req3_is_opttf, newtf_is_true))
|
283
290
|
|
284
291
|
# opt1 is required if req1 == 'opt1'
|
285
292
|
opt1_check = Marty::SchemaHelper.required_if(['opt1'], req1_is_opt1)
|
@@ -322,7 +329,8 @@ A:
|
|
322
329
|
opttf_check,
|
323
330
|
opttruefalse_check,
|
324
331
|
dip_check,
|
325
|
-
dinp_check
|
332
|
+
dinp_check,
|
333
|
+
new_check
|
326
334
|
] }
|
327
335
|
eof
|
328
336
|
|
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: 2.3.
|
4
|
+
version: 2.3.7
|
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: 2018-09-
|
17
|
+
date: 2018-09-14 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: pg
|