From bb95152c7a526a3a3bc9016169488e09391f8378 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Tue, 5 Jan 2016 16:01:31 +0000
Subject: [PATCH] [erp5_web_renderjs_ui] Router: add a reload command to force
 redisplaying the current page

---
 .../rjs_gadget_erp5_router_js.xml               | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.xml b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.xml
index eac9b89f6c..4991eebaa3 100644
--- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.xml
+++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.xml
@@ -129,6 +129,7 @@
     COMMAND_DISPLAY_STATE = "display",\n
     COMMAND_LOGIN = "login",\n
     COMMAND_RAW = "raw",\n
+    COMMAND_RELOAD = "reload",\n
     COMMAND_DISPLAY_STORED_STATE = "display_stored_state",\n
     COMMAND_CHANGE_STATE = "change",\n
     COMMAND_STORE_AND_CHANGE_STATE = "store_and_change",\n
@@ -150,6 +151,7 @@
   VALID_URL_COMMAND_DICT[COMMAND_PUSH_HISTORY] = null;\n
   VALID_URL_COMMAND_DICT[COMMAND_LOGIN] = null;\n
   VALID_URL_COMMAND_DICT[COMMAND_RAW] = null;\n
+  VALID_URL_COMMAND_DICT[COMMAND_RELOAD] = null;\n
 \n
 \n
   function endsWith(str, suffix) {\n
@@ -595,6 +597,14 @@
         return execDisplayCommand(gadget, previous_options);\n
       });\n
   }\n
+\n
+  function execReloadCommand(previous_options) {\n
+    var jio_key = previous_options.jio_key;\n
+    delete previous_options.jio_key;\n
+    return synchronousChangeState(\n
+      getDisplayUrlFor(jio_key, previous_options)\n
+    );\n
+  }\n
 \n
   //////////////////////////////////////////////////////////////////\n
   // Command URL functions\n
@@ -729,6 +739,9 @@
     if (command_options.path === COMMAND_LOGIN) {\n
       return execLoginCommand(gadget, previous_options, next_options);\n
     }\n
+    if (command_options.path === COMMAND_RELOAD) {\n
+      return execReloadCommand(previous_options);\n
+    }\n
     throw new Error(\'Unsupported command \' + command_options.path);\n
 \n
   }\n
@@ -1046,7 +1059,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>947.43761.4655.1297</string> </value>
+                <value> <string>948.17471.24428.20411</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -1064,7 +1077,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1449754197.93</float>
+                        <float>1452009629.86</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
-- 
2.30.9