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 @@ ...@@ -92,23 +92,18 @@
if (modification_dict.hasOwnProperty("global")) { if (modification_dict.hasOwnProperty("global")) {
queue queue
.push(function () { .push(function () {
return RSVP.all([ return RSVP.hash({
context.getUrlFor({command: 'display', options: {page: "supportrequest_preference"}}), preference_href: context.getUrlFor({command: 'display', options: {page: "supportrequest_preference"}}),
context.getUrlFor({command: 'display', options: {page: "logout"}}), logout_href: context.getUrlFor({command: 'display', options: {page: "logout"}}),
context.getUrlFor({command: 'display', options: {page: "search"}}), search_href: context.getUrlFor({command: 'display', options: {page: "search"}}),
context.getUrlFor({command: 'display', options: {jio_key: "support_request_module", page: "list"}}) 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! // XXX: Customize panel header!
return context.translateHtml( return context.translateHtml(
panel_template_header() + panel_template_header() +
panel_template_body({ panel_template_body(panel_options)
"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) { .push(function (my_translated_or_plain_html) {
......
...@@ -252,8 +252,8 @@ ...@@ -252,8 +252,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1523022102.41</float> <float>1540789939.84</float>
<string>GMT+2</string> <string>GMT+9</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
...@@ -125,34 +125,24 @@ ...@@ -125,34 +125,24 @@
element.classList.remove('ui-disabled'); element.classList.remove('ui-disabled');
}); });
}) })
// render the header // render the header
.push(function () { .push(function () {
return RSVP.all([ return RSVP.hash({
gadget.getUrlFor({command: 'change', options: {editable: true}}), edit_url: gadget.getUrlFor({command: 'change', options: {editable: true}}),
gadget.getUrlFor({command: 'change', options: {page: "action"}}), actions_url: gadget.getUrlFor({command: 'change', options: {page: "action"}}),
gadget.getUrlFor({command: 'history_previous'}), selection_url: gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}), previous_url: gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}), next_url: gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: 'change', options: {page: "tab"}}), tab_url: gadget.getUrlFor({command: 'change', options: {page: "tab"}}),
gadget.state.erp5_document._links.action_object_report_jio ? export_url: gadget.state.erp5_document._links.action_object_report_jio ?
gadget.getUrlFor({command: 'change', options: {page: "export"}}) : gadget.getUrlFor({command: 'change', options: {page: "export"}}) :
"", "",
calculatePageTitle(gadget, gadget.state.erp5_document) page_title: 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]
}); });
}) })
.push(function (header_options) {
return gadget.updateHeader(header_options);
})
.push(function () { .push(function () {
// set locale for momentjs // set locale for momentjs
return gadget.getSettingList(["selected_language", return gadget.getSettingList(["selected_language",
......
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1539946621.33</float> <float>1540790153.05</float>
<string>GMT+9</string> <string>GMT+9</string>
</tuple> </tuple>
</state> </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