From cf26c8fda042112bb6a53bacddb08f5547cb6c95 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Thu, 3 Jan 2019 08:48:23 +0000
Subject: [PATCH] [erp5_web_renderjs_ui] HAL style does not return templated
 URL for action

See https://lab.nexedi.com/nexedi/erp5/commit/9dcbc756f772fdf4922681955021d96626eca158
---
 .../rjs_gadget_erp5_page_action_js.js               | 13 ++++++-------
 .../rjs_gadget_erp5_page_action_js.xml              |  4 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.js b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.js
index 66f3ddc4cd..3cf305eb5f 100644
--- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.js
+++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.js
@@ -1,6 +1,6 @@
-/*global window, rJS, RSVP, Handlebars, UriTemplate, calculatePageTitle, ensureArray */
+/*global window, rJS, RSVP, Handlebars, calculatePageTitle, ensureArray */
 /*jslint nomen: true, indent: 2, maxerr: 3 */
-(function (window, rJS, RSVP, Handlebars, UriTemplate, calculatePageTitle, ensureArray) {
+(function (window, rJS, RSVP, Handlebars, calculatePageTitle, ensureArray) {
   "use strict";
 
   /////////////////////////////////////////////////////////////////
@@ -19,15 +19,14 @@
    * @param {Array} command_list - array of links obtained from ERP5 HATEOAS
    */
   function renderLinkList(gadget, title, icon, erp5_link_list) {
-    return gadget.getUrlParameter("extended_search")
-      .push(function (query) {
-        // obtain RJS links from ERP5 links
+    return new RSVP.Queue()
+      .push(function () {
         return RSVP.all(
           erp5_link_list.map(function (erp5_link) {
             return gadget.getUrlFor({
               "command": 'change',
               "options": {
-                "view": UriTemplate.parse(erp5_link.href).expand({query: query}),
+                "view": erp5_link.href,
                 "page": undefined
               }
             });
@@ -109,4 +108,4 @@
       return;
     });
 
-}(window, rJS, RSVP, Handlebars, UriTemplate, calculatePageTitle, ensureArray));
\ No newline at end of file
+}(window, rJS, RSVP, Handlebars, calculatePageTitle, ensureArray));
\ No newline at end of file
diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.xml b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.xml
index 9df3f9bb49..4c0c235139 100644
--- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.xml
+++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.xml
@@ -230,7 +230,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>970.5224.10569.36898</string> </value>
+                <value> <string>972.48331.62264.17646</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -248,7 +248,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1536227065.3</float>
+                        <float>1546505106.65</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
-- 
2.30.9