Commit c82b66ce authored by Romain Courteaud's avatar Romain Courteaud Committed by Aurel

erp5_web_renderjs_ui: handle the "!=" query operator

parent 9db98f56
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
data-i18n=At least one (OR) data-i18n=At least one (OR)
data-i18n=Contains data-i18n=Contains
data-i18n=Equal to data-i18n=Equal to
data-i18n=Not equal to
data-i18n=Equal to (at least one) data-i18n=Equal to (at least one)
data-i18n=Greater than data-i18n=Greater than
data-i18n=Less than data-i18n=Less than
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.59263.63131.63590</string> </value> <value> <string>986.51245.10858.8089</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1581947972.8</float> <float>1609255883.37</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -7,11 +7,13 @@ ...@@ -7,11 +7,13 @@
var NUMERIC = [ var NUMERIC = [
["Equal to", "="], ["Greater than", ">"], ["Equal to", "="], ["Greater than", ">"],
["Less than", "<"], ["Less than or Equal to", "<="], ["Less than", "<"], ["Less than or Equal to", "<="],
["Greater than or Equal to", ">="] ["Greater than or Equal to", ">="],
["Not equal to", "!="]
], ],
OTHER = [ OTHER = [
["Equal to", "exact_match"], ["Equal to", "exact_match"],
["Equal to (at least one)", "at_least_one_exact_match"], ["Equal to (at least one)", "at_least_one_exact_match"],
["Not equal to", "!="],
["Contains", "keyword"] ["Contains", "keyword"]
], ],
DOMAIN = [ DOMAIN = [
...@@ -701,7 +703,8 @@ ...@@ -701,7 +703,8 @@
'Less than or Equal to', 'Less than or Equal to',
'Greater than or Equal to', 'Greater than or Equal to',
'Searchable Text', 'Searchable Text',
'Search Expression' 'Search Expression',
'Not equal to'
]) ])
.push(function (translation_list) { .push(function (translation_list) {
var duplicated_query_key_dict = {}, var duplicated_query_key_dict = {},
...@@ -714,6 +717,7 @@ ...@@ -714,6 +717,7 @@
{ {
'Contains': translation_list[7], 'Contains': translation_list[7],
'Equal to': translation_list[8], 'Equal to': translation_list[8],
'Not equal to': translation_list[16],
'Equal to (at least one)': translation_list[9], 'Equal to (at least one)': translation_list[9],
'Greater than': translation_list[10], 'Greater than': translation_list[10],
'Less than': translation_list[11], 'Less than': translation_list[11],
...@@ -819,7 +823,7 @@ ...@@ -819,7 +823,7 @@
if (query.operator === 'keyword') { if (query.operator === 'keyword') {
query.value = '%' + query.value + '%'; query.value = '%' + query.value + '%';
query.operator = ''; query.operator = '';
} else if (["", ">", "<", "<=", ">="].indexOf(query.operator) === -1) { } else if (["", ">", "<", "<=", ">=", "!="].indexOf(query.operator) === -1) {
query.operator = ''; query.operator = '';
} }
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>986.30784.11275.3089</string> </value> <value> <string>988.64322.54806.6826</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1599552227.76</float> <float>1609255951.43</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -99,12 +99,17 @@ ...@@ -99,12 +99,17 @@
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>assertElementPresent</td>
<td>//div[@class='filter_item_container']/div[1]//select[2]//option[3][@value='keyword' and text()='Contains']</td> <td>//div[@class='filter_item_container']/div[1]//select[2]//option[3][@value='!=' and text()='Not equal to']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='filter_item_container']/div[1]//select[2]//option[4][@value='keyword' and text()='Contains']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertElementNotPresent</td> <td>assertElementNotPresent</td>
<td>//div[@class='filter_item_container']/div[1]//select[2]//option[4]</td> <td>//div[@class='filter_item_container']/div[1]//select[2]//option[5]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
<?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>testFilterNotEqualOperator</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>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="search_query python: 'title:!=&#34;31085&#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': 'COLUMN_title', 'value': '31085', 'index': 0, 'operator': '!='}">
<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: 'title: != &#34;31085&#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: 'title: != &#34;31085&#34;';
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
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<tr> <tr>
<td>verifySelectOptions</td> <td>verifySelectOptions</td>
<td>//div[@class="filter_item_container"]/div[1]//select[2]</td> <td>//div[@class="filter_item_container"]/div[1]//select[2]</td>
<td>dengyu,dengyu(zhishaoyige),baohang</td> <td>dengyu,dengyu(zhishaoyige),budengyu,baohang</td>
</tr> </tr>
......
...@@ -6,6 +6,7 @@ param_dict = [ ...@@ -6,6 +6,7 @@ param_dict = [
{ 'message': 'Proceed', 'translation': 'jixu', 'language': 'wo'}, { 'message': 'Proceed', 'translation': 'jixu', 'language': 'wo'},
{ 'message': 'Title', 'translation': 'biaoti', 'language': 'wo'}, { 'message': 'Title', 'translation': 'biaoti', 'language': 'wo'},
{ 'message': 'Equal to', 'translation': 'dengyu', 'language': 'wo'}, { 'message': 'Equal to', 'translation': 'dengyu', 'language': 'wo'},
{ 'message': 'Not equal to', 'translation': 'budengyu', 'language': 'wo'},
{ 'message': 'Equal to (at least one)', 'translation': 'dengyu(zhishaoyige)', 'language': 'wo'}, { 'message': 'Equal to (at least one)', 'translation': 'dengyu(zhishaoyige)', 'language': 'wo'},
{ 'message': 'Contains', 'translation': 'baohang', 'language': 'wo'}, { 'message': 'Contains', 'translation': 'baohang', 'language': 'wo'},
{ 'message': 'Search', 'translation': 'soushuo', 'language': 'wo'}, { 'message': 'Search', 'translation': 'soushuo', 'language': 'wo'},
......
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