Commit 0bce4239 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] When redirecting to parent, always try to restore the state

parent 670e37e1
...@@ -564,7 +564,9 @@ ...@@ -564,7 +564,9 @@
if (parent_link !== undefined) { if (parent_link !== undefined) {
uri = new URI(parent_link.href); uri = new URI(parent_link.href);
copyStickyParameterDict(previous_options, options); copyStickyParameterDict(previous_options, options);
return addNavigationHistoryAndDisplay(gadget, uri.segment(2), options); options.jio_key = uri.segment(2);
// When redirecting to parent, always try to restore the state
return execDisplayStoredStateCommand(gadget, options);
} }
}, function (error) { }, function (error) {
if ((error instanceof jIO.util.jIOError) && if ((error instanceof jIO.util.jIOError) &&
......
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>967.35176.12886.11639</string> </value> <value> <string>968.25647.25725.53981</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1526656132.45</float> <float>1529677697.42</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -11,21 +11,31 @@ ...@@ -11,21 +11,31 @@
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" /> <tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<!-- First, create a stored test on the module -->
<tr> <tr>
<td>open</td> <td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1</td> <td>${base_url}/web_site_module/renderjs_runner/#/foo_module?editable=true</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="search_query python: 'foobar'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<!-- Wait for gadget to be loaded --> <!-- Then, display a child document without any history -->
<tr><td>open</td>
<td>${base_url}/foo_module/Zuite_waitForActivities</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Done.</td><td></td></tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>open</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view.html']</td> <td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr> <tr>
<td>waitForTextPresent</td> <td>assertElementPresent</td>
<td>Title 1</td> <td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view.html']</td>
<td></td> <td></td>
</tr> </tr>
...@@ -40,16 +50,17 @@ ...@@ -40,16 +50,17 @@
<td>//div[@data-gadget-scope='header']//a[text()='Foo: Title 1' and contains(@href, '#!history_previous')]</td> <td>//div[@data-gadget-scope='header']//a[text()='Foo: Title 1' and contains(@href, '#!history_previous')]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_list.html']</td> <td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_list.html']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tal:block tal:define="parsed_query python: '';
<td>waitForTextPresent</td> search_query python: 'foobar'">
<td>Foos</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
<td></td> </tal:block>
</tr> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_non_editable_mode" />
</tbody></table> </tbody></table>
</body> </body>
......
...@@ -11,21 +11,31 @@ ...@@ -11,21 +11,31 @@
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" /> <tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<!-- First, create a stored test on the module -->
<tr> <tr>
<td>open</td> <td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?editable=true</td> <td>${base_url}/web_site_module/renderjs_runner/#/foo_module</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="search_query python: 'foobar'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<!-- Wait for gadget to be loaded --> <!-- Then, display a child document without any history -->
<tr><td>open</td>
<td>${base_url}/foo_module/Zuite_waitForActivities</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Done.</td><td></td></tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>open</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view_editable.html']</td> <td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?editable=true</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr> <tr>
<td>waitForTextPresent</td> <td>assertElementPresent</td>
<td>Title 1</td> <td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view_editable.html']</td>
<td></td> <td></td>
</tr> </tr>
...@@ -40,16 +50,17 @@ ...@@ -40,16 +50,17 @@
<td>//div[@data-gadget-scope='header']//a[text()='Foo: Title 1' and contains(@href, '#!history_previous')]</td> <td>//div[@data-gadget-scope='header']//a[text()='Foo: Title 1' and contains(@href, '#!history_previous')]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_list.html']</td> <td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_list.html']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tal:block tal:define="parsed_query python: '';
<td>waitForTextPresent</td> search_query python: 'foobar'">
<td>Foos</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
<td></td> </tal:block>
</tr> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_editable_mode" />
</tbody></table> </tbody></table>
</body> </body>
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module</td> <td>${base_url}/web_site_module/renderjs_runner/#/foo_module</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//a[@data-i18n='Add']</td> <td>//a[@data-i18n='Add']</td>
......
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