Commit f7d81aa8 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Add support for domain tree

Use the filter editor to select the domain in a select input.
This concentrate all search parameters in only place to improve the usability and discovery.
parent b4f0c21b
......@@ -65,7 +65,7 @@
});
}
function renderEditableField(gadget, element, column_list, field_table) {
function renderEditableField(gadget, element, field_table) {
var i,
promise_list = [],
column,
......@@ -106,7 +106,7 @@
.push(function (table_part_html) {
container = document.createElement(container_name);
container.innerHTML = table_part_html;
return renderEditableField(gadget, container, column_list, row_list);
return renderEditableField(gadget, container, row_list);
})
.push(function () {
var table = gadget.element.querySelector("table"),
......@@ -280,6 +280,9 @@
list_method: field_json.list_method,
list_method_template: field_json.list_method_template,
domain_list_json: JSON.stringify(field_json.domain_root_list || []),
domain_dict_json: JSON.stringify(field_json.domain_dict || {}),
column_list_json: JSON.stringify(displayed_column_item_list),
displayable_column_list_json:
JSON.stringify(displayable_column_item_list),
......@@ -660,11 +663,24 @@
})
.declareMethod('getListboxInfo', function () {
var domain_list = JSON.parse(this.state.domain_list_json),
domain_dict = JSON.parse(this.state.domain_dict_json),
i,
len = domain_list.length;
for (i = 0; i < len; i += 1) {
if (domain_dict.hasOwnProperty(domain_list[i][0])) {
domain_dict['selection_domain_' + domain_list[i][0]] = domain_dict[domain_list[i][0]];
delete domain_dict[domain_list[i][0]];
}
domain_list[i][0] = 'selection_domain_' + domain_list[i][0];
}
//XXXXX search column list is used for search editor to
//construct search panel
//hardcoded begin_from key to define search position
return {
search_column_list: JSON.parse(this.state.search_column_list_json),
domain_list: domain_list,
domain_dict: domain_dict,
begin_from: this.state.key + "_begin_from"
};
})
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.44873.24271.11298</string> </value>
<value> <string>966.8130.3423.18312</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1519377228.21</float>
<float>1520872134.75</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -149,6 +149,8 @@
extended_search: extended_search,
begin_from: result.begin_from,
search_column_list: result.search_column_list,
domain_list: result.domain_list,
domain_dict: result.domain_dict,
focus_on: focus_on
});
});
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.51066.14142.56217</string> </value>
<value> <string>965.57864.64457.52974</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1519825040.18</float>
<float>1520432653.26</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -38,7 +38,15 @@
<option {{#if selected}}selected="selected"{{/if}} data-i18n="{{text}}" value="{{value}}">{{text}}</option>
{{/each}}
</select>
{{#if domain_option}}
<select required>
{{#each domain_option}}
<option {{#if selected}}selected="selected"{{/if}} data-i18n="{{text}}" {{#if value}}value="{{value}}"{{/if}}>{{text}}</option>
{{/each}}
</select>
{{else}}
<input type="{{input_type}}" value="{{input_value}}" required></input>
{{/if}}
</div>
</script>
......@@ -72,6 +80,9 @@
</div>
<button class="plus ui-btn-c ui-override-theme ui-btn ui-icon-plus ui-btn-icon-left ui-corner-all">Add Criteria</button>
<button type="button" class="trash ui-btn-c ui-override-theme ui-btn ui-icon-trash-o ui-btn-icon-left ui-corner-all">Reset</button>
<div class="domain_item_container">
</div>
</section>
</div>
</script>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.54995.41625.39389</string> </value>
<value> <string>965.57937.32109.14421</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1518776267.68</float>
<float>1520345474.95</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -22,9 +22,13 @@
["Equals To", "exact_match"],
["Contains", "keyword"]
],
DOMAIN = [
["Equals To", "exact_match"]
],
DEFAULT = [["Contains", "contain"]],
PREFIX_COLUMN = 'COLUMN_',
PREFIX_RAW = 'RAW',
PREFIX_DOMAIN = 'DOMAIN_',
PREFIX_TEXT = 'TEXT';
// XXX
......@@ -42,7 +46,9 @@
column_option_list = [],
input_type = "search",
i,
is_selected;
is_selected,
domain_list,
domain_option_list;
if (query_dict.key.indexOf(PREFIX_COLUMN) === 0) {
if (isNumericComparison(query_dict.key)) {
......@@ -55,6 +61,27 @@
} else {
operator_default_list = OTHER;
}
} else if (query_dict.key.indexOf(PREFIX_DOMAIN) === 0) {
is_selected = false;
operator_default_list = DOMAIN;
input_type = "select";
domain_option_list = [];
domain_list = gadget.state.domain_dict[query_dict.key.slice(PREFIX_DOMAIN.length)];
for (i = 0; i < domain_list.length; i += 1) {
domain_option_list.push({
text: domain_list[i][0],
value: domain_list[i][1],
selected: (query_dict.value === domain_list[i][1])
});
is_selected = is_selected || (query_dict.value === domain_list[i][1]);
}
if (!is_selected) {
domain_option_list.push({
text: '??? ' + query_dict.value,
value: query_dict.value,
selected: true
});
}
}
if (!query_dict.operator) {
......@@ -75,6 +102,8 @@
// Do not try to change it to another value, as it means losing user data
if (query_dict.key.indexOf(PREFIX_COLUMN) === 0) {
query_dict.key = query_dict.key.slice(PREFIX_COLUMN.length);
} else if (query_dict.key.indexOf(PREFIX_DOMAIN) === 0) {
query_dict.key = query_dict.key.slice(PREFIX_DOMAIN.length);
} else {
query_dict.key = '';
}
......@@ -110,7 +139,8 @@
option: column_option_list,
operator_option: operator_option_list,
input_value: query_dict.value,
input_type: input_type
input_type: input_type,
domain_option: domain_option_list
});
}
......@@ -122,12 +152,18 @@
},
i,
filter_item_list = gadget.element.querySelectorAll(".filter_item"),
select_list;
select_list,
value;
for (i = 0; i < filter_item_list.length; i += 1) {
select_list = filter_item_list[i].querySelectorAll("select");
if (select_list.length === 3) {
value = select_list[2][select_list[2].selectedIndex].value;
} else {
value = filter_item_list[i].querySelector("input").value;
}
state.query_list.push({
value: filter_item_list[i].querySelector("input").value,
value: value,
operator: select_list[1][select_list[1].selectedIndex].value,
key: select_list[0][select_list[0].selectedIndex].value
});
......@@ -164,7 +200,8 @@
len,
sub_jio_query,
search_column_list = [],
search_column_dict = {};
search_column_dict = {},
search_domain_dict = {};
len = options.search_column_list.length;
for (i = 0; i < len; i += 1) {
......@@ -174,6 +211,15 @@
options.search_column_list[i][1]
]);
}
len = options.domain_list.length;
for (i = 0; i < len; i += 1) {
search_domain_dict[options.domain_list[i][0]] = true;
search_column_list.push([
PREFIX_DOMAIN + options.domain_list[i][0],
options.domain_list[i][1]
]);
}
search_column_list.push([PREFIX_TEXT, "Searchable Text"]);
search_column_list.push([PREFIX_RAW, "Search Expression"]);
......@@ -198,6 +244,12 @@
value: jio_query.value,
operator: jio_query.operator
});
} else if (search_domain_dict.hasOwnProperty(jio_query.key)) {
query_list.push({
key: PREFIX_DOMAIN + jio_query.key,
value: jio_query.value,
operator: jio_query.operator
});
} else {
query_list.push({
key: PREFIX_RAW,
......@@ -225,6 +277,12 @@
value: sub_jio_query.value,
operator: sub_jio_query.operator
});
} else if (search_domain_dict.hasOwnProperty(sub_jio_query.key)) {
query_list.push({
key: PREFIX_DOMAIN + sub_jio_query.key,
value: sub_jio_query.value,
operator: sub_jio_query.operator
});
} else {
query_list.push({
key: PREFIX_RAW,
......@@ -257,6 +315,7 @@
begin_from_key: options.begin_from,
// [{key: 'title', value: 'Foo', operator: 'like'}]
query_list: query_list,
domain_dict: options.domain_dict,
// and/or
operator: operator,
focus_on: options.focus_on
......@@ -338,6 +397,8 @@
} else {
if (query.key.indexOf(PREFIX_COLUMN) === 0) {
query.key = query.key.slice(PREFIX_COLUMN.length);
} else if (query.key.indexOf(PREFIX_DOMAIN) === 0) {
query.key = query.key.slice(PREFIX_DOMAIN.length);
} else {
query.key = '';
}
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.34858.52827.27050</string> </value>
<value> <string>966.8576.5602.10291</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1518776360.26</float>
<float>1520872456.29</float>
<string>UTC</string>
</tuple>
</state>
......
<?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>testFilterCategoryDomain</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>
<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" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_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}/foo_module/FooModule_createObjects</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Created Successfully.</td>
<td></td>
</tr>
<!-- Let's set up domain property on listbox -->
<tr><td>open</td>
<td>${base_url}/FooModule_viewFooList/listbox/ListBox_setPropertyList?field_domain_root_list=foo_category+%7C+FooCat+%0A+foo_domain+%7C+FooDomain</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Set Successfully.</td><td></td></tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<!-- Initialize -->
<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='Previous']</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'selection_domain_foo_category:&#34;a&#47;a1&#34;'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<!-- Open the panel and submit it. Check that the new query string is not to much changed -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_domain_section_configuration python: {'key': 'DOMAIN_selection_domain_foo_category', 'value': 'a/a1', 'index': 0, 'option_list': [['a', 'a'], ['a/a1', 'a/a1'], ['a/a2', 'a/a2'], ['b', 'b']]}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_domain_section" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: 'selection_domain_foo_category: &nbsp;&#34;a&#47;a1&#34;';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<!-- Open the panel a second time and submit it. Check that the new query string is identical -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: 'selection_domain_foo_category: &nbsp;&#34;a&#47;a1&#34;';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_section_configuration python: {'index': 0}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/remove_filter_section" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: '';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?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>testFilterDomain</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>
<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" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_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}/foo_module/FooModule_createObjects</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Created Successfully.</td>
<td></td>
</tr>
<!-- Let's set up domain property on listbox -->
<tr><td>open</td>
<td>${base_url}/FooModule_viewFooList/listbox/ListBox_setPropertyList?field_domain_root_list=foo_category+%7C+FooCat+%0A+foo_domain+%7C+FooDomain</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Set Successfully.</td><td></td></tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<!-- Initialize -->
<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='Previous']</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'selection_domain_foo_domain:&#34;a&#34;'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<!-- Open the panel and submit it. Check that the new query string is not to much changed -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_domain_section_configuration python: {'key': 'DOMAIN_selection_domain_foo_domain', 'value': 'a', 'index': 0, 'option_list': [['a', 'a'], ['a/a1', '${nbsp}${nbsp}${nbsp}${nbsp}a1'], ['a/a2', '${nbsp}${nbsp}${nbsp}${nbsp}a2'], ['b', 'b']]}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_domain_section" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: 'selection_domain_foo_domain: &nbsp;&#34;a&#34;';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<!-- Open the panel a second time and submit it. Check that the new query string is identical -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: 'selection_domain_foo_domain: &nbsp;&#34;a&#34;';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_section_configuration python: {'index': 0}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/remove_filter_section" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: '';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?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>testFilterUnknownDomain</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>
<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" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_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}/foo_module/FooModule_createObjects</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Created Successfully.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<!-- Initialize -->
<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='Previous']</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'selection_domain_bar_domain:&#34;a&#34;'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<!-- Open the panel and submit it. Check that the new query string is not to much changed -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_section_configuration python: {'key': 'RAW', 'value': 'selection_domain_bar_domain: &nbsp;&#34;a&#34;', 'index': 0}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_section" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: 'selection_domain_bar_domain: &nbsp;&#34;a&#34;';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<!-- Open the panel a second time and submit it. Check that the new query string is identical -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: 'selection_domain_bar_domain: &nbsp;&#34;a&#34;';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_section_configuration python: {'index': 0}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/remove_filter_section" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: '';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?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>testFilterUnknownDomainValue</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>
<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" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_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}/foo_module/FooModule_createObjects</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Created Successfully.</td>
<td></td>
</tr>
<!-- Let's set up domain property on listbox -->
<tr><td>open</td>
<td>${base_url}/FooModule_viewFooList/listbox/ListBox_setPropertyList?field_domain_root_list=foo_category+%7C+FooCat+%0A+foo_domain+%7C+FooDomain</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Set Successfully.</td><td></td></tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<!-- Initialize -->
<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='Previous']</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'selection_domain_foo_domain:&#34;bar&#34;'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<!-- Open the panel and submit it. Check that the new query string is not to much changed -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_domain_section_configuration python: {'key': 'DOMAIN_selection_domain_foo_domain', 'value': 'bar', 'index': 0, 'option_list': [['a', 'a'], ['a/a1', '${nbsp}${nbsp}${nbsp}${nbsp}a1'], ['a/a2', '${nbsp}${nbsp}${nbsp}${nbsp}a2'], ['b', 'b'], ['bar', '??? bar']]}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_domain_section" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: 'selection_domain_foo_domain: &nbsp;&#34;bar&#34;';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<!-- Open the panel a second time and submit it. Check that the new query string is identical -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: 'selection_domain_foo_domain: &nbsp;&#34;bar&#34;';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_section_configuration python: {'index': 0}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/remove_filter_section" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="parsed_query python: '';
search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -725,6 +725,38 @@
</tr>
</tal:block>
<tal:block metal:define-macro="check_filter_domain_section">
<tr>
<td colspan="3"><b tal:content="python: 'Check the filter domain section %(index)i' % filter_domain_section_configuration"></b></td>
</tr>
<tr>
<td>verifyValue</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_search_editor.html\')]//div[@class=\'filter_item_container\']/div[%i]//select' % (filter_domain_section_configuration['index'] + 1)"></td>
<td tal:content="python: filter_domain_section_configuration['key']"></td>
</tr>
<tr>
<td>verifyValue</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_search_editor.html\')]//div[@class=\'filter_item_container\']/div[%i]//select[2]' % (filter_domain_section_configuration['index'] + 1)"></td>
<td>exact_match</td>
</tr>
<tr>
<td>verifyValue</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_search_editor.html\')]//div[@class=\'filter_item_container\']/div[%i]//select[3]' % (filter_domain_section_configuration['index'] + 1)"></td>
<td tal:content="python: filter_domain_section_configuration['value']"></td>
</tr>
<tal:block tal:repeat="option python: filter_domain_section_configuration.get('option_list', [['XXX', 'XXX']])">
<tr>
<td>assertElementPresent</td>
<td tal:content="python: '//div[contains(@data-gadget-url, \'gadget_erp5_search_editor.html\')]//div[@class=\'filter_item_container\']/div[%i]//select[3]//option[%i][@value=\'%s\' and text()=\'%s\']' % (filter_domain_section_configuration['index'] + 1, repeat['option'].index + 1, option[0], option[1])"></td>
<td></td>
</tr>
</tal:block>
<tr>
<td colspan="3"><p></p></td>
</tr>
</tal:block>
<tal:block metal:define-macro="triggle_configure">
<tr>
<td colspan="3"><b>Open the configure panel</b></td>
......@@ -960,4 +992,4 @@
</tr>
</tal:block>
</tal:block>
</tal:block>
\ No newline at end of file
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