Commit e22aa2c2 authored by Jérome Perrin's avatar Jérome Perrin

Revert "officejs_support_request_ui: prefer RSVP.hash for readability"

This reverts commit 463855b6.

unlike RSVP.all, RSVP.hash is not patched to support cancellation, so
it's not safe to use it at the moment.
parent f5026161
......@@ -92,18 +92,23 @@
if (modification_dict.hasOwnProperty("global")) {
queue
.push(function () {
return RSVP.hash({
preference_href: context.getUrlFor({command: 'display', options: {page: "supportrequest_preference"}}),
logout_href: context.getUrlFor({command: 'display', options: {page: "logout"}}),
search_href: context.getUrlFor({command: 'display', options: {page: "search"}}),
supportrequest_href: context.getUrlFor({command: 'display', options: {jio_key: "support_request_module"}})
});
return RSVP.all([
context.getUrlFor({command: 'display', options: {page: "supportrequest_preference"}}),
context.getUrlFor({command: 'display', options: {page: "logout"}}),
context.getUrlFor({command: 'display', options: {page: "search"}}),
context.getUrlFor({command: 'display', options: {jio_key: "support_request_module"}})
]);
})
.push(function (panel_options) {
.push(function (result_list) {
// XXX: Customize panel header!
return context.translateHtml(
panel_template_header() +
panel_template_body(panel_options)
panel_template_body({
"preference_href": result_list[0],
"logout_href": result_list[1],
"search_href": result_list[2],
"supportrequest_href": result_list[3]
})
);
})
.push(function (my_translated_or_plain_html) {
......
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1540790669.05</float>
<float>1540790670.05</float>
<string>GMT+9</string>
</tuple>
</state>
......
......@@ -125,23 +125,33 @@
element.classList.remove('ui-disabled');
});
})
// render the header
.push(function () {
return RSVP.hash({
edit_url: gadget.getUrlFor({command: 'change', options: {editable: true}}),
actions_url: gadget.getUrlFor({command: 'change', options: {page: "action"}}),
selection_url: gadget.getUrlFor({command: 'history_previous'}),
previous_url: gadget.getUrlFor({command: 'selection_previous'}),
next_url: gadget.getUrlFor({command: 'selection_next'}),
tab_url: gadget.getUrlFor({command: 'change', options: {page: "tab"}}),
export_url: gadget.state.erp5_document._links.action_object_report_jio ?
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {editable: true}}),
gadget.getUrlFor({command: 'change', options: {page: "action"}}),
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: 'change', options: {page: "tab"}}),
gadget.state.erp5_document._links.action_object_report_jio ?
gadget.getUrlFor({command: 'change', options: {page: "export"}}) :
"",
page_title: calculatePageTitle(gadget, gadget.state.erp5_document)
});
calculatePageTitle(gadget, gadget.state.erp5_document)
]);
})
.push(function (header_options) {
return gadget.updateHeader(header_options);
.push(function (all_result) {
return gadget.updateHeader({
edit_url: all_result[0],
actions_url: all_result[1],
selection_url: all_result[2],
previous_url: all_result[3],
next_url: all_result[4],
tab_url: all_result[5],
export_url: all_result[6],
page_title: all_result[7]
});
})
.push(function () {
// set locale for momentjs
......
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1540790153.05</float>
<float>1539946621.33</float>
<string>GMT+9</string>
</tuple>
</state>
......
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