Commit 76a7427d authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Panel: use getUrlForList

Reduce number of acquire method call
parent 58295978
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
////////////////////////////////////////////// //////////////////////////////////////////////
// acquired method // acquired method
////////////////////////////////////////////// //////////////////////////////////////////////
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("translateHtml", "translateHtml") .declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("translate", "translate") .declareAcquiredMethod("translate", "translate")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
...@@ -162,14 +162,14 @@ ...@@ -162,14 +162,14 @@
queue queue
// Update the global links // Update the global links
.push(function () { .push(function () {
return RSVP.all([ return context.getUrlForList([
context.getUrlFor({command: 'display', options: {page: "front"}}), {command: 'display', options: {page: "front"}},
context.getUrlFor({command: 'display', options: {page: "history"}}), {command: 'display', options: {page: "history"}},
context.getUrlFor({command: 'display', options: {page: "preference"}}), {command: 'display', options: {page: "preference"}},
context.getUrlFor({command: 'display', options: {page: "logout"}}), {command: 'display', options: {page: "logout"}},
context.getUrlFor({command: 'display_stored_state', options: {page: "search"}}), {command: 'display_stored_state', options: {page: "search"}},
context.getUrlFor({command: 'display', options: {page: "worklist"}}), {command: 'display', options: {page: "worklist"}},
context.getUrlFor({command: 'display'}) {command: 'display'}
]); ]);
}) })
.push(function (result_list) { .push(function (result_list) {
...@@ -227,45 +227,39 @@ ...@@ -227,45 +227,39 @@
queue queue
.push(function () { .push(function () {
var i = 0, var i = 0,
promise_list = [], parameter_list = [],
workflow_list = JSON.parse(gadget.state.workflow_list), workflow_list = JSON.parse(gadget.state.workflow_list),
view_list = JSON.parse(gadget.state.view_list), view_list = JSON.parse(gadget.state.view_list),
action_list = JSON.parse(gadget.state.action_list); action_list = JSON.parse(gadget.state.action_list);
for (i = 0; i < workflow_list.length; i += 1) { for (i = 0; i < workflow_list.length; i += 1) {
promise_list.push( parameter_list.push({
gadget.getUrlFor({
command: 'change', command: 'change',
options: { options: {
view: workflow_list[i].href, view: workflow_list[i].href,
page: undefined page: undefined
} }
}) });
);
} }
for (i = 0; i < view_list.length; i += 1) { for (i = 0; i < view_list.length; i += 1) {
promise_list.push( parameter_list.push({
gadget.getUrlFor({
command: 'change', command: 'change',
options: { options: {
view: view_list[i].href, view: view_list[i].href,
page: undefined page: undefined
} }
}) });
);
} }
for (i = 0; i < action_list.length; i += 1) { for (i = 0; i < action_list.length; i += 1) {
promise_list.push( parameter_list.push({
gadget.getUrlFor({
command: 'change', command: 'change',
options: { options: {
view: action_list[i].href, view: action_list[i].href,
page: undefined page: undefined
} }
}) });
);
} }
return RSVP.all(promise_list); return gadget.getUrlForList(parameter_list);
}) })
.push(function (result_list) { .push(function (result_list) {
var i, var i,
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>968.5552.51560.44322</string> </value> <value> <string>971.19133.62867.18210</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1539942701.69</float> <float>1540909039.27</float>
<string>UTC</string> <string>UTC</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