marty 2.3.5 → 2.3.7

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
2
  SHA1:
3
- metadata.gz: 1d649917183fda05f2022f0d9ed399acdf58d50f
4
- data.tar.gz: 4a3276efd02fd70f6a4d5f940936c396ac24b74c
3
+ metadata.gz: 56b3f0f54fc31cab7647f2955183a57624d2e250
4
+ data.tar.gz: fe7e62a123c5a0e8189076e9f5d20dd290705a26
5
5
  SHA512:
6
- metadata.gz: 47959742294ec7c13d84abcd73f830975bb472986ee87eda06f0cd4a1bf4c441008b9e42154ffd4b12a83a4c3c5c8bf9cbe5c860f3acaaf8008236aad0ef9782
7
- data.tar.gz: 7af35a03b0480c2cfce4f917586e5058395cc5a6aa20324111ee665918d6fc424dca8c2fb2772a43c3d914a5b4d5671cb840272a409cdce2ccd0c34f02377383
6
+ metadata.gz: 479aa0ed5a85663ae336e151c4c512fe92dc3da39c8fc5fa661f5307454cf6ed2b7bc0a4ad8e46698e80c32a637edb848ec245d826add0e95fbc7bc9a3e53cc0
7
+ data.tar.gz: c225c6156c6ca637c51a4fbd69af307d50304e0d83e43da28aca9fa4c56ecf5255318b01d4124ed165a261fb920421d53770d01f1aa69a094f9b39452c674f83
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- marty (2.3.5)
4
+ marty (2.3.7)
5
5
  aws-sigv4 (~> 1.0, >= 1.0.2)
6
6
  axlsx (= 3.0.0pre)
7
7
  coderay
@@ -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
- rid = m.getSelected().startCell.record.getId()
60
- } else {
61
- rid = m.getSelection()[0].getId()
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
 
@@ -75,6 +75,8 @@ class Marty::LogView < Marty::Grid
75
75
 
76
76
  column :details do |c|
77
77
  c.getter = lambda { |r| CGI.escapeHTML(r.details.pretty_inspect) }
78
+ c.filter_with = lambda {|r, v, op|
79
+ r.where("details::text #{op} '%#{v}%'")}
78
80
  end
79
81
 
80
82
  attribute :details do |c|
@@ -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
- {"properties"=> {var => { "type"=> "boolean", "enum"=> [value]}}}
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
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "2.3.5"
2
+ VERSION = "2.3.7"
3
3
  end
@@ -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.5
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-04 00:00:00.000000000 Z
17
+ date: 2018-09-14 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg