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
Xiaowu Zhang
erp5
Commits
81eca52d
Commit
81eca52d
authored
Feb 19, 2016
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: listbox in list_mode and form_view should be displayed as non editable
parent
1c81ac54
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
297 additions
and
30 deletions
+297
-30
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_datetimefield_js.xml
...Item/web_page_module/rjs_gadget_erp5_datetimefield_js.xml
+7
-4
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_floatfield_js.xml
...ateItem/web_page_module/rjs_gadget_erp5_floatfield_js.xml
+6
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_integerfield_js.xml
...eItem/web_page_module/rjs_gadget_erp5_integerfield_js.xml
+6
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+37
-9
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listfield_js.xml
...lateItem/web_page_module/rjs_gadget_erp5_listfield_js.xml
+6
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
...teItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
+7
-5
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEditNotIndexedDocument.xml
.../renderjs_ui_listbox_zuite/testEditNotIndexedDocument.xml
+4
-4
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testListboxInNoEditableMode.xml
...renderjs_ui_listbox_zuite/testListboxInNoEditableMode.xml
+224
-0
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_datetimefield_js.xml
View file @
81eca52d
...
...
@@ -103,7 +103,7 @@
/*global window, rJS, RSVP, document, loopEventListener */\n
/*jslint indent: 2 */\n
(function (window, rJS, RSVP) {\n
(function (window, rJS, RSVP
, document, loopEventListener
) {\n
"use strict";\n
rJS(window)\n
.ready(function (gadget) {\n
...
...
@@ -115,6 +115,9 @@
})\n
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareAcquiredMethod("notifyValid", "notifyValid")\n
.declareMethod(\'getTextContent\', function () {\n
return this.element.querySelector(\'input\').getAttribute(\'value\') || "";\n
})\n
.declareMethod(\'render\', function (options) {\n
var input = this.element.querySelector(\'input\'),\n
date,\n
...
...
@@ -379,7 +382,7 @@
);\n
});\n
\n
}(window, rJS, RSVP));
}(window, rJS, RSVP
, document, loopEventListener
));
]]>
</string>
</value>
</item>
...
...
@@ -516,7 +519,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
3.49747.10334.23005
</string>
</value>
<value>
<string>
94
9.15487.9675.47530
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -534,7 +537,7 @@
</tuple>
<state>
<tuple>
<float>
14
34544511.89
</float>
<float>
14
55899218.47
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_floatfield_js.xml
View file @
81eca52d
...
...
@@ -114,6 +114,9 @@
.declareAcquiredMethod("notifyValid", "notifyValid")\n
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareAcquiredMethod("notifyChange", "notifyChange")\n
.declareMethod(\'getTextContent\', function () {\n
return this.element.querySelector(\'input\').getAttribute(\'value\');\n
})\n
.declareMethod(\'render\', function (options) {\n
var input = this.element.querySelector(\'input\'),\n
step = 0.00000001,\n
...
...
@@ -319,7 +322,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
xiaowu
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -333,7 +336,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
0.63306.33653.13909
</string>
</value>
<value>
<string>
94
9.15478.31551.48810
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -351,7 +354,7 @@
</tuple>
<state>
<tuple>
<float>
14
23907635.25
</float>
<float>
14
55899205.51
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_integerfield_js.xml
View file @
81eca52d
...
...
@@ -114,6 +114,9 @@
.declareAcquiredMethod("notifyValid", "notifyValid")\n
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareAcquiredMethod("notifyChange", "notifyChange")\n
.declareMethod(\'getTextContent\', function () {\n
return this.element.querySelector(\'input\').getAttribute(\'value\');\n
})\n
.declareMethod(\'render\', function (options) {\n
var input = this.element.querySelector(\'input\'),\n
field_json = options.field_json || {};\n
...
...
@@ -313,7 +316,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
xiaowu
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -327,7 +330,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
0.60759.64011.774
8
</string>
</value>
<value>
<string>
94
9.15479.42024.2153
8
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -345,7 +348,7 @@
</tuple>
<state>
<tuple>
<float>
14
23754481.36
</float>
<float>
14
55899193.71
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
81eca52d
...
...
@@ -173,17 +173,45 @@
gadget.props.listbox_uid_dict = {};\n
gadget.props.cell_gadget_list = [];\n
function renderSubCell(element, sub_field_json) {\n
return gadget.getFieldTypeGadgetUrl(sub_field_json.type)\n
var options = {},\n
queue;\n
sub_field_json.editable = sub_field_json.editable && gadget.props.field_json.editable; // XXX \n
queue = gadget.getFieldTypeGadgetUrl(sub_field_json.type);\n
queue\n
.push(function (gadget_url) {\n
return gadget.declareGadget(gadget_url, {\n
if (sub_field_json.editable) {\n
options = {\n
element: element\n
});\n
};\n
}\n
return gadget.declareGadget(gadget_url, options);\n
})\n
.push(function (cell_gadget) {\n
if (sub_field_json.editable) {\n
gadget.props.cell_gadget_list.push(cell_gadget);\n
sub_field_json.editable = sub_field_json.editable && gadget.props.field_json.editable; // XXX \n
} else {\n
if (cell_gadget.getTextContent) {\n
queue\n
.push(function () {\n
return cell_gadget.getTextContent();\n
})\n
.push(function (text_content) {\n
var text = document.createTextNode(text_content);\n
element.appendChild(text);\n
});\n
} else {\n
queue\n
.push(function () {\n
return cell_gadget.getElement();\n
})\n
.push(function (cell_element) {\n
element.appendChild(cell_element);\n
});\n
}\n
}\n
return cell_gadget.render({field_json: sub_field_json});\n
});\n
return queue;\n
}\n
for (i = 0; i < element_list.length; i += 1) {\n
column = element_list[i].getAttribute("column");\n
...
...
@@ -498,7 +526,7 @@
value = result.data.rows[i].value[field_json.column_list[j][0]] || "";\n
tr_value.push({\n
"type": value.type,\n
"editable": value.editable,\n
"editable": value.editable
&& field_json.editable
,\n
"href": tmp_url,\n
"text": value,\n
"line": i,\n
...
...
@@ -843,7 +871,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
949.16
491.61409.54647
</string>
</value>
<value>
<string>
949.16
516.37897.4249
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -861,7 +889,7 @@
</tuple>
<state>
<tuple>
<float>
14558
84364.3
2
</float>
<float>
14558
99151.1
2
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listfield_js.xml
View file @
81eca52d
...
...
@@ -134,6 +134,10 @@
.declareAcquiredMethod("translateHtml", "translateHtml")\n
.declareAcquiredMethod("notifyValid", "notifyValid")\n
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareMethod(\'getTextContent\', function () {\n
var select = this.element.querySelector(\'select\');\n
return select.options[select.selectedIndex || 0].text;\n
})\n
.declareMethod(\'render\', function (options) {\n
var i,\n
template,\n
...
...
@@ -357,7 +361,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
0.49457.43407.46148
</string>
</value>
<value>
<string>
94
9.15483.53582.15957
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -375,7 +379,7 @@
</tuple>
<state>
<tuple>
<float>
14
23135404.4
6
</float>
<float>
14
55899167.9
6
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
View file @
81eca52d
...
...
@@ -115,7 +115,9 @@
.declareAcquiredMethod("notifyValid", "notifyValid")\n
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareAcquiredMethod("notifyChange", "notifyChange")\n
\n
.declareMethod(\'getTextContent\', function () {\n
return this.element.querySelector(\'input\').getAttribute(\'value\');\n
})\n
.declareMethod(\'render\', function (options) {\n
var input = this.element.querySelector(\'input\'),\n
field_json = options.field_json || {};\n
...
...
@@ -317,7 +319,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
romain
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -331,7 +333,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
37.64311.60842.27084
</string>
</value>
<value>
<string>
9
49.15479.27859.47018
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -349,8 +351,8 @@
</tuple>
<state>
<tuple>
<float>
14
12257626.39
</float>
<string>
GMT
</string>
<float>
14
55899182.71
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEditNotIndexedDocument.xml
View file @
81eca52d
...
...
@@ -180,15 +180,15 @@
</tr>
\n
\n
<tr>
\n
<td>
waitFor
Elemen
tPresent
</td>
\n
<td>
//input[@title="listbox_start_date"]
</td>
\n
<td>
waitFor
Tex
tPresent
</td>
\n
<td>
2022-12-21
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
verifyValue
</td>
\n
<td>
//input[@title="listbox_start_date"]
</td>
\n
<td>
waitForTextPresent
</td>
\n
<td>
2022-12-21
</td>
\n
<td></td>
\n
</tr>
\n
\n
</tbody></table>
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testListboxInNoEditableMode.xml
0 → 100644
View file @
81eca52d
<?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
<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
\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>
waitForTextPresent
</td>
\n
<td>
1
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
verifyTextPresent
</td>
\n
<td>
1
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
verifyElementNotPresent
</td>
\n
<td>
//input[@title="listbox_start_date"]
</td>
\n
<td></td>
\n
</tr>
\n
\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>
testListboxInNoEditableMode
</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>
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