Commit 384455db authored by Romain Courteaud's avatar Romain Courteaud

[erp5_hal_json_style] Listbox: propagate selection name

parent 0455cdc6
...@@ -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"]])
......
...@@ -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)
......
...@@ -100,24 +100,28 @@ ...@@ -100,24 +100,28 @@
</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>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>validate</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>validate</string> </value>
<key> <string>validation_state</string> </key> </item>
<value> <string>validated</string> </value> <item>
</item> <key> <string>validation_state</string> </key>
</dictionary> <value> <string>validated</string> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment