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
Léo-Paul Géneau
erp5
Commits
384455db
Commit
384455db
authored
Oct 04, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_hal_json_style] Listbox: propagate selection name
parent
0455cdc6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
17 deletions
+24
-17
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+2
-1
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
...plateItem/portal_components/test.erp5.testHalJsonStyle.py
+2
-0
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.xml
...lateItem/portal_components/test.erp5.testHalJsonStyle.xml
+20
-16
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
384455db
...
@@ -754,7 +754,8 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
...
@@ -754,7 +754,8 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
"query"
:
sql_catalog
.
buildQuery
(
"query"
:
sql_catalog
.
buildQuery
(
list_method_query_dict
,
list_method_query_dict
,
ignore_unknown_columns
=
True
).
asSearchTextExpression
(
sql_catalog
)})},
ignore_unknown_columns
=
True
).
asSearchTextExpression
(
sql_catalog
)})},
"domain_root_list"
:
[(
x
,
Base_translateString
(
y
))
for
x
,
y
in
field
.
get_value
(
"domain_root_list"
)]
"domain_root_list"
:
[(
x
,
Base_translateString
(
y
))
for
x
,
y
in
field
.
get_value
(
"domain_root_list"
)],
"selection_name"
:
field
.
get_value
(
'selection_name'
)
})
})
result
[
"domain_dict"
]
=
getDomainSelection
([
x
[
0
]
for
x
in
result
[
"domain_root_list"
]])
result
[
"domain_dict"
]
=
getDomainSelection
([
x
[
0
]
for
x
in
result
[
"domain_root_list"
]])
...
...
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
View file @
384455db
...
@@ -649,6 +649,7 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
...
@@ -649,6 +649,7 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'type'
],
'ListBox'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'type'
],
'ListBox'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'key'
],
'field_listbox'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'key'
],
'field_listbox'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'title'
],
'Foo Lines'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'title'
],
'Foo Lines'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'selection_name'
],
'foo_selection'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'lines'
],
3
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'lines'
],
3
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'editable'
],
1
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'editable'
],
1
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'show_anchor'
],
0
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'listbox'
][
'show_anchor'
],
0
)
...
@@ -1175,6 +1176,7 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
...
@@ -1175,6 +1176,7 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
type
'], '
ListBox
')
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
type
'], '
ListBox
')
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
key
'], '
x1_listbox
')
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
key
'], '
x1_listbox
')
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
title
'], '
Workflow
History
')
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
title
'], '
Workflow
History
')
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
selection_name
'], '
base_workflow_history_selection
')
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
lines
'], 15)
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
lines
'], 15)
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
editable
'], 1)
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
editable
'], 1)
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
show_anchor
'], 0)
self.assertEqual(result_dict['
_embedded
']['
_view
']['
report_section_list
'][1]['
listbox
']['
show_anchor
'], 0)
...
...
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.xml
View file @
384455db
...
@@ -100,11 +100,13 @@
...
@@ -100,11 +100,13 @@
</record>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<list>
<dictionary>
<dictionary>
<item>
<item>
...
@@ -117,7 +119,9 @@
...
@@ -117,7 +119,9 @@
</item>
</item>
</dictionary>
</dictionary>
</list>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</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