marty 8.5.0 → 9.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintignore +1 -0
- data/.eslintrc.js +26 -0
- data/.gitignore +3 -0
- data/.gitlab-ci.yml +7 -0
- data/.prettierignore +14 -0
- data/.rubocop_todo.yml +1 -1
- data/Dockerfile.dummy +3 -0
- data/Makefile +1 -0
- data/app/assets/javascripts/marty/cable.js +7 -3
- data/app/assets/javascripts/marty/extjs/extensions/datetime_field/component.js +401 -0
- data/app/assets/javascripts/marty/extjs/extensions/datetime_field/field.js +140 -0
- data/app/assets/javascripts/marty/extjs/extensions/marty.js +845 -781
- data/app/assets/stylesheets/marty/codemirror/codemirror.css +215 -77
- data/app/assets/stylesheets/marty/codemirror/delorean.css +2 -2
- data/app/assets/stylesheets/marty/dark_mode.css +13 -3
- data/app/components/marty/auth_app/client/auth_app.js +107 -102
- data/app/components/marty/base_rule_view/client/base_rule_view.js +10 -8
- data/app/components/marty/data_grid_view/client/data_grid_edit.js +534 -519
- data/app/components/marty/form/client/form.js +3 -3
- data/app/components/marty/grid/client/grid.js +110 -87
- data/app/components/marty/import_view/client/import_view.js +18 -18
- data/app/components/marty/live_search_grid_panel/client/live_search_grid_panel.js +14 -13
- data/app/components/marty/main_auth_app/client/main_auth_app.js +42 -42
- data/app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js +27 -18
- data/app/components/marty/new_posting_form/client/new_posting_form.js +3 -3
- data/app/components/marty/panel/client/panel.js +3 -3
- data/app/components/marty/posting_grid/client/posting_grid.js +24 -18
- data/app/components/marty/promise_view/client/promise_view.css +12 -12
- data/app/components/marty/promise_view/client/promise_view.js +46 -38
- data/app/components/marty/report_form/client/report_form.js +30 -28
- data/app/components/marty/report_select/client/report_select.js +28 -23
- data/app/components/marty/reporting/client/reporting.js +3 -3
- data/app/components/marty/script_form/client/script_form.js +29 -23
- data/app/components/marty/script_tester/client/script_tester.js +4 -5
- data/app/components/marty/scripting/client/scripting.js +40 -36
- data/app/components/marty/simple_app/client/simple_app.js +33 -24
- data/app/components/marty/simple_app/client/statusbar_ext.js +1 -1
- data/app/controllers/marty/rpc_controller.rb +3 -0
- data/app/models/marty/promise.rb +10 -2
- data/app/services/marty/data_grid/constraint.rb +2 -1
- data/app/services/marty/jobs/schedule.rb +2 -2
- data/app/services/marty/promises/delorean/create.rb +9 -2
- data/app/services/marty/promises/ruby/create.rb +7 -2
- data/config/initializers/delayed_job_config.rb +1 -0
- data/delorean/blame_report.dl +50 -58
- data/delorean/enum_report.dl +2 -3
- data/delorean/{marty_fields.dl → fields.dl} +16 -0
- data/delorean/styles.dl +216 -0
- data/delorean/table_report.dl +4 -4
- data/lib/marty/monkey.rb +17 -0
- data/lib/marty/promise_job.rb +9 -0
- data/lib/marty/promise_ruby_job.rb +8 -0
- data/lib/marty/version.rb +1 -1
- data/make-lint.mk +19 -0
- data/package.json +16 -0
- data/prettier.config.js +6 -0
- data/spec/controllers/diagnostic/controller_spec.rb +0 -1
- data/spec/controllers/rpc_controller_spec.rb +21 -7
- data/spec/dummy/delorean/data_report.dl +4 -4
- data/spec/dummy/delorean/fields.dl +1 -0
- data/spec/features/data_grid_spec.rb +37 -1
- data/spec/job_helper.rb +6 -0
- data/spec/lib/data_blame_spec.rb +4 -4
- data/spec/lib/data_importer_spec.rb +6 -4
- data/spec/models/promise_spec.rb +31 -0
- data/spec/spec_helper.rb +8 -0
- data/spec/support/download_helper.rb +53 -49
- data/spec/support/json_helper.rb +11 -0
- data/spec/support/shared_connection_db_helpers.rb +1 -0
- data/spec/support/suite.rb +20 -14
- data/yarn.lock +967 -0
- metadata +16 -4
- data/spec/dummy/delorean/marty_fields.dl +0 -1
@@ -1,37 +1,46 @@
|
|
1
|
-
{
|
2
|
-
initComponent
|
1
|
+
({
|
2
|
+
initComponent() {
|
3
3
|
this.callParent();
|
4
4
|
|
5
5
|
// dup is a non standard button, so we have to explicitly manage
|
6
6
|
// its clickability
|
7
|
-
this.getSelectionModel().on(
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
this.getSelectionModel().on(
|
8
|
+
"selectionchange",
|
9
|
+
function(selModel) {
|
10
|
+
this.actions.dupInForm &&
|
11
|
+
this.actions.dupInForm.setDisabled(
|
12
|
+
!selModel.hasSelection() || !this.permissions.create
|
13
|
+
);
|
14
|
+
},
|
15
|
+
this
|
16
|
+
);
|
12
17
|
},
|
13
18
|
// copied from basepack grid's onEditInForm
|
14
|
-
netzkeOnDupInForm
|
15
|
-
|
16
|
-
|
19
|
+
netzkeOnDupInForm() {
|
20
|
+
const selModel = this.getSelectionModel();
|
21
|
+
const recordId = selModel.getSelection()[0].getId();
|
17
22
|
this.netzkeLoadComponent("edit_window", {
|
18
23
|
title: "Duplicate in Form",
|
19
24
|
serverConfig: {
|
20
25
|
record_id: recordId
|
21
26
|
},
|
22
|
-
callback
|
27
|
+
callback(w) {
|
23
28
|
w.show();
|
24
|
-
|
29
|
+
const form = w.items.first();
|
25
30
|
form.baseParams = {
|
26
31
|
dup: true
|
27
32
|
};
|
28
|
-
w.on(
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
+
w.on(
|
34
|
+
"close",
|
35
|
+
function() {
|
36
|
+
if (w.closeRes === "ok") {
|
37
|
+
this.store.load();
|
38
|
+
}
|
39
|
+
},
|
40
|
+
this
|
41
|
+
);
|
33
42
|
},
|
34
43
|
scope: this
|
35
44
|
});
|
36
45
|
}
|
37
|
-
}
|
46
|
+
});
|
@@ -1,22 +1,28 @@
|
|
1
|
-
{
|
2
|
-
initComponent
|
1
|
+
({
|
2
|
+
initComponent() {
|
3
3
|
this.callParent();
|
4
4
|
|
5
|
-
this.getSelectionModel().on(
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
this.getSelectionModel().on(
|
6
|
+
"selectionchange",
|
7
|
+
function(selModel) {
|
8
|
+
this.actions.detail &&
|
9
|
+
this.actions.detail.setDisabled(!selModel.hasSelection());
|
10
|
+
},
|
11
|
+
this
|
12
|
+
);
|
9
13
|
},
|
10
14
|
|
11
|
-
detail
|
12
|
-
record_id = this.getSelectionModel()
|
15
|
+
detail() {
|
16
|
+
const record_id = this.getSelectionModel()
|
17
|
+
.getSelection()[0]
|
18
|
+
.getId();
|
13
19
|
this.server.detail({
|
14
|
-
record_id
|
20
|
+
record_id
|
15
21
|
});
|
16
22
|
},
|
17
23
|
|
18
|
-
netzkeShowDetail
|
19
|
-
Ext.create(
|
24
|
+
netzkeShowDetail(details) {
|
25
|
+
Ext.create("Ext.Window", {
|
20
26
|
height: 150,
|
21
27
|
minWidth: 250,
|
22
28
|
autoWidth: true,
|
@@ -27,17 +33,17 @@
|
|
27
33
|
}).show();
|
28
34
|
},
|
29
35
|
|
30
|
-
netzkeOnDelete
|
31
|
-
|
32
|
-
|
33
|
-
me.getSelectionModel().selected.each(function
|
36
|
+
netzkeOnDelete() {
|
37
|
+
const records = [];
|
38
|
+
const me = this;
|
39
|
+
me.getSelectionModel().selected.each(function(r) {
|
34
40
|
records.push(r.getId());
|
35
41
|
}, me);
|
36
42
|
|
37
43
|
// find the root component (main application)
|
38
|
-
|
44
|
+
let main_app = me;
|
39
45
|
while (1) {
|
40
|
-
|
46
|
+
const p = main_app.netzkeGetParentComponent();
|
41
47
|
if (!p) {
|
42
48
|
break;
|
43
49
|
}
|
@@ -47,4 +53,4 @@
|
|
47
53
|
// assumes main_app has serverSelectPosting method
|
48
54
|
main_app.server.selectPosting(records);
|
49
55
|
}
|
50
|
-
}
|
56
|
+
});
|
@@ -1,29 +1,29 @@
|
|
1
1
|
.green-row {
|
2
|
-
|
2
|
+
background-color: #91ff91;
|
3
3
|
}
|
4
4
|
|
5
5
|
.red-row {
|
6
|
-
|
6
|
+
background-color: #ff4545;
|
7
7
|
}
|
8
8
|
|
9
9
|
.orange-row {
|
10
|
-
|
10
|
+
background-color: #ff9d5c;
|
11
11
|
}
|
12
12
|
|
13
13
|
.x-grid-item-selected .green-row {
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
background-color: #549454;
|
15
|
+
/* V: 58 */
|
16
|
+
font-weight: bold;
|
17
17
|
}
|
18
18
|
|
19
19
|
.x-grid-item-selected .red-row {
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
background-color: #bd3333;
|
21
|
+
/* V: 74 */
|
22
|
+
font-weight: bold;
|
23
23
|
}
|
24
24
|
|
25
25
|
.x-grid-item-selected .orange-row {
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
background-color: #b87243;
|
27
|
+
/* V: 74 */
|
28
|
+
font-weight: bold;
|
29
29
|
}
|
@@ -1,60 +1,68 @@
|
|
1
|
-
{
|
2
|
-
initComponent
|
3
|
-
|
4
|
-
me.tbar = [
|
1
|
+
({
|
2
|
+
initComponent() {
|
3
|
+
const me = this;
|
4
|
+
me.tbar = [
|
5
|
+
"->",
|
5
6
|
{
|
6
|
-
name:
|
7
|
-
xtype:
|
7
|
+
name: "live_search_text",
|
8
|
+
xtype: "textfield",
|
8
9
|
enable_key_events: true,
|
9
|
-
ref:
|
10
|
-
empty_text:
|
10
|
+
ref: "../live_search_field",
|
11
|
+
empty_text: "Search",
|
11
12
|
listeners: {
|
12
13
|
change: {
|
13
14
|
fn: me.listenFn,
|
14
|
-
buffer: 500
|
15
|
+
buffer: 500
|
15
16
|
}
|
16
17
|
}
|
17
18
|
}
|
18
|
-
]
|
19
|
+
];
|
19
20
|
this.callParent();
|
20
|
-
this.getSelectionModel().on(
|
21
|
-
|
22
|
-
|
21
|
+
this.getSelectionModel().on(
|
22
|
+
"selectionchange",
|
23
|
+
function(selModel) {
|
24
|
+
this.actions.download &&
|
25
|
+
this.actions.download.setDisabled(!selModel.hasSelection());
|
26
|
+
},
|
27
|
+
this
|
28
|
+
);
|
23
29
|
this.getView().getRowClass = this.defaultGetRowClass;
|
24
30
|
},
|
25
|
-
defaultGetRowClass
|
26
|
-
|
31
|
+
defaultGetRowClass(record, _index, _rowParams, _ds) {
|
32
|
+
const status = record.get("status");
|
27
33
|
if (status === false) return "red-row";
|
28
34
|
if (status === true) return "green-row";
|
29
35
|
return "orange-row";
|
30
36
|
},
|
31
37
|
|
32
|
-
listenFn
|
33
|
-
|
38
|
+
listenFn(obj, search_text) {
|
39
|
+
const lg = this.ownerCt.ownerCt;
|
34
40
|
lg.getStore().getProxy().extraParams.live_search = search_text;
|
35
41
|
lg.getStore().load();
|
36
42
|
},
|
37
43
|
|
38
|
-
netzkeOnDownload
|
39
|
-
|
44
|
+
netzkeOnDownload() {
|
45
|
+
const jid = this.getSelectionModel()
|
46
|
+
.getSelection()[0]
|
47
|
+
.getId();
|
40
48
|
// FIXME: seems pretty hacky
|
41
49
|
window.location = this.jobPath(jid);
|
42
50
|
},
|
43
51
|
|
44
|
-
netzkeOnRefresh
|
52
|
+
netzkeOnRefresh() {
|
45
53
|
this.store.load();
|
46
54
|
},
|
47
55
|
|
48
|
-
netzkeOnClear
|
49
|
-
|
56
|
+
netzkeOnClear(_params) {
|
57
|
+
const me = this;
|
50
58
|
Ext.Msg.show({
|
51
|
-
title:
|
52
|
-
msg:
|
59
|
+
title: "Clear All Jobs",
|
60
|
+
msg: "Enter CLEAR and press OK to clear all previous jobs",
|
53
61
|
width: 375,
|
54
62
|
buttons: Ext.Msg.OKCANCEL,
|
55
63
|
prompt: true,
|
56
|
-
fn
|
57
|
-
|
64
|
+
fn(btn, value) {
|
65
|
+
btn == "ok" && value == "CLEAR" && me.server.clear({});
|
58
66
|
}
|
59
67
|
});
|
60
68
|
},
|
@@ -62,25 +70,25 @@
|
|
62
70
|
// Updates model's `expanded` column if it's present.
|
63
71
|
// Since promises don't have such column, we don't need to send that
|
64
72
|
// extra request for every node expand event.
|
65
|
-
netzkeOnNodeStateChange
|
73
|
+
netzkeOnNodeStateChange() {
|
66
74
|
return;
|
67
75
|
},
|
68
76
|
|
69
|
-
netzkeOnCancelJob
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
77
|
+
netzkeOnCancelJob(_params) {
|
78
|
+
const me = this;
|
79
|
+
const sel = this.getSelectionModel().getSelection();
|
80
|
+
if (sel.length != 1) {
|
81
|
+
return this.netzkeNotify("select one job to cancel");
|
82
|
+
}
|
75
83
|
Ext.Msg.show({
|
76
|
-
title:
|
77
|
-
msg:
|
84
|
+
title: "Cancel this Job?",
|
85
|
+
msg: "Enter CANCEL and press OK to cancel the job",
|
78
86
|
width: 375,
|
79
87
|
buttons: Ext.Msg.OKCANCEL,
|
80
88
|
prompt: true,
|
81
|
-
|
82
|
-
|
89
|
+
fn(btn, value) {
|
90
|
+
btn == "ok" && value == "CANCEL" && me.server.cancelJob(sel[0].getId());
|
83
91
|
}
|
84
92
|
});
|
85
93
|
}
|
86
|
-
}
|
94
|
+
});
|
@@ -1,10 +1,10 @@
|
|
1
|
-
{
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
({
|
2
|
+
netzkeOnForeground() {
|
3
|
+
const values = this.getForm().getValues();
|
4
|
+
const data = Ext.encode(values);
|
5
5
|
|
6
|
-
|
7
|
-
data
|
6
|
+
const params = {
|
7
|
+
data,
|
8
8
|
reptitle: this.reptitle
|
9
9
|
};
|
10
10
|
|
@@ -15,21 +15,21 @@
|
|
15
15
|
params["disposition"] = "inline";
|
16
16
|
}
|
17
17
|
|
18
|
-
|
18
|
+
const form = document.createElement("form");
|
19
19
|
|
20
20
|
form.setAttribute("method", "post");
|
21
21
|
form.setAttribute("action", this.mountPath() + "/report." + this.repformat);
|
22
22
|
|
23
23
|
// set authenticity token
|
24
|
-
|
24
|
+
const hiddenField = document.createElement("input");
|
25
25
|
hiddenField.setAttribute("type", "hidden");
|
26
26
|
hiddenField.setAttribute("name", "authenticity_token");
|
27
27
|
hiddenField.setAttribute("value", this.authenticityToken);
|
28
28
|
form.appendChild(hiddenField);
|
29
29
|
|
30
|
-
for (
|
31
|
-
if (
|
32
|
-
|
30
|
+
for (const key in params) {
|
31
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
32
|
+
const hiddenField = document.createElement("input");
|
33
33
|
hiddenField.setAttribute("type", "hidden");
|
34
34
|
hiddenField.setAttribute("name", key);
|
35
35
|
hiddenField.setAttribute("value", params[key]);
|
@@ -43,36 +43,38 @@
|
|
43
43
|
document.body.removeChild(form);
|
44
44
|
},
|
45
45
|
|
46
|
-
netzkeOnLink
|
47
|
-
|
46
|
+
netzkeOnLink() {
|
47
|
+
const values = this.getForm().getValues();
|
48
48
|
|
49
49
|
// check for early url generation and exit with error message
|
50
|
-
if (values[
|
50
|
+
if (values["selected_script_name"] == null) {
|
51
51
|
alert("Please select a report before generating url.");
|
52
52
|
return;
|
53
53
|
}
|
54
54
|
|
55
|
-
params = {
|
56
|
-
|
57
|
-
|
58
|
-
}
|
55
|
+
const params = {
|
56
|
+
format: this.repformat,
|
57
|
+
reptitle: this.reptitle
|
58
|
+
};
|
59
|
+
|
60
|
+
let key;
|
59
61
|
|
60
|
-
for (
|
62
|
+
for (key in values) {
|
61
63
|
if (values[key] == "") {
|
62
|
-
delete values[key]
|
64
|
+
delete values[key];
|
63
65
|
}
|
64
66
|
}
|
65
|
-
data = Ext.encode(values)
|
67
|
+
const data = Ext.encode(values);
|
66
68
|
|
67
69
|
// construct url
|
68
|
-
|
69
|
-
|
70
|
-
for (
|
70
|
+
const proto_host = location.protocol + "//" + location.host;
|
71
|
+
let url = proto_host + "/report?data=" + data;
|
72
|
+
for (key in params) {
|
71
73
|
if (params[key] == "") continue;
|
72
|
-
url +=
|
74
|
+
url += "&" + key + "=" + params[key];
|
73
75
|
}
|
74
|
-
url = encodeURI(url)
|
75
|
-
|
76
|
+
url = encodeURI(url);
|
77
|
+
const win = window.open("");
|
76
78
|
win.document.write(url.link(url));
|
77
79
|
}
|
78
|
-
}
|
80
|
+
});
|
@@ -1,50 +1,55 @@
|
|
1
|
-
{
|
2
|
-
initComponent
|
3
|
-
|
1
|
+
({
|
2
|
+
initComponent() {
|
3
|
+
const me = this;
|
4
4
|
me.callParent();
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
const tag_grid = me.netzkeGetComponent("tag_grid").getView();
|
7
|
+
const script_grid = me.netzkeGetComponent("script_grid").getView();
|
8
|
+
const nodename = me.getForm().findField("nodename");
|
9
9
|
|
10
|
-
nodename.on(
|
10
|
+
nodename.on("select", function(self, record) {
|
11
11
|
if (record instanceof Array) {
|
12
|
-
record = record[0]
|
12
|
+
record = record[0];
|
13
13
|
}
|
14
|
-
|
14
|
+
const data = record && record.data;
|
15
15
|
me.server.selectNode({
|
16
16
|
node: data.value
|
17
17
|
});
|
18
18
|
});
|
19
19
|
|
20
|
-
tag_grid.getSelectionModel().on(
|
21
|
-
|
22
|
-
|
20
|
+
tag_grid.getSelectionModel().on(
|
21
|
+
"selectionchange",
|
22
|
+
function(self, records) {
|
23
|
+
const tag_id = records[0].get("id");
|
23
24
|
me.server.selectTag({
|
24
|
-
tag_id
|
25
|
+
tag_id
|
25
26
|
});
|
26
27
|
script_grid.getStore().load();
|
27
|
-
},
|
28
|
+
},
|
29
|
+
me
|
30
|
+
);
|
28
31
|
|
29
|
-
script_grid.getSelectionModel().on(
|
30
|
-
|
32
|
+
script_grid.getSelectionModel().on(
|
33
|
+
"selectionchange",
|
34
|
+
function(self, records) {
|
31
35
|
if (script_grid.getStore().isLoading() == true) return;
|
32
36
|
|
33
|
-
if (records[0] == null)
|
34
|
-
return;
|
37
|
+
if (records[0] == null) return;
|
35
38
|
|
36
|
-
|
39
|
+
const script_name = records[0].get("name");
|
37
40
|
me.server.selectScript({
|
38
|
-
script_name
|
41
|
+
script_name
|
39
42
|
});
|
40
43
|
nodename.reset();
|
41
44
|
nodename.store.load({
|
42
45
|
params: {}
|
43
46
|
});
|
44
|
-
},
|
47
|
+
},
|
48
|
+
me
|
49
|
+
);
|
45
50
|
},
|
46
51
|
|
47
|
-
parentSelectReport
|
52
|
+
parentSelectReport() {
|
48
53
|
this.netzkeGetParentComponent().selectReport();
|
49
54
|
}
|
50
|
-
}
|
55
|
+
});
|