Commit 967ac690 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Romain Courteaud

[erp5_web_renderjs_ui] allow filter editor to select searched unknown column ids

- local_roles: ( Assignee OR Assignor ) AND other_unknown_id: value

    [All criterions (AND)_______ v]
    [-][local_roles_____________ v] -> |Type             |  -.
       [Equal to (at least one)_ v]    |Modification Date|   :
       [Assignee________________  ]    |Title            |   :
       [Assignor________________  ]    |Reference        |   :
       [________________________  ]    |Description      |   : search_column_list
                                       |State            |   :
    [-][other_unknown_id________ v]    |Searchable Text  |   :
       [Equal to________________ v]    |Search Expression|  -'
       [value___________________  ]    |local_roles      |  -.
                                       |other_unknown_id |  -' additional_search_column_list
parent 3cd1b20e
...@@ -427,7 +427,16 @@ ...@@ -427,7 +427,16 @@
sub_jio_query_detail_dict, sub_jio_query_detail_dict,
search_column_list = [], search_column_list = [],
search_column_dict = {}, search_column_dict = {},
search_domain_dict = {}; search_domain_dict = {},
additional_search_column_list = [],
additional_search_column_dict = {};
function addAdditionalSearchColumn(key, prefixed_key, title) {
if (additional_search_column_dict.hasOwnProperty(key)) { return false; }
additional_search_column_dict[key] = true;
additional_search_column_list.push([prefixed_key, title]);
return true;
}
len = options.search_column_list.length; len = options.search_column_list.length;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
...@@ -477,9 +486,15 @@ ...@@ -477,9 +486,15 @@
operator: jio_query.operator operator: jio_query.operator
}); });
} else { } else {
addAdditionalSearchColumn(
jio_query.key,
PREFIX_COLUMN + jio_query.key,
jio_query.key
);
query_list.push({ query_list.push({
key: PREFIX_RAW, key: PREFIX_COLUMN + jio_query.key,
value: Query.objectToSearchText(jio_query) value: jio_query.value,
operator: jio_query.operator
}); });
} }
} else { } else {
...@@ -520,9 +535,15 @@ ...@@ -520,9 +535,15 @@
operator: sub_jio_query.operator operator: sub_jio_query.operator
}); });
} else { } else {
addAdditionalSearchColumn(
sub_jio_query.key,
PREFIX_COLUMN + sub_jio_query.key,
sub_jio_query.key
);
query_list.push({ query_list.push({
key: PREFIX_RAW, key: PREFIX_COLUMN + sub_jio_query.key,
value: Query.objectToSearchText(sub_jio_query) value: sub_jio_query.value,
operator: sub_jio_query.operator
}); });
} }
} else { } else {
...@@ -535,8 +556,12 @@ ...@@ -535,8 +556,12 @@
sub_jio_query_dict = sub_jio_query.toJSON(); sub_jio_query_dict = sub_jio_query.toJSON();
sub_jio_query_detail_dict = sub_jio_query_detail_dict =
detectAtleastoneexactmatchComplexQuery(sub_jio_query_dict); detectAtleastoneexactmatchComplexQuery(sub_jio_query_dict);
if (sub_jio_query_detail_dict && if (sub_jio_query_detail_dict) {
search_column_dict.hasOwnProperty(sub_jio_query_detail_dict.key)) { addAdditionalSearchColumn(
sub_jio_query_detail_dict.key,
PREFIX_COLUMN + sub_jio_query_detail_dict.key,
sub_jio_query_detail_dict.key
);
querySetKeyInDeep( querySetKeyInDeep(
sub_jio_query_dict, sub_jio_query_dict,
PREFIX_COLUMN + sub_jio_query_detail_dict.key PREFIX_COLUMN + sub_jio_query_detail_dict.key
...@@ -559,7 +584,7 @@ ...@@ -559,7 +584,7 @@
} }
return this.changeState({ return this.changeState({
search_column_list: search_column_list, search_column_list: search_column_list.concat(additional_search_column_list),
begin_from_key: options.begin_from, begin_from_key: options.begin_from,
// [{key: 'title', value: 'Foo', operator: 'like'}] // [{key: 'title', value: 'Foo', operator: 'like'}]
query_list: query_list, query_list: query_list,
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>973.42226.24018.7099</string> </value> <value> <string>974.50067.21616.14233</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1550070921.26</float> <float>1554214739.75</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -42,11 +42,7 @@ ...@@ -42,11 +42,7 @@
<td>&#36;{base_url}/web_site_module/renderjs_runner/#/bar_module</td> <td>&#36;{base_url}/web_site_module/renderjs_runner/#/bar_module</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<!-- Prepare panel with a multi-valued operator --> <!-- Prepare panel with a multi-valued operator -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<!-- Open the panel and submit it. Check that the new query string is not to much changed --> <!-- 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 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 tal:define="filter_section_configuration python: {'key': 'COLUMN_selection_domain_bar_domain', 'value': 'a', 'index': 0}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_section" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_section" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<!-- Open the panel and submit it. Check that the new query string is not to much changed --> <!-- 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 metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_section_configuration python: {'key': 'RAW', 'value': 'foo: &nbsp;&#34;31085&#34;', 'index': 0}"> <tal:block tal:define="filter_section_configuration python: {'key': 'COLUMN_foo', 'value': '31085', 'index': 0}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_section" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_section" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
...@@ -100,6 +100,12 @@ ...@@ -100,6 +100,12 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_section_configuration python: {'key': 'COLUMN_bar', 'value': '31084', 'index': 0}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_section" />
</tal:block>
<tal:block tal:define="filter_section_configuration python: {'key': 'COLUMN_foo', 'value': ['31085', '31086'], 'index': 1}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_filter_section" />
</tal:block>
<tal:block tal:define="filter_section_configuration python: {'index': 1}"> <tal:block tal:define="filter_section_configuration python: {'index': 1}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/remove_filter_section" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/remove_filter_section" />
</tal:block> </tal:block>
......
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