Commit 2ee8f474 authored by Łukasz Nowak's avatar Łukasz Nowak

erp5_web_monitoring: Avoid redirection in render

It's a workaround for issue in monitor resulting with infinite recursion after
clicking delete button.
parent 1b6dcf48
......@@ -39,7 +39,7 @@
redirect_options = {
jio_key: result.data.rows[0].id
};
return gadget.redirect({"command": "index", options: redirect_options});
return gadget.redirectByJob({"command": "index", options: redirect_options});
}
redirect_options = {
extended_search: gadget.state.query
......@@ -55,7 +55,7 @@
} else if (gadget.state.portal_type === "promise") {
redirect_options.page = "ojsm_status_list";
}
return gadget.redirect({"command": "display", options: redirect_options});
return gadget.redirectByJob({"command": "display", options: redirect_options});
});
}
......@@ -75,6 +75,9 @@
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareJob("redirectByJob", function (options) {
return this.redirect(options);
})
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_view')
......@@ -146,7 +149,7 @@
page: 'ojsm_dispatch'
})
.push(function () {
return gadget.redirect({command: 'change', options: {
return gadget.redirectByJob({command: 'change', options: {
page: "ojsm_erp5_configurator",
type: "erp5"
}});
......
......@@ -12,7 +12,9 @@
.declareAcquiredMethod("jio_remove", "jio_remove")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareJob("redirectByJob", function (options) {
return this.redirect(options);
})
.declareMethod("render", function (options) {
var gadget = this;
......@@ -24,7 +26,7 @@
return gadget.notifySubmitted({message: "Document Deleted", status: "success"});
})
.push(function () {
return gadget.redirect({command: 'change', options: {
return gadget.redirectByJob({command: 'change', options: {
page: options.return_url || 'settings_configurator'
}});
});
......
......@@ -11,7 +11,9 @@
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareJob("redirectByJob", function (options) {
return this.redirect(options);
})
.declareMethod("render", function (options) {
var gadget = this;
return this.updateHeader({
......@@ -30,7 +32,7 @@
// reset redirections
return gadget.setSetting("sync_redirect_options", undefined)
.push(function () {
return gadget.redirect({
return gadget.redirectByJob({
"command": "display",
"options": redirect_options
});
......@@ -44,7 +46,7 @@
}
})
.push(function () {
return gadget.redirect({
return gadget.redirectByJob({
"command": "display",
"options": redirect_options
});
......
......@@ -195,6 +195,9 @@
.declareMethod("triggerSubmit", function (event) {
return this.element.querySelector('form button[type="submit"]').click();
})
.declareJob("redirectByJob", function (options) {
return this.redirect(options);
})
.declareMethod("render", function (options) {
var gadget = this,
last_sync_time,
......@@ -207,7 +210,7 @@
if (options.url) {
// backward compatibility redirect to add opml
options.page = "ojsm_opml_add";
return gadget.redirect({"command": "change", "options": options});
return gadget.redirectByJob({"command": "change", "options": options});
}
return new RSVP.Queue()
......
......@@ -100,6 +100,8 @@
]);
})
.push(function (result) {
// XXX: didn't replace by renderByJob here, shall I declare it on
// result[0] ?
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment