Commit c12ac82c authored by Tomáš Peterka's avatar Tomáš Peterka Committed by Tomáš Peterka

[renderjs_ui] Workflow (Form Dialog) is always in editable state

/reviewed-on nexedi/erp5!381
parent ef6ca76d
...@@ -62,7 +62,8 @@ ...@@ -62,7 +62,8 @@
rJS(window) rJS(window)
.setState({ .setState({
title: "" title: "",
editable: true // dialogs are always in editable mode
}) })
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// acquisition // acquisition
...@@ -101,16 +102,15 @@ ...@@ -101,16 +102,15 @@
}) })
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var state_dict = { // copy out wanted items from options and pass it to `changeState`
return this.changeState({
jio_key: options.jio_key, jio_key: options.jio_key,
view: options.view, view: options.view,
editable: options.editable, // ignore options.editable because dialog is always editable
erp5_document: options.erp5_document, erp5_document: options.erp5_document,
form_definition: options.form_definition, form_definition: options.form_definition,
erp5_form: options.erp5_form || {} erp5_form: options.erp5_form || {}
}; });
return this.changeState(state_dict);
}) })
.onStateChange(function () { .onStateChange(function () {
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
.push(function (erp5_form) { .push(function (erp5_form) {
var form_options = form_gadget.state.erp5_form; var form_options = form_gadget.state.erp5_form;
// <span class="ui-icon ui-icon-custom ui-icon-random">&nbsp;</span> // pass own form options to the embedded form
form_options.erp5_document = form_gadget.state.erp5_document; form_options.erp5_document = form_gadget.state.erp5_document;
form_options.form_definition = form_gadget.state.form_definition; form_options.form_definition = form_gadget.state.form_definition;
form_options.view = form_gadget.state.view; form_options.view = form_gadget.state.view;
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.59533.60499.59221</string> </value> <value> <string>961.62321.34764.37614</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>1504701037.67</float> <float>1504874104.04</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testFormDialogWorkflowAlwaysEditable</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<!-- Workflow action always shows editable form dialog.
- access a document in NONeditable mode
- any workflow action must be editable
-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Form View Editable Save Action</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Default Module View</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<tr>
<td>store</td>
<td>${base_url}/web_site_module/renderjs_runner</td>
<td>renderjs_url</td>
</tr>
<tr>
<td>open</td>
<td>${renderjs_url}/#/foo_module/1</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Actions']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Actions']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Dummy Workflow Action']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Dummy Workflow Action']</td>
<td></td>
</tr>
<!-- Wait for gadget to be loaded -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_dialog.html']//textarea</td>
<td></td>
</tr>
<!-- Textarea must be editable -->
<tr>
<td>type</td>
<td>//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_dialog.html']//textarea</td>
<td>QWERTY</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_dialog.html']//input[@type='submit']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Status changed.</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
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