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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
erp5
Commits
4c9f95f7
Commit
4c9f95f7
authored
Jan 11, 2018
by
Tomáš Peterka
Committed by
Tomáš Peterka
Jan 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hal_json_style] Search (of ListBox) follows "editable_columns" while rendering
parent
b4f0d4b5
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
251 additions
and
6 deletions
+251
-6
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+18
-4
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/FooModule_viewFooList.xml
...eItem/portal_skins/erp5_ui_test/FooModule_viewFooList.xml
+1
-0
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/FooModule_viewFooList/listbox_modification_date.xml
..._test/FooModule_viewFooList/listbox_modification_date.xml
+84
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEditableFieldInEditableColumn.xml
...js_ui_listbox_zuite/testEditableFieldInEditableColumn.xml
+1
-1
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEditableFieldInEditableColumn.zpt
...js_ui_listbox_zuite/testEditableFieldInEditableColumn.zpt
+88
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.xml
...nderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.xml
+1
-1
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.zpt
...nderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.zpt
+0
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.xml
...ox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.zpt
...ox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.zpt
+0
-0
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
4c9f95f7
...
...
@@ -1409,17 +1409,17 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
field_name
=
"{}_{}"
.
format
(
listbox_field_id
,
select
.
replace
(
"."
,
"_"
))
if
listbox_form
.
has_field
(
field_name
,
include_disabled
=
1
):
editable_field_dict
[
select
]
=
listbox_form
.
get_field
(
field_name
,
include_disabled
=
1
)
#
check if proxy
fy
#
check if proxi
fy
if
source_field
.
meta_type
==
"ProxyField"
:
proxy_listbox_field_id
=
source_field
.
getRecursiveTemplateField
().
id
proxy_form
=
getattr
(
traversed_document
,
source_field
.
getRecursiveTemplateField
().
Base_aqInner
().
aq_parent
.
id
)
for
select
in
select_list
:
#
need also get editalb
e field from proxy form
#
need also get editabl
e field from proxy form
proxy_field_name
=
"{}_{}"
.
format
(
proxy_listbox_field_id
,
select
.
replace
(
"."
,
"_"
))
if
proxy_form
.
has_field
(
proxy_field_name
,
include_disabled
=
1
):
editable_field_dict
[
select
]
=
proxy_form
.
get_field
(
proxy_field_name
,
include_disabled
=
1
)
# handle the case when list-scripts are ignoring `limit` - paginate for them
if
limit
is
not
None
and
isinstance
(
limit
,
(
tuple
,
list
)):
start
,
num_items
=
map
(
int
,
limit
)
...
...
@@ -1511,6 +1511,20 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
if
source_field_meta_type
==
"ProxyField"
:
source_field_meta_type
=
source_field
.
getRecursiveTemplateField
().
meta_type
# Lets mingle with editability of fields here
# Original Listbox.py modifies editability during field rendering (method `render`)
# which we cannot use here so we overwrite result's own editability
if
source_field
is
not
None
and
source_field_meta_type
==
"ListBox"
:
# XXX TODO: should take into account "editable_columns" from listbox own selection
editable_column_set
=
set
(
name
for
name
,
_
in
source_field
.
get_value
(
"editable_columns"
))
for
line
in
result_dict
[
'_embedded'
][
'contents'
]:
for
select
in
line
:
# forbid editability only for fields not specified in editable_columns
if
select
in
editable_column_set
:
continue
if
isinstance
(
line
[
select
],
dict
)
and
line
[
select
].
get
(
'editable'
):
line
[
select
][
'editable'
]
=
False
if
source_field
is
not
None
and
source_field_meta_type
==
"ListBox"
:
contents_stat_list
=
[]
# in case the search was issued by listbox we can provide results of
...
...
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/FooModule_viewFooList.xml
View file @
4c9f95f7
...
...
@@ -84,6 +84,7 @@
<string>
listbox_subject_list
</string>
<string>
listbox_delivery_start_date
</string>
<string>
listbox_causality_title
</string>
<string>
listbox_modification_date
</string>
</list>
</value>
</item>
...
...
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/FooModule_viewFooList/listbox_modification_date.xml
0 → 100644
View file @
4c9f95f7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
editable
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_modification_date
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_module_listbox_modification_date
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/test
NoEditalbleFieldWhenEditableColumnIsEmpty
.xml
→
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/test
EditableFieldInEditableColumn
.xml
View file @
4c9f95f7
...
...
@@ -42,7 +42,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test
NoEditalbleFieldWhenEditableColumnIsEmpty
</string>
</value>
<value>
<string>
test
EditableFieldInEditableColumn
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testEditableFieldInEditableColumn.zpt
0 → 100644
View file @
4c9f95f7
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test RenderJS UI
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test RenderJS UI
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/foo_module/ListBoxZuite_reset
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Reset Successfully.
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/renderjs_runner/#/foo_module
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//a[@data-i18n='Add']
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
link=Add
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tr>
<td>
waitForElementPresent
</td>
<td>
//button[@data-i18n='Save']
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/wait_for_activities"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/foo_module/FooModule_viewFooList/listbox/ListBox_setPropertyList?field_columns=modification_date%7CModification%20Date
&
field_editable_columns=modification_date
&
field_editable=checked
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/renderjs_runner/#/foo_module?editable=true
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//span[@data-i18n='1 Records']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='editable_div']//div[@class='datetimefield']
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementPresent
</td>
<td>
//div[@class='editable_div']//div[@class='datetimefield']//input
</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_listbox_zuite/testNoEdita
l
bleFieldOnFormList.xml
→
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.xml
View file @
4c9f95f7
...
...
@@ -42,7 +42,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testNoEdita
l
bleFieldOnFormList
</string>
</value>
<value>
<string>
testNoEditableFieldOnFormList
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEdita
l
bleFieldOnFormList.zpt
→
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldOnFormList.zpt
View file @
4c9f95f7
File moved
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.xml
0 → 100644
View file @
4c9f95f7
<?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>
testNoEditableFieldWhenEditableColumnIsEmpty
</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_listbox_zuite/testNoEdita
l
bleFieldWhenEditableColumnIsEmpty.zpt
→
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testNoEditableFieldWhenEditableColumnIsEmpty.zpt
View file @
4c9f95f7
File moved
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