Commit 463855b6 authored by Jérome Perrin's avatar Jérome Perrin

officejs_support_request_ui: prefer RSVP.hash for readability

parent 00ab06d7
......@@ -92,23 +92,18 @@
if (modification_dict.hasOwnProperty("global")) {
queue
.push(function () {
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", page: "list"}})
]);
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", page: "list"}})
});
})
.push(function (result_list) {
.push(function (panel_options) {
// XXX: Customize panel header!
return context.translateHtml(
panel_template_header() +
panel_template_body({
"preference_href": result_list[0],
"logout_href": result_list[1],
"search_href": result_list[2],
"supportrequest_href": result_list[3]
})
panel_template_body(panel_options)
);
})
.push(function (my_translated_or_plain_html) {
......
......@@ -252,8 +252,8 @@
</tuple>
<state>
<tuple>
<float>1523022102.41</float>
<string>GMT+2</string>
<float>1540789939.84</float>
<string>GMT+9</string>
</tuple>
</state>
</object>
......
......@@ -125,34 +125,24 @@
element.classList.remove('ui-disabled');
});
})
// render the header
.push(function () {
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 ?
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 ?
gadget.getUrlFor({command: 'change', options: {page: "export"}}) :
"",
calculatePageTitle(gadget, gadget.state.erp5_document)
]);
})
.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]
page_title: calculatePageTitle(gadget, gadget.state.erp5_document)
});
})
.push(function (header_options) {
return gadget.updateHeader(header_options);
})
.push(function () {
// set locale for momentjs
return gadget.getSettingList(["selected_language",
......
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1539946621.33</float>
<float>1540790153.05</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