marty 0.5.41 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -2
- data/app/components/marty/api_auth_view.rb +5 -8
- data/app/components/marty/auth_app.rb +8 -9
- data/app/components/marty/auth_app/{javascripts → client}/auth_app.js +4 -4
- data/app/components/marty/config_view.rb +7 -9
- data/app/components/marty/extras/misc.rb +14 -1
- data/app/components/marty/form.rb +1 -1
- data/app/components/marty/grid.rb +27 -14
- data/app/components/marty/grid_append_only.rb +3 -5
- data/app/components/marty/import_type_view.rb +8 -11
- data/app/components/marty/live_search_grid_panel.rb +3 -3
- data/app/components/marty/main_auth_app.rb +17 -19
- data/app/components/marty/mcfly_grid_panel.rb +13 -15
- data/app/components/marty/new_posting_form.rb +5 -5
- data/app/components/marty/new_posting_window.rb +1 -1
- data/app/components/marty/panel.rb +2 -2
- data/app/components/marty/posting_grid.rb +19 -28
- data/app/components/marty/posting_window.rb +6 -7
- data/app/components/marty/promise_view.rb +23 -24
- data/app/components/marty/promise_view/{stylesheets → client}/promise_view.css +0 -0
- data/app/components/marty/report_form.rb +11 -10
- data/app/components/marty/report_select.rb +17 -15
- data/app/components/marty/reporting.rb +2 -2
- data/app/components/marty/script_form.rb +34 -38
- data/app/components/marty/script_form/{javascripts → client}/Ext.ux.form.field.CodeMirror.js +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/codemirror.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/codemirror.js +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/delorean.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clike/clike.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clike/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clike/scala.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clojure/clojure.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clojure/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/coffeescript.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/commonlisp.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/css/css.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/css/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/css/test.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/delorean/delorean.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/diff/diff.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/diff/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ecl/ecl.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ecl/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/erlang/erlang.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/erlang/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/gfm/gfm.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/gfm/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/go/go.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/go/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/groovy/groovy.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/groovy/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haskell/haskell.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haskell/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haxe/haxe.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haxe/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/htmlembedded.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/htmlmixed.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/javascript/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/javascript/javascript.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/jinja2.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/less/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/less/less.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/lua/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/lua/lua.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/markdown/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/markdown/markdown.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/markdown/test.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/mysql/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/mysql/mysql.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/ntriples.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/ocaml.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pascal/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pascal/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pascal/pascal.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/perl/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/perl/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/perl/perl.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/php/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/php/php.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pig/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pig/pig.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/plsql/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/plsql/plsql.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/properties/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/properties/properties.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/python/LICENSE.txt +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/python/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/python/python.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/r/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/r/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/r/r.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/changes.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rst/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rst/rst.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ruby/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ruby/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ruby/ruby.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rust/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rust/rust.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/scheme/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/scheme/scheme.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/shell/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/shell/shell.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sieve/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sieve/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sieve/sieve.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/smalltalk.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smarty/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smarty/smarty.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sparql/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sparql/sparql.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/stex/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/stex/stex.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/stex/test.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiki/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vb/LICENSE.txt +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vb/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vb/vb.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/vbscript.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/velocity/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/velocity/velocity.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/verilog/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/verilog/verilog.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xml/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xml/xml.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testBase.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testEmptySequenceKeyword.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testMultiAttr.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testNamespaces.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testProcessingInstructions.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testQuotes.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/xquery.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/yaml/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/yaml/yaml.js +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/ambiance.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/blackboard.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/cobalt.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/eclipse.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/elegant.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/erlang-dark.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/lesser-dark.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/monokai.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/neat.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/night.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/rubyblue.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/vibrant-ink.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/xq-dark.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/closetag.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/dialog.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/dialog.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/foldcode.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/formatting.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/javascript-hint.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/loadmode.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/match-highlighter.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/multiplex.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/overlay.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/pig-hint.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/runmode-standalone.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/runmode.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/search.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/searchcursor.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/xml-hint.js +0 -0
- data/app/components/marty/script_grid.rb +24 -32
- data/app/components/marty/script_tester.rb +11 -11
- data/app/components/marty/scripting.rb +12 -12
- data/app/components/marty/simple_app.rb +2 -2
- data/app/components/marty/simple_app/{javascripts → client}/simple_app.js +0 -0
- data/app/components/marty/simple_app/{javascripts → client}/statusbar_ext.js +0 -0
- data/app/components/marty/tag_grid.rb +15 -21
- data/app/components/marty/user_view.rb +41 -57
- data/lib/marty/monkey.rb +1 -1
- data/lib/marty/version.rb +1 -1
- data/marty.gemspec +3 -2
- data/spec/dummy/app/assets/{stylesheets → client}/application.css +0 -0
- data/spec/dummy/app/assets/client/application.js +15 -0
- data/spec/features/scripting_spec.rb +17 -0
- data/spec/features/user_view_spec.rb +15 -15
- data/spec/spec_helper.rb +9 -0
- metadata +189 -174
@@ -4,8 +4,8 @@ class Marty::NewPostingForm < Marty::Form
|
|
4
4
|
# override this to set permissions for posting types
|
5
5
|
has_marty_permissions read: :any
|
6
6
|
|
7
|
-
|
8
|
-
c.close_me = <<-JS
|
7
|
+
client_class do |c|
|
8
|
+
c.close_me = l(<<-JS)
|
9
9
|
function() {
|
10
10
|
// assume we're embedded in a window
|
11
11
|
this.netzkeGetParentComponent().close();
|
@@ -21,9 +21,9 @@ class Marty::NewPostingForm < Marty::Form
|
|
21
21
|
|
22
22
|
######################################################################
|
23
23
|
|
24
|
-
endpoint :
|
25
|
-
res = super(params
|
26
|
-
|
24
|
+
endpoint :submit do |params|
|
25
|
+
res = super(params)
|
26
|
+
client.close_me
|
27
27
|
res
|
28
28
|
end
|
29
29
|
|
@@ -7,49 +7,40 @@ class Marty::PostingGrid < Marty::Grid
|
|
7
7
|
|
8
8
|
c.header = false
|
9
9
|
c.model = "Marty::Posting"
|
10
|
-
c.
|
10
|
+
c.attributes = [:name, :created_dt, :user__name, :comment]
|
11
11
|
c.multi_select = false
|
12
|
-
c.
|
12
|
+
c.store_config.merge!({sorters: [{property: :created_dt, direction: 'DESC'}],
|
13
|
+
page_size: 12})
|
13
14
|
end
|
14
15
|
|
15
16
|
# hijacking delete button
|
16
|
-
action :
|
17
|
+
action :delete do |a|
|
17
18
|
a.text = "Select"
|
18
19
|
a.tooltip = "Select"
|
19
20
|
a.icon = :time_go
|
20
21
|
a.disabled = true
|
21
22
|
end
|
22
23
|
|
23
|
-
|
24
|
-
c.init_component = <<-JS
|
24
|
+
client_class do |c|
|
25
|
+
c.init_component = l(<<-JS)
|
25
26
|
function() {
|
26
27
|
this.callParent();
|
28
|
+
|
27
29
|
this.getSelectionModel().on('selectionchange', function(selModel) {
|
28
30
|
this.actions.detail &&
|
29
31
|
this.actions.detail.setDisabled(!selModel.hasSelection());
|
30
32
|
}, this);
|
31
|
-
|
32
|
-
var me = this;
|
33
|
-
me.getView().on('itemkeydown', function(view, record, item, index, e) {
|
34
|
-
if (e.getKey() === e.SPACE) {
|
35
|
-
record_id = me.getSelectionModel().selected.first().getId();
|
36
|
-
me.getView().fireEvent('itemclick', me, record);
|
37
|
-
me.serverDetail({record_id: record_id});
|
38
|
-
var rowIndex = me.find('id', record.getId());
|
39
|
-
me.getView().select(rowIndex);
|
40
|
-
}
|
41
|
-
});
|
42
33
|
}
|
43
34
|
JS
|
44
35
|
|
45
|
-
c.detail = <<-JS
|
36
|
+
c.detail = l(<<-JS)
|
46
37
|
function() {
|
47
38
|
record_id = this.getSelectionModel().selected.first().getId();
|
48
|
-
this.
|
39
|
+
this.server.detail({record_id: record_id});
|
49
40
|
}
|
50
41
|
JS
|
51
42
|
|
52
|
-
c.
|
43
|
+
c.netzke_show_detail = l(<<-JS)
|
53
44
|
function(details) {
|
54
45
|
Ext.create('Ext.Window', {
|
55
46
|
height: 150,
|
@@ -63,7 +54,7 @@ class Marty::PostingGrid < Marty::Grid
|
|
63
54
|
}
|
64
55
|
JS
|
65
56
|
|
66
|
-
c.
|
57
|
+
c.netzke_on_delete = l(<<-JS)
|
67
58
|
function() {
|
68
59
|
var records = [];
|
69
60
|
var me = this;
|
@@ -80,13 +71,13 @@ class Marty::PostingGrid < Marty::Grid
|
|
80
71
|
}
|
81
72
|
|
82
73
|
// assumes main_app has serverSelectPosting method
|
83
|
-
main_app.
|
74
|
+
main_app.server.selectPosting(records);
|
84
75
|
}
|
85
76
|
JS
|
86
77
|
end
|
87
78
|
|
88
79
|
def default_bbar
|
89
|
-
[:
|
80
|
+
[:delete, :detail]
|
90
81
|
end
|
91
82
|
|
92
83
|
action :detail do |a|
|
@@ -96,7 +87,7 @@ class Marty::PostingGrid < Marty::Grid
|
|
96
87
|
a.disabled = true
|
97
88
|
end
|
98
89
|
|
99
|
-
endpoint :
|
90
|
+
endpoint :detail do |params|
|
100
91
|
record_id = params[:record_id]
|
101
92
|
|
102
93
|
# Prepare an HTML popup with session details such that the
|
@@ -113,24 +104,24 @@ class Marty::PostingGrid < Marty::Grid
|
|
113
104
|
"<b>User:</b>\t#{pt.user.name}<br/>" +
|
114
105
|
"<b>Comment:</b>\t#{pt.comment}"
|
115
106
|
|
116
|
-
|
107
|
+
client.netzke_show_detail html
|
117
108
|
end
|
118
109
|
|
119
|
-
|
110
|
+
attribute :name do |c|
|
120
111
|
c.flex = 1
|
121
112
|
end
|
122
113
|
|
123
|
-
|
114
|
+
attribute :created_dt do |c|
|
124
115
|
c.text = "Date/Time"
|
125
116
|
c.format = "Y-m-d H:i"
|
126
117
|
c.hidden = true
|
127
118
|
end
|
128
119
|
|
129
|
-
|
120
|
+
attribute :user__name do |c|
|
130
121
|
c.width = 100
|
131
122
|
end
|
132
123
|
|
133
|
-
|
124
|
+
attribute :comment do |c|
|
134
125
|
c.width = 100
|
135
126
|
end
|
136
127
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class Marty::PostingWindow < Netzke::
|
1
|
+
class Marty::PostingWindow < Netzke::Window::Base
|
2
2
|
def configure(c)
|
3
3
|
super
|
4
4
|
|
@@ -12,13 +12,12 @@ class Marty::PostingWindow < Netzke::Basepack::Window
|
|
12
12
|
|
13
13
|
component :posting_grid do |c|
|
14
14
|
c.klass = Marty::PostingGrid
|
15
|
-
c.enable_edit_in_form = false
|
16
|
-
c.enable_extended_search = false
|
17
15
|
c.rows_per_page = 12
|
18
|
-
c.
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
c.permissions = {
|
17
|
+
update: false,
|
18
|
+
delete: true, # hijacked for selection
|
19
|
+
create: false,
|
20
|
+
}
|
22
21
|
# c.bbar = []
|
23
22
|
end
|
24
23
|
|
@@ -1,12 +1,11 @@
|
|
1
|
-
class Marty::PromiseView < Netzke::
|
1
|
+
class Marty::PromiseView < Netzke::Tree::Base
|
2
2
|
extend ::Marty::Permissions
|
3
3
|
|
4
|
-
|
4
|
+
client_styles do |config|
|
5
5
|
config.require :promise_view
|
6
6
|
end
|
7
|
-
|
8
|
-
|
9
|
-
config.default_get_row_class = <<-JS
|
7
|
+
client_class do |config|
|
8
|
+
config.default_get_row_class = l(<<-JS)
|
10
9
|
function(record, index, rowParams, ds) {
|
11
10
|
var status = record.get('status');
|
12
11
|
if (status === false) return "red-row";
|
@@ -15,7 +14,7 @@ class Marty::PromiseView < Netzke::Basepack::Tree
|
|
15
14
|
}
|
16
15
|
JS
|
17
16
|
|
18
|
-
config.listen_fn = <<-JS
|
17
|
+
config.listen_fn = l(<<-JS)
|
19
18
|
function(obj, search_text) {
|
20
19
|
var lg = this.ownerCt.ownerCt;
|
21
20
|
lg.getStore().getProxy().extraParams.live_search = search_text;
|
@@ -43,7 +42,7 @@ class Marty::PromiseView < Netzke::Basepack::Tree
|
|
43
42
|
super
|
44
43
|
config.title = I18n.t("jobs.promise_view")
|
45
44
|
config.model = "Marty::Promise"
|
46
|
-
config.
|
45
|
+
config.attributes = [
|
47
46
|
{name: :title, xtype: :treecolumn},
|
48
47
|
:user__login,
|
49
48
|
:job_id,
|
@@ -54,7 +53,7 @@ class Marty::PromiseView < Netzke::Basepack::Tree
|
|
54
53
|
:error,
|
55
54
|
]
|
56
55
|
config.root_visible = false
|
57
|
-
config.
|
56
|
+
config.paging = :none
|
58
57
|
config.bbar = bbar
|
59
58
|
|
60
59
|
# garbage collect old promises (hacky to do this here)
|
@@ -65,8 +64,8 @@ class Marty::PromiseView < Netzke::Basepack::Tree
|
|
65
64
|
[:clear, '->', :refresh, :download]
|
66
65
|
end
|
67
66
|
|
68
|
-
|
69
|
-
config.init_component = <<-JS
|
67
|
+
client_class do |config|
|
68
|
+
config.init_component = l(<<-JS)
|
70
69
|
function() {
|
71
70
|
this.callParent();
|
72
71
|
this.getSelectionModel().on('selectionchange', function(selModel) {
|
@@ -77,7 +76,7 @@ class Marty::PromiseView < Netzke::Basepack::Tree
|
|
77
76
|
}
|
78
77
|
JS
|
79
78
|
|
80
|
-
config.
|
79
|
+
config.netzke_on_download = l(<<-JS)
|
81
80
|
function() {
|
82
81
|
var jid = this.getSelectionModel().selected.first().getId();
|
83
82
|
// FIXME: seems pretty hacky
|
@@ -85,13 +84,13 @@ class Marty::PromiseView < Netzke::Basepack::Tree
|
|
85
84
|
}
|
86
85
|
JS
|
87
86
|
|
88
|
-
config.
|
87
|
+
config.netzke_on_refresh = l(<<-JS)
|
89
88
|
function() {
|
90
89
|
this.store.load();
|
91
90
|
}
|
92
91
|
JS
|
93
92
|
|
94
|
-
config.
|
93
|
+
config.netzke_on_clear = l(<<-JS)
|
95
94
|
function(params) {
|
96
95
|
var me = this;
|
97
96
|
Ext.Msg.show({
|
@@ -101,7 +100,7 @@ class Marty::PromiseView < Netzke::Basepack::Tree
|
|
101
100
|
buttons: Ext.Msg.OKCANCEL,
|
102
101
|
prompt: true,
|
103
102
|
fn: function (btn, value) {
|
104
|
-
(btn == "ok" && value == "CLEAR") && me.
|
103
|
+
(btn == "ok" && value == "CLEAR") && me.server.clear({});
|
105
104
|
}
|
106
105
|
});
|
107
106
|
}
|
@@ -127,9 +126,9 @@ class Marty::PromiseView < Netzke::Basepack::Tree
|
|
127
126
|
a.icon = :arrow_refresh
|
128
127
|
end
|
129
128
|
|
130
|
-
endpoint :
|
129
|
+
endpoint :clear do |params|
|
131
130
|
Marty::Promise.cleanup(true)
|
132
|
-
|
131
|
+
client.on_refresh
|
133
132
|
end
|
134
133
|
|
135
134
|
def get_records params
|
@@ -137,38 +136,38 @@ class Marty::PromiseView < Netzke::Basepack::Tree
|
|
137
136
|
Marty::Promise.children_for_id(params[:id], params[search_scope])
|
138
137
|
end
|
139
138
|
|
140
|
-
|
139
|
+
attribute :title do |config|
|
141
140
|
config.text = I18n.t('jobs.title')
|
142
141
|
config.width = 300
|
143
142
|
end
|
144
143
|
|
145
|
-
|
144
|
+
attribute :user__login do |config|
|
146
145
|
config.text = I18n.t('jobs.user_login')
|
147
146
|
config.width = 100
|
148
147
|
end
|
149
148
|
|
150
|
-
|
149
|
+
attribute :job_id do |config|
|
151
150
|
config.width = 90
|
152
151
|
end
|
153
152
|
|
154
|
-
|
153
|
+
attribute :start_dt do |config|
|
155
154
|
config.text = I18n.t('jobs.start_dt')
|
156
155
|
end
|
157
156
|
|
158
|
-
|
157
|
+
attribute :end_dt do |config|
|
159
158
|
config.text = I18n.t('jobs.end_dt')
|
160
159
|
end
|
161
160
|
|
162
|
-
|
161
|
+
attribute :status do |config|
|
163
162
|
config.hidden = true
|
164
163
|
end
|
165
164
|
|
166
|
-
|
165
|
+
attribute :cformat do |config|
|
167
166
|
config.text = I18n.t('jobs.cformat')
|
168
167
|
config.width = 90
|
169
168
|
end
|
170
169
|
|
171
|
-
|
170
|
+
attribute :error do |config|
|
172
171
|
config.getter = ->(record) { record.result.to_s if record.status == false }
|
173
172
|
config.flex = 1
|
174
173
|
end
|
File without changes
|
@@ -3,22 +3,23 @@ class Marty::ReportForm < Marty::Form
|
|
3
3
|
# override apply for background generation
|
4
4
|
action :apply do |a|
|
5
5
|
a.text = a.tooltip = I18n.t("reporting.background")
|
6
|
-
a.handler = :
|
6
|
+
a.handler = :netzke_on_apply
|
7
7
|
a.icon = :report_disk
|
8
8
|
a.disabled = false
|
9
9
|
end
|
10
10
|
|
11
11
|
action :foreground do |a|
|
12
12
|
a.text = a.tooltip = I18n.t("reporting.generate")
|
13
|
-
a.handler = :on_foreground
|
14
13
|
a.icon = :report_go
|
15
14
|
a.disabled = false
|
16
15
|
end
|
17
16
|
|
18
17
|
######################################################################
|
19
18
|
|
20
|
-
def
|
21
|
-
|
19
|
+
def default_bbar
|
20
|
+
[
|
21
|
+
'->', :apply, :foreground
|
22
|
+
]
|
22
23
|
end
|
23
24
|
|
24
25
|
######################################################################
|
@@ -65,12 +66,12 @@ class Marty::ReportForm < Marty::Form
|
|
65
66
|
end
|
66
67
|
end
|
67
68
|
|
68
|
-
endpoint :
|
69
|
+
endpoint :submit do |params|
|
69
70
|
# We get here when user is asking for a background report
|
70
71
|
|
71
72
|
engine, d_params, node = self.class.get_report_engine(params)
|
72
73
|
|
73
|
-
return
|
74
|
+
return client.netzke_notify "Insufficient permissions to run report!" unless
|
74
75
|
engine
|
75
76
|
|
76
77
|
# start background promise to get report result
|
@@ -79,19 +80,19 @@ class Marty::ReportForm < Marty::Form
|
|
79
80
|
["result", "title", "format"],
|
80
81
|
)
|
81
82
|
|
82
|
-
|
83
|
+
client.netzke_notify "Report can be accessed from the Jobs Dashboard ..."
|
83
84
|
end
|
84
85
|
|
85
86
|
######################################################################
|
86
87
|
|
87
|
-
|
88
|
+
client_class do |c|
|
88
89
|
# Find the mount path for the Marty engine. FIXME: this is likely
|
89
90
|
# very brittle.
|
90
91
|
@@mount_path = Rails.application.routes.routes.detect {
|
91
92
|
|r| r.app.app == Marty::Engine
|
92
93
|
}.format({})
|
93
94
|
|
94
|
-
c.
|
95
|
+
c.netzke_on_foreground = l(<<-JS)
|
95
96
|
function() {
|
96
97
|
var values = this.getForm().getValues();
|
97
98
|
var data = Ext.encode(values);
|
@@ -135,7 +136,7 @@ class Marty::ReportForm < Marty::Form
|
|
135
136
|
JS
|
136
137
|
end
|
137
138
|
|
138
|
-
endpoint :netzke_load do |params
|
139
|
+
endpoint :netzke_load do |params|
|
139
140
|
end
|
140
141
|
|
141
142
|
def eval_form_items(engine, items)
|
@@ -6,7 +6,7 @@ class Marty::ReportSelect < Marty::Form
|
|
6
6
|
c.height = 200
|
7
7
|
c.load_inline_data = false
|
8
8
|
c.title = I18n.t("script.selection_history")
|
9
|
-
c.
|
9
|
+
c.attributes = [:name, :created_dt, :comment]
|
10
10
|
c.bbar = []
|
11
11
|
end
|
12
12
|
|
@@ -15,8 +15,10 @@ class Marty::ReportSelect < Marty::Form
|
|
15
15
|
c.klass = Marty::ScriptGrid
|
16
16
|
c.title = I18n.t("script.selection_list")
|
17
17
|
c.bbar = []
|
18
|
-
c.
|
19
|
-
c.scope =
|
18
|
+
c.attributes = [:name, :tag]
|
19
|
+
c.scope = lambda { |r|
|
20
|
+
r.where("name like '%Report'")
|
21
|
+
}
|
20
22
|
end
|
21
23
|
|
22
24
|
######################################################################
|
@@ -43,10 +45,10 @@ class Marty::ReportSelect < Marty::Form
|
|
43
45
|
c.bbar = []
|
44
46
|
end
|
45
47
|
|
46
|
-
|
48
|
+
client_class do |c|
|
47
49
|
c.header = false
|
48
50
|
|
49
|
-
c.init_component = <<-JS
|
51
|
+
c.init_component = l(<<-JS)
|
50
52
|
function() {
|
51
53
|
var me = this;
|
52
54
|
me.callParent();
|
@@ -60,13 +62,13 @@ class Marty::ReportSelect < Marty::Form
|
|
60
62
|
record = record[0]
|
61
63
|
}
|
62
64
|
var data = record && record.data;
|
63
|
-
me.selectNode({node: data.value});
|
65
|
+
me.server.selectNode({node: data.value});
|
64
66
|
});
|
65
67
|
|
66
68
|
tag_grid.getSelectionModel().on('selectionchange',
|
67
69
|
function(self, records) {
|
68
70
|
var tag_id = records[0].get('id');
|
69
|
-
me.selectTag({tag_id: tag_id});
|
71
|
+
me.server.selectTag({tag_id: tag_id});
|
70
72
|
script_grid.getStore().load();
|
71
73
|
}, me);
|
72
74
|
|
@@ -78,14 +80,14 @@ class Marty::ReportSelect < Marty::Form
|
|
78
80
|
return;
|
79
81
|
|
80
82
|
var script_name = records[0].get('name');
|
81
|
-
me.selectScript({script_name: script_name});
|
83
|
+
me.server.selectScript({script_name: script_name});
|
82
84
|
nodename.reset();
|
83
85
|
nodename.store.load({params: {}});
|
84
86
|
}, me);
|
85
87
|
}
|
86
88
|
JS
|
87
89
|
|
88
|
-
c.parent_select_report = <<-JS
|
90
|
+
c.parent_select_report = l(<<-JS)
|
89
91
|
function() {
|
90
92
|
this.netzkeGetParentComponent().selectReport();
|
91
93
|
}
|
@@ -119,26 +121,26 @@ class Marty::ReportSelect < Marty::Form
|
|
119
121
|
}.compact.sort{ |a,b| a[1] <=> b[1]}
|
120
122
|
end
|
121
123
|
|
122
|
-
endpoint :get_combobox_options do |params
|
123
|
-
|
124
|
+
endpoint :get_combobox_options do |params|
|
125
|
+
client.data = node_list if params["attr"] == "nodename"
|
124
126
|
end
|
125
127
|
|
126
128
|
######################################################################
|
127
129
|
|
128
|
-
endpoint :select_tag do |params
|
130
|
+
endpoint :select_tag do |params|
|
129
131
|
root_sess[:selected_tag_id] = params[:tag_id]
|
130
132
|
root_sess[:selected_script_name] = nil
|
131
133
|
root_sess[:selected_node] = nil
|
132
134
|
end
|
133
135
|
|
134
|
-
endpoint :select_script do |params
|
136
|
+
endpoint :select_script do |params|
|
135
137
|
root_sess[:selected_script_name] = params[:script_name]
|
136
138
|
root_sess[:selected_node] = nil
|
137
139
|
end
|
138
140
|
|
139
|
-
endpoint :select_node do |params
|
141
|
+
endpoint :select_node do |params|
|
140
142
|
root_sess[:selected_node] = params[:node]
|
141
|
-
|
143
|
+
client.parent_select_report
|
142
144
|
end
|
143
145
|
end
|
144
146
|
|