Commit bddcb668 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Selecting nothing means all are selected

Same behaviour than xhtml style
parent 27126964
...@@ -205,25 +205,30 @@ ...@@ -205,25 +205,30 @@
.allowPublicAcquisition("triggerListboxSelectAction", function triggerListboxSelectAction(argument_list) { .allowPublicAcquisition("triggerListboxSelectAction", function triggerListboxSelectAction(argument_list) {
var action = argument_list[0], var action = argument_list[0],
uid_list = argument_list[1], checked_uid_list = argument_list[1],
unchecked_uid_list = argument_list[2],
gadget = this, gadget = this,
i, i,
search_query, search_query,
query_list = []; query_list = [];
if ((action === 'include') || (action === 'exclude')) { if ((action === 'include') || (action === 'exclude')) {
if (uid_list.length === 0) { if (checked_uid_list.length === 0) {
// If nothing is checked, use all unchecked values (same as xhtml style)
checked_uid_list = unchecked_uid_list;
}
if (checked_uid_list.length === 0) {
// XXX Queries do not correctly handle empty uid list // XXX Queries do not correctly handle empty uid list
return gadget.redirect({ return gadget.redirect({
command: 'reload' command: 'reload'
}); });
} }
for (i = 0; i < uid_list.length; i += 1) { for (i = 0; i < checked_uid_list.length; i += 1) {
query_list.push(new SimpleQuery({ query_list.push(new SimpleQuery({
key: "catalog.uid", key: "catalog.uid",
type: "simple", type: "simple",
operator: (action === 'include') ? "=" : "!=", operator: (action === 'include') ? "=" : "!=",
value: uid_list[i] value: checked_uid_list[i]
})); }));
} }
if (gadget.state.extended_search) { if (gadget.state.extended_search) {
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.27121.4308.45824</string> </value> <value> <string>972.27145.17258.43178</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1545232470.9</float> <float>1545233919.1</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/assert_listbox_not_selectable" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/assert_listbox_not_selectable" />
<tal:block tal:define="pagination_configuration python: {'header': '(1 - 3 / 10)', 'footer': 'Records 1 - 3 / 10'}"> <tal:block tal:define="pagination_configuration python: {'header': '(1 - 3 / 7)', 'footer': 'Records 1 - 3 / 7'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block> </tal:block>
...@@ -122,18 +122,18 @@ ...@@ -122,18 +122,18 @@
</tal:block> </tal:block>
<!-- Check the listbox cell --> <!-- Check the listbox cell -->
<tal:block tal:define="cell_configuration python: {'text': 'Title 0', 'line': 0, 'index': 1}"> <tal:block tal:define="cell_configuration python: {'text': 'Title 3', 'line': 0, 'index': 1}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_cell_text" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_cell_text" />
</tal:block> </tal:block>
<tal:block tal:define="cell_configuration python: {'text': 'Title 1', 'line': 1, 'index': 1}"> <tal:block tal:define="cell_configuration python: {'text': 'Title 4', 'line': 1, 'index': 1}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_cell_text" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_cell_text" />
</tal:block> </tal:block>
<tal:block tal:define="cell_configuration python: {'text': 'Title 2', 'line': 2, 'index': 1}"> <tal:block tal:define="cell_configuration python: {'text': 'Title 5', 'line': 2, 'index': 1}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_cell_text" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_cell_text" />
</tal:block> </tal:block>
<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': 'TEXT', 'value': 'title', 'index': 0}"> <tal:block tal:define="filter_section_configuration python: {'key': 'TEXT', 'value': 'title', 'index': 3}">
<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>
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/assert_listbox_not_selectable" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/assert_listbox_not_selectable" />
<tal:block tal:define="pagination_configuration python: {'header': '(1 - 3 / 10)', 'footer': 'Records 1 - 3 / 10'}"> <tal:block tal:define="pagination_configuration python: {'header': '(3)', 'footer': '3 Records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block> </tal:block>
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
</tal:block> </tal:block>
<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': 'TEXT', 'value': 'title', 'index': 0}"> <tal:block tal:define="filter_section_configuration python: {'key': 'TEXT', 'value': 'title', 'index': 1}">
<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>
......
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