Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yoji Takeuchi
erp5
Commits
c12ac82c
Commit
c12ac82c
authored
Sep 08, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Sep 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] Workflow (Form Dialog) is always in editable state
/reviewed-on
nexedi/erp5!381
parent
ef6ca76d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
139 additions
and
9 deletions
+139
-9
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
...Item/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
+7
-7
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
...tem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
+2
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogWorkflowAlwaysEditable.xml
..._templates_zuite/testFormDialogWorkflowAlwaysEditable.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogWorkflowAlwaysEditable.zpt
..._templates_zuite/testFormDialogWorkflowAlwaysEditable.zpt
+72
-0
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
View file @
c12ac82c
...
...
@@ -62,7 +62,8 @@
rJS
(
window
)
.
setState
({
title
:
""
title
:
""
,
editable
:
true
// dialogs are always in editable mode
})
/////////////////////////////////////////////////////////////////
// acquisition
...
...
@@ -101,16 +102,15 @@
})
.
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
,
view
:
options
.
view
,
editable
:
options
.
editable
,
// ignore options.editable because dialog is always editable
erp5_document
:
options
.
erp5_document
,
form_definition
:
options
.
form_definition
,
erp5_form
:
options
.
erp5_form
||
{}
};
return
this
.
changeState
(
state_dict
);
});
})
.
onStateChange
(
function
()
{
...
...
@@ -168,7 +168,7 @@
.
push
(
function
(
erp5_form
)
{
var
form_options
=
form_gadget
.
state
.
erp5_form
;
//
<span class="ui-icon ui-icon-custom ui-icon-random"> </span>
//
pass own form options to the embedded form
form_options
.
erp5_document
=
form_gadget
.
state
.
erp5_document
;
form_options
.
form_definition
=
form_gadget
.
state
.
form_definition
;
form_options
.
view
=
form_gadget
.
state
.
view
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
View file @
c12ac82c
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
961.
59533.60499.59221
</string>
</value>
<value>
<string>
961.
62321.34764.37614
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
1504
701037.67
</float>
<float>
1504
874104.04
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogWorkflowAlwaysEditable.xml
0 → 100644
View file @
c12ac82c
<?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>
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogWorkflowAlwaysEditable.zpt
0 → 100644
View file @
c12ac82c
<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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment