marty 9.3.3 → 9.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/marty/main_auth_app.rb +3 -1
- data/app/components/marty/promise_view.rb +12 -15
- data/app/components/marty/tree.rb +63 -0
- data/app/components/marty/tree/client/tree.js +21 -0
- data/app/models/marty/posting.rb +1 -1
- data/lib/marty/monkey.rb +5 -5
- data/lib/marty/version.rb +1 -1
- data/spec/dummy/config/application.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d074baec508433805a51aea60daa67bae8d2a7153d89e36911a847175db5f92
|
4
|
+
data.tar.gz: '09391b3a8a0b33cc3bdf6d6813d0c9ae1852acdff55cf137cba9c935a9bf1844'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d1d1121878470f9d5e39df28294e653341ca1c8d6d5fb581b2401f040a73b5cb889c2392f2733cee0c4286457960f328b041fad9169f6a1513466235bf9693f
|
7
|
+
data.tar.gz: d25f58da6dba36b7386b4cfdbfdbf78c9e8623be71d92c07f66a567ba80f624f08a528ba91887ead5f86b6f738e33776b350300027ced7ce5c427d6107f4f004
|
@@ -1,5 +1,4 @@
|
|
1
|
-
class Marty::PromiseView <
|
2
|
-
extend ::Marty::Permissions
|
1
|
+
class Marty::PromiseView < Marty::Tree
|
3
2
|
has_marty_permissions read: :any
|
4
3
|
|
5
4
|
client_styles do |config|
|
@@ -18,12 +17,9 @@ class Marty::PromiseView < Netzke::Tree::Base
|
|
18
17
|
|
19
18
|
######################################################################
|
20
19
|
|
21
|
-
def class_can?(op)
|
22
|
-
self.class.can_perform_action?(op)
|
23
|
-
end
|
24
|
-
|
25
20
|
def configure(c)
|
26
21
|
super
|
22
|
+
|
27
23
|
c.title = I18n.t('jobs.promise_view')
|
28
24
|
c.model = 'Marty::VwPromise'
|
29
25
|
c.attributes = [
|
@@ -41,12 +37,6 @@ class Marty::PromiseView < Netzke::Tree::Base
|
|
41
37
|
c.paging = :none
|
42
38
|
c.bbar = bbar
|
43
39
|
c.read_only = true
|
44
|
-
c.permissions = {
|
45
|
-
create: class_can?(:create),
|
46
|
-
read: class_can?(:read),
|
47
|
-
update: class_can?(:update),
|
48
|
-
delete: class_can?(:delete)
|
49
|
-
}
|
50
40
|
end
|
51
41
|
|
52
42
|
def bbar
|
@@ -143,11 +133,18 @@ class Marty::PromiseView < Netzke::Tree::Base
|
|
143
133
|
|
144
134
|
attribute :error do |config|
|
145
135
|
config.getter = ->(record) do
|
146
|
-
|
136
|
+
next if record.status
|
137
|
+
next @results[record.id] if @records
|
138
|
+
|
139
|
+
Marty::Promise.find(record.id).result.to_s
|
147
140
|
end
|
148
141
|
|
149
|
-
|
142
|
+
editor_config = {
|
143
|
+
xtype: :textarea,
|
144
|
+
}
|
145
|
+
|
146
|
+
config.field_config = editor_config
|
150
147
|
end
|
151
148
|
end
|
152
149
|
|
153
|
-
|
150
|
+
Marty::PromiseView
|
@@ -0,0 +1,63 @@
|
|
1
|
+
class Marty::Tree < ::Netzke::Tree::Base
|
2
|
+
extend ::Marty::Permissions
|
3
|
+
|
4
|
+
has_marty_permissions read: :any
|
5
|
+
|
6
|
+
# parent tree is the tree in which child/linked_components is defined
|
7
|
+
# child components are components dependent on the selected parent row
|
8
|
+
# linked components will update whenever the parent is updated
|
9
|
+
def initialize args, kwargs = nil
|
10
|
+
super(args, kwargs)
|
11
|
+
client_config[:child_components] = child_components || []
|
12
|
+
client_config[:linked_components] = linked_components || []
|
13
|
+
end
|
14
|
+
|
15
|
+
client_class do |c|
|
16
|
+
c.include :tree
|
17
|
+
end
|
18
|
+
|
19
|
+
######################################################################
|
20
|
+
|
21
|
+
def class_can?(op)
|
22
|
+
self.class.can_perform_action?(op)
|
23
|
+
end
|
24
|
+
|
25
|
+
def configure(c)
|
26
|
+
super
|
27
|
+
|
28
|
+
c.permissions = {
|
29
|
+
create: class_can?(:create),
|
30
|
+
read: class_can?(:read),
|
31
|
+
update: class_can?(:update),
|
32
|
+
delete: class_can?(:delete)
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def child_components
|
37
|
+
[]
|
38
|
+
end
|
39
|
+
|
40
|
+
def linked_components
|
41
|
+
[]
|
42
|
+
end
|
43
|
+
|
44
|
+
def configure_form_window(c)
|
45
|
+
super
|
46
|
+
|
47
|
+
c.klass = Marty::RecordFormWindow
|
48
|
+
|
49
|
+
# Fix Add in form/Edit in form modal popup width
|
50
|
+
# Netzke 0.10.1 defaults width to 80% of screen which is too wide
|
51
|
+
# for a form where the fields are stacked top to bottom
|
52
|
+
# Netzke 0.8.4 defaulted width to 400px - let's make it a bit wider
|
53
|
+
c.width = 475
|
54
|
+
end
|
55
|
+
|
56
|
+
component :view_window do |c|
|
57
|
+
configure_form_window(c)
|
58
|
+
c.excluded = !allowed_to?(:read)
|
59
|
+
c.items = [:view_form]
|
60
|
+
c.title = I18n.t('netzke.grid.base.view_record',
|
61
|
+
model: model.model_name.human)
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
({
|
2
|
+
doViewInForm(record) {
|
3
|
+
this.netzkeLoadComponent("view_window", {
|
4
|
+
serverConfig: {
|
5
|
+
record_id: record.id
|
6
|
+
},
|
7
|
+
callback(w) {
|
8
|
+
w.show();
|
9
|
+
w.on(
|
10
|
+
"close",
|
11
|
+
function() {
|
12
|
+
if (w.closeRes === "ok") {
|
13
|
+
this.netzkeReloadStore();
|
14
|
+
}
|
15
|
+
},
|
16
|
+
this
|
17
|
+
);
|
18
|
+
}
|
19
|
+
});
|
20
|
+
}
|
21
|
+
});
|
data/app/models/marty/posting.rb
CHANGED
@@ -64,7 +64,7 @@ class Marty::Posting < Marty::Base
|
|
64
64
|
|
65
65
|
q = where('created_dt <= ?', dt)
|
66
66
|
q = q.where(posting_type_id: posting_type.id) if posting_type
|
67
|
-
q.order('created_dt DESC').first
|
67
|
+
q.order('created_dt DESC').first&.attributes
|
68
68
|
end
|
69
69
|
|
70
70
|
delorean_fn :get_latest_by_type, sig: [1, 2] do |limit, posting_types = []|
|
data/lib/marty/monkey.rb
CHANGED
@@ -364,12 +364,12 @@ module Netzke
|
|
364
364
|
module DynamicAssets
|
365
365
|
class << self
|
366
366
|
def minify_js(js_string)
|
367
|
-
if
|
368
|
-
|
369
|
-
|
370
|
-
# MONKEY: enable es6 by passing in harmony argument
|
371
|
-
Uglifier.compile(js_string, harmony: true)
|
367
|
+
if Rails.application.config.marty.uglify_assets
|
368
|
+
# Doesn't fully support ES6 syntax
|
369
|
+
return Uglifier.compile(js_string, harmony: true)
|
372
370
|
end
|
371
|
+
|
372
|
+
js_string.gsub(/\/\*\*[^*]*\*+(?:[^*\/][^*]*\*+)*\//, '') # strip docs
|
373
373
|
end
|
374
374
|
end
|
375
375
|
end
|
data/lib/marty/version.rb
CHANGED
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: 9.
|
4
|
+
version: 9.5.0
|
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: 2020-02-
|
17
|
+
date: 2020-02-13 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: actioncable
|
@@ -376,6 +376,8 @@ files:
|
|
376
376
|
- app/components/marty/simple_app/client/simple_app.js
|
377
377
|
- app/components/marty/simple_app/client/statusbar_ext.js
|
378
378
|
- app/components/marty/tag_grid.rb
|
379
|
+
- app/components/marty/tree.rb
|
380
|
+
- app/components/marty/tree/client/tree.js
|
379
381
|
- app/components/marty/user_view.rb
|
380
382
|
- app/components/marty/users/user_view.rb
|
381
383
|
- app/controllers/marty/application_controller.rb
|