diff --git a/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml b/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml index c067aeb674647e930f07eb7386b8ba0fe81d0b63..b775e2cb06ec4abf34d3e2744611f01fb6e19042 100644 --- a/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml +++ b/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml @@ -363,6 +363,7 @@ def renderField(traversed_document, field, form_relative_url, value=None, meta_t # portal_types = [x[1] for x in field.get_value(\'portal_types\')]\n portal_types = field.get_value(\'portal_types\')\n default_params = dict(field.get_value(\'default_params\'))\n + default_params[\'ignore_unknown_columns\'] = True\n # How to implement pagination?\n # default_params.update(REQUEST.form)\n lines = field.get_value(\'lines\')\n diff --git a/bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py b/bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py index 9a47695d24b1af1c5b249254ffa5486d61550e0c..bce1649f1e288ba73e83bdfc459354a05ca7153a 100644 --- a/bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py +++ b/bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py @@ -540,6 +540,24 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin): self.assertEqual(result_dict['_embedded']['_view']['my_id']['type'], 'StringField') self.assertEqual(result_dict['_embedded']['_view']['my_id']['title'], 'ID') + self.assertSameSet(result_dict['_embedded']['_view']['listbox']['default_params'].keys(), ['ignore_unknown_columns']) + self.assertTrue(result_dict['_embedded']['_view']['listbox']['default_params']['ignore_unknown_columns']) + 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']['title'], 'Foo Lines') + 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']['show_anchor'], 0) + self.assertEqual(result_dict['_embedded']['_view']['listbox']['list_method'], 'objectValues') + self.assertEqual(result_dict['_embedded']['_view']['listbox']['query'], 'urn:jio:allDocs?query=') + self.assertEqual(result_dict['_embedded']['_view']['listbox']['portal_type'], [['Foo Line', 'Foo Line']]) + self.assertEqual(result_dict['_embedded']['_view']['listbox']['column_list'], [['id', 'ID'], ['title', 'Title'], ['quantity', 'Quantity'], ['start_date', 'Date']]) + self.assertEqual(result_dict['_embedded']['_view']['listbox']['search_column_list'], [['id', 'ID'], ['title', 'Title'], ['quantity', 'Quantity'], ['start_date', 'Date']]) + self.assertEqual(result_dict['_embedded']['_view']['listbox']['editable_column_list'], [['id', 'ID'], ['title', 'Title'], ['quantity', 'quantity'], ['start_date', 'Date']]) + self.assertEqual(result_dict['_embedded']['_view']['listbox']['sort_column_list'], [['id', 'ID'], ['title', 'Title'], ['quantity', 'Quantity'], ['start_date', 'Date']]) + self.assertEqual(result_dict['_embedded']['_view']['listbox']['list_method_template'], + '%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=search&relative_url=foo_module%%2F%s&form_relative_url=portal_skins/erp5_ui_test/Foo_view/listbox&list_method=objectValues&default_param_json=eyJwb3J0YWxfdHlwZSI6IFsiRm9vIExpbmUiXSwgImlnbm9yZV91bmtub3duX2NvbHVtbnMiOiB0cnVlfQ=={&query,select_list*,limit*,sort_on*,local_roles*}' % (self.portal.absolute_url(), document.getId())) + self.assertEqual(result_dict['_embedded']['_view']['_links']['traversed_document']['href'], 'urn:jio:get:%s' % document.getRelativeUrl()) self.assertEqual(result_dict['_embedded']['_view']['_links']['traversed_document']['name'], document.getRelativeUrl()) self.assertEqual(result_dict['_embedded']['_view']['_links']['traversed_document']['title'], document.getTitle().decode("UTF-8"))