Commit cf26c8fd authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] HAL style does not return templated URL for action

See 9dcbc756
parent 707058d7
/*global window, rJS, RSVP, Handlebars, UriTemplate, calculatePageTitle, ensureArray */ /*global window, rJS, RSVP, Handlebars, calculatePageTitle, ensureArray */
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars, UriTemplate, calculatePageTitle, ensureArray) { (function (window, rJS, RSVP, Handlebars, calculatePageTitle, ensureArray) {
"use strict"; "use strict";
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
...@@ -19,15 +19,14 @@ ...@@ -19,15 +19,14 @@
* @param {Array} command_list - array of links obtained from ERP5 HATEOAS * @param {Array} command_list - array of links obtained from ERP5 HATEOAS
*/ */
function renderLinkList(gadget, title, icon, erp5_link_list) { function renderLinkList(gadget, title, icon, erp5_link_list) {
return gadget.getUrlParameter("extended_search") return new RSVP.Queue()
.push(function (query) { .push(function () {
// obtain RJS links from ERP5 links
return RSVP.all( return RSVP.all(
erp5_link_list.map(function (erp5_link) { erp5_link_list.map(function (erp5_link) {
return gadget.getUrlFor({ return gadget.getUrlFor({
"command": 'change', "command": 'change',
"options": { "options": {
"view": UriTemplate.parse(erp5_link.href).expand({query: query}), "view": erp5_link.href,
"page": undefined "page": undefined
} }
}); });
...@@ -109,4 +108,4 @@ ...@@ -109,4 +108,4 @@
return; return;
}); });
}(window, rJS, RSVP, Handlebars, UriTemplate, calculatePageTitle, ensureArray)); }(window, rJS, RSVP, Handlebars, calculatePageTitle, ensureArray));
\ No newline at end of file \ No newline at end of file
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>970.5224.10569.36898</string> </value> <value> <string>972.48331.62264.17646</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>1536227065.3</float> <float>1546505106.65</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