Commit 6a15f010 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: available to clone document

parent eca32661
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_clone_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>clone_document</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>102.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Clone Document</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_viewCloneDocumentDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: (getattr(object, \'getParentValue\', None) is not None) and (object.getPortalType() not in portal.getPortalModuleTypeList()) and (portal.Base_checkPermission(object.getParentValue().getRelativeUrl(), \'Add portal content\')) and (object.getPortalType() in object.getParentValue().getVisibleAllowedContentTypeList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_createCloneDocument</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list>
<string>[]</string>
</list>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>your_warning</string>
<string>your_portal_type</string>
<string>your_title</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewCloneDocumentDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_viewCloneDocumentDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Clone Document</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -754,8 +754,9 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -754,8 +754,9 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
# Try to embed the form in the result\n # Try to embed the form in the result\n
if (view == view_action[\'id\']):\n if (view == view_action[\'id\']):\n
embedded_url = \'%s\' % view_action[\'url\']\n embedded_url = \'%s\' % view_action[\'url\']\n
\n \n
if (erp5_action_key in (view_action_type, "view", "workflow", "object_new_content_action")):\n if erp5_action_key in (view_action_type, "view", "workflow", "object_new_content_action", "object_clone_action"):\n
\n
erp5_action_list[-1][\'href\'] = url_template_dict["traverse_generator"] % {\n erp5_action_list[-1][\'href\'] = url_template_dict["traverse_generator"] % {\n
"root_url": site_root.absolute_url(),\n "root_url": site_root.absolute_url(),\n
"script_id": script.id,\n "script_id": script.id,\n
......
portal_actions | clone_document
portal_actions | create_a_document portal_actions | create_a_document
\ No newline at end of file
...@@ -137,6 +137,17 @@ ...@@ -137,6 +137,17 @@
{{/each}}\n {{/each}}\n
</ul>\n </ul>\n
\n \n
{{#if action}}\n
<section class="ui-content-header-plain">\n
<h3 class="ui-content-title ui-body-c" data-i18n="[last]{{section_i18n}}">\n
<span class="ui-icon ui-icon-custom ui-icon-random">&nbsp;</span>\n
{{section_title}}\n
</h3>\n
</section>\n
<ul data-role="listview" data-theme="c" data-inset="true" class="document-listview">\n
<li><a data-i18n="{{action.i18n}}" class="ui-body-inherit" href="{{action.link}}">{{action.title}}</a></li>\n
</ul>\n
{{/if}}\n
</script>\n </script>\n
\n \n
</head>\n </head>\n
...@@ -265,7 +276,7 @@ ...@@ -265,7 +276,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>super_sven</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -279,7 +290,7 @@ ...@@ -279,7 +290,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>939.43978.9403.31744</string> </value> <value> <string>949.6674.56490.63948</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -297,8 +308,8 @@ ...@@ -297,8 +308,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1419266049.54</float> <float>1455548880.29</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
...@@ -148,6 +148,7 @@ ...@@ -148,6 +148,7 @@
var gadget = this,\n var gadget = this,\n
erp5_document,\n erp5_document,\n
result_list,\n result_list,\n
action,\n
view_list;\n view_list;\n
\n \n
return gadget.jio_getAttachment(options.jio_key, "links")\n return gadget.jio_getAttachment(options.jio_key, "links")\n
...@@ -167,6 +168,17 @@ ...@@ -167,6 +168,17 @@
for (i = 0; i < view_list.length; i += 1) {\n for (i = 0; i < view_list.length; i += 1) {\n
promise_list.push(gadget.getUrlFor({command: \'change\', options: {view: view_list[i].href, page: undefined, editable: undefined}}));\n promise_list.push(gadget.getUrlFor({command: \'change\', options: {view: view_list[i].href, page: undefined, editable: undefined}}));\n
}\n }\n
if (erp5_document._links.action_object_clone_action) {\n
view_list.push(erp5_document._links.action_object_clone_action);\n
promise_list.push(gadget.getUrlFor({\n
command: \'change\',\n
options: {\n
view: erp5_document._links.action_object_clone_action.href,\n
page: undefined,\n
editable: true\n
}\n
}));\n
}\n
return RSVP.all(promise_list);\n return RSVP.all(promise_list);\n
})\n })\n
.push(function (all_result) {\n .push(function (all_result) {\n
...@@ -182,11 +194,16 @@ ...@@ -182,11 +194,16 @@
i18n: view_list[i - 2].title\n i18n: view_list[i - 2].title\n
});\n });\n
}\n }\n
\n if (erp5_document._links.action_object_clone_action) {\n
action = tab_list.pop();\n
}\n
return gadget.translateHtml(table_template({\n return gadget.translateHtml(table_template({\n
definition_title: "Workflow Transitions",\n definition_title: "Workflow Transitions",\n
documentlist: tab_list,\n documentlist: tab_list,\n
definition_i18n: "Workflow-Transitions"\n definition_i18n: "Workflow-Transitions",\n
section_i18n: "Actions",\n
section_title: "Actions",\n
action: action\n
}));\n }));\n
})\n })\n
.push(function (my_translated_html) {\n .push(function (my_translated_html) {\n
...@@ -323,7 +340,7 @@ ...@@ -323,7 +340,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>romain</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -337,7 +354,7 @@ ...@@ -337,7 +354,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>946.30039.19211.22562</string> </value> <value> <string>949.12503.60091.29166</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -355,8 +372,8 @@ ...@@ -355,8 +372,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1444985792.56</float> <float>1455643788.16</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
<?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>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">\n
<head>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
<title>Test RenderJS UI</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<!-- Clean Up -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/bar_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<!-- Initialize -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Add\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>link=Add</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>select</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td>label=Foo</td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n="Add"]</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n="Add"]</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>link=Add</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>select</td>\n
<td>//select[@name=\'field_your_portal_type\']</td>\n
<td>label=Foo Line</td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//button[@data-i18n=\'Save\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Back\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title="listbox_start_date"]</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@title="listbox_start_date"]</td>\n
<td>2022-12-21</td>\n
</tr>\n
\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@title="Short Title"]</td>\n
<td>test_clone</td>\n
</tr>\n
\n
\n
<tr>\n
<td>check</td>\n
<td>//input[@title="Frozen"]</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>select</td>\n
<td>//select[@name=\'field_my_local_title\']</td>\n
<td>label=First title</td>\n
</tr>\n
\n
\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@name=\'field_my_foo_category_title\']</td>\n
<td>a1</td>\n
</tr>\n
\n
<tr>\n
<td>fireEvent</td>\n
<td>//input[@name=\'field_my_foo_category_title\']</td>\n
<td>input</td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//li[@data-relative-url=\'portal_categories/foo_category/a/a1\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//li[@data-relative-url=\'portal_categories/foo_category/a/a1\']</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n="Tabs"]</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n="View"]</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n="View"]</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title="Short Title"]</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title="Short Title"]</td>\n
<td>test_clone</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@name=\'field_my_foo_category_title\']</td>\n
<td>a1</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title=\'Frozen\']</td>\n
<td>on</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//select[@name=\'field_my_local_title\']</td>\n
<td>First title</td>\n
</tr>\n
\n
<tr>\n
<td>storeValue</td>\n
<td>//input[@name=\'field_my_id\']</td>\n
<td>original_id</td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Actions\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//a[@data-i18n=\'Clone Document\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//a[@data-i18n=\'Clone Document\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Proceed\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title="Short Title"]</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyElementPresent</td>\n
<td>//button[@data-i18n="Save"]</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title="Short Title"]</td>\n
<td>test_clone</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@name=\'field_my_foo_category_title\']</td>\n
<td>a1</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title=\'Frozen\']</td>\n
<td>on</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//select[@name=\'field_my_local_title\']</td>\n
<td>First title</td>\n
</tr>\n
\n
<tr>\n
<td>verifyNotValue</td>\n
<td>//input[@name=\'field_my_id\']</td>\n
<td>original_id</td>\n
</tr>\n
\n
\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </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>testCloneDocument</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>
...@@ -136,7 +136,7 @@ else:\n ...@@ -136,7 +136,7 @@ else:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>clone=1, form_id=\'view\', web_mode=0, editable_mode=0, batch_mode=0</string> </value> <value> <string>clone=1, form_id=\'view\', web_mode=0, editable_mode=0, batch_mode=0, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
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