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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
erp5
Commits
40848b9e
Commit
40848b9e
authored
Sep 21, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Oct 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] Dialog Form does not mingle with global "editable" state
parent
af7f4b91
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
207 additions
and
23 deletions
+207
-23
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_html.html
.../web_page_module/rjs_gadget_erp5_pt_form_dialog_html.html
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_html.xml
...m/web_page_module/rjs_gadget_erp5_pt_form_dialog_html.xml
+2
-2
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
+9
-12
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/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_embedded.js.js
...b_page_module/rjs_gadget_erp5_pt_form_view_embedded.js.js
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_embedded.js.xml
..._page_module/rjs_gadget_erp5_pt_form_view_embedded.js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
+3
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
+2
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogWorkflowAlwaysEditable.zpt
..._templates_zuite/testFormDialogWorkflowAlwaysEditable.zpt
+22
-1
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewEditablePersistent.xml
...i_page_templates_zuite/testFormViewEditablePersistent.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewEditablePersistent.zpt
...i_page_templates_zuite/testFormViewEditablePersistent.zpt
+105
-0
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_html.html
View file @
40848b9e
...
...
@@ -5,6 +5,7 @@
data-i18n=You do not have the permissions to edit the object
data-i18n=Document was not saved! Resubmit when you are online or the document accessible
data-i18n=Encountered an unknown error. Try to resubmit
data-i18n=Data received
-->
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_html.xml
View file @
40848b9e
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
960.5
523.58984.43537
</string>
</value>
<value>
<string>
960.5
6020.52206.40328
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1
499432111.39
</float>
<float>
1
505912615.0
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
View file @
40848b9e
...
...
@@ -12,10 +12,6 @@
rJS
(
window
)
.
setState
({
title
:
""
,
editable
:
true
// dialogs are always in editable mode
})
/////////////////////////////////////////////////////////////////
// acquisition
/////////////////////////////////////////////////////////////////
...
...
@@ -59,7 +55,8 @@
// ignore options.editable because dialog is always editable
erp5_document
:
options
.
erp5_document
,
form_definition
:
options
.
form_definition
,
erp5_form
:
options
.
erp5_form
||
{}
erp5_form
:
options
.
erp5_form
||
{},
// ignore global editable state (be always editable)
});
})
...
...
@@ -123,7 +120,7 @@
form_options
.
form_definition
=
form_gadget
.
state
.
form_definition
;
form_options
.
view
=
form_gadget
.
state
.
view
;
form_options
.
jio_key
=
form_gadget
.
state
.
jio_key
;
form_options
.
editable
=
form_gadget
.
state
.
editable
;
form_options
.
editable
=
true
;
// dialog is always editable
return
erp5_form
.
render
(
form_options
);
})
...
...
@@ -241,8 +238,8 @@
options
:
{
"
jio_key
"
:
jio_key
,
"
view
"
:
"
view
"
,
"
page
"
:
undefined
,
"
editable
"
:
form_gadget
.
state
.
editable
"
page
"
:
undefined
// do not mingle with editable because it isn't necessary
}
});
}
...
...
@@ -250,8 +247,8 @@
return
form_gadget
.
redirect
({
command
:
'
push_history
'
,
options
:
{
"
jio_key
"
:
jio_key
,
"
editable
"
:
form_gadget
.
state
.
editable
"
jio_key
"
:
jio_key
// do not mingle with editable because it isn't necessary
}
});
});
...
...
@@ -263,7 +260,7 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
form_gadget
.
notifySubmitted
({
"
message
"
:
"
Data received
.
"
,
"
message
"
:
"
Data received
"
,
"
status
"
:
"
success
"
});
})
...
...
@@ -280,7 +277,7 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
form_gadget
.
notifySubmitted
({
"
message
"
:
"
Data received
.
"
,
"
message
"
:
"
Data received
"
,
"
status
"
:
"
success
"
});
})
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
View file @
40848b9e
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
962.1
2762.25157.20224
</string>
</value>
<value>
<string>
962.1
5378.64583.40345
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
1505
826868.64
</float>
<float>
1505
984600.8
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_embedded.js.js
View file @
40848b9e
...
...
@@ -5,6 +5,7 @@
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Proxy methods to the child gadget
/////////////////////////////////////////////////////////////////
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_embedded.js.xml
View file @
40848b9e
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
961.
16458.28534.25173
</string>
</value>
<value>
<string>
961.
56888.60131.33518
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
150
2116475.56
</float>
<float>
150
4617145.02
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
View file @
40848b9e
...
...
@@ -77,8 +77,9 @@
form_options
.
form_definition
=
gadget
.
state
.
form_definition
;
form_options
.
view
=
gadget
.
state
.
view
;
form_options
.
jio_key
=
gadget
.
state
.
jio_key
;
form_options
.
editable
=
0
;
form_options
.
editable
=
0
;
// because for editable=1 there is a special
// page template 'pt_form_editable'. Once it is
// is removed, this 0 should turn into gadget.state.editable
return
erp5_form
.
render
(
form_options
);
})
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
View file @
40848b9e
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
961.
16419.13605.17578
</string>
</value>
<value>
<string>
961.
60785.60114.8243
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
150
2116554.64
</float>
<float>
150
4874056.9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogWorkflowAlwaysEditable.zpt
View file @
40848b9e
...
...
@@ -4,7 +4,8 @@
<!-- Workflow action always shows editable form dialog.
- access a document in NONeditable mode
- any workflow action must be editable
- any workflow action must(form dialog) be editable
- document must remain in previous (NONeditable) mode
-->
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test Form View Editable Save Action
</title>
...
...
@@ -25,6 +26,16 @@
<td>
${renderjs_url}/#/foo_module/1
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view.html']
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view_editable.html']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//a[text()='Actions']
</td>
...
...
@@ -67,6 +78,16 @@
<td>
Status changed.
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view.html']
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view_editable.html']
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewEditablePersistent.xml
0 → 100644
View file @
40848b9e
<?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>
testFormViewEditablePersistent
</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/testFormViewEditablePersistent.zpt
0 → 100644
View file @
40848b9e
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<!-- Editable form remains editable even after
- unsuccessful save
- sucessful save
- issued action
-->
<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?editable=true
</td><td></td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view_editable.html']
</td><td></td></tr>
<tr><td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view.html']
</td><td></td></tr>
<!-- Unsuccessful save does not mingle with editability -->
<tr><td>
waitForElementPresent
</td>
<td>
//input[@name='field_my_foo_category_title']
</td><td></td></tr>
<tr><td>
type
</td>
<td>
//input[@name='field_my_foo_category_title']
</td>
<td>
QWERTY
</td></tr>
<tr><td>
fireEvent
</td>
<td>
//input[@name='field_my_foo_category_title']
</td>
<td>
input
</td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit']
</td><td></td></tr>
<tr><td>
click
</td>
<td>
//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit']
</td><td></td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr><td>
waitForTextPresent
</td>
<td>
Input data has errors.
</td><td></td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view_editable.html']
</td><td></td></tr>
<tr><td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view.html']
</td><td></td></tr>
<!-- Successful save does not mingle with editability -->
<tr><td>
waitForElementPresent
</td>
<td>
//input[@name='field_my_foo_category_title']
</td><td></td></tr>
<tr><td>
type
</td>
<td>
//input[@name='field_my_foo_category_title']
</td>
<td></td></tr>
<tr><td>
fireEvent
</td>
<td>
//input[@name='field_my_foo_category_title']
</td>
<td>
input
</td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//input[@name='field_my_title']
</td><td></td></tr>
<tr><td>
type
</td>
<td>
field_my_title
</td>
<td>
QWERTY
</td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit']
</td><td></td></tr>
<tr><td>
click
</td>
<td>
//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit']
</td><td></td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr><td>
waitForTextPresent
</td>
<td>
Data updated.
</td><td></td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view_editable.html']
</td><td></td></tr>
<tr><td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view.html']
</td><td></td></tr>
<!-- Passing through action does not mingle with editability -->
<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>
<tr><td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view_editable.html']
</td><td></td></tr>
<tr><td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-url='${renderjs_url}/gadget_erp5_pt_form_view.html']
</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