Commit 1c81ac54 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: hide rows should be a way to exclude objects

parent 875f7f48
...@@ -109,9 +109,9 @@ ...@@ -109,9 +109,9 @@
/*jslint indent: 2, maxerr: 3, nomen: true */\n /*jslint indent: 2, maxerr: 3, nomen: true */\n
/*global window, document, rJS, URI, RSVP, loopEventListener,\n /*global window, document, rJS, URI, RSVP, loopEventListener,\n
SimpleQuery, ComplexQuery, Query, Handlebars, console*/\n SimpleQuery, ComplexQuery, Query, Handlebars, console, QueryFactory*/\n
(function (window, document, rJS, URI, RSVP, loopEventListener,\n (function (window, document, rJS, URI, RSVP, loopEventListener,\n
SimpleQuery, ComplexQuery, Query, Handlebars, console) {\n SimpleQuery, ComplexQuery, Query, Handlebars, console, QueryFactory) {\n
"use strict";\n "use strict";\n
var gadget_klass = rJS(window),\n var gadget_klass = rJS(window),\n
listbox_hidden_thead_source = gadget_klass.__template_element\n listbox_hidden_thead_source = gadget_klass.__template_element\n
...@@ -631,7 +631,7 @@ ...@@ -631,7 +631,7 @@
thead_template,\n thead_template,\n
tbody_template,\n tbody_template,\n
hide_button_html,\n hide_button_html,\n
hide_elements;\n hide_elements = [];\n
if (gadget.props.foot.colspan === gadget.props.foot.default_colspan) {\n if (gadget.props.foot.colspan === gadget.props.foot.default_colspan) {\n
thead_template = listbox_show_thead_template;\n thead_template = listbox_show_thead_template;\n
tbody_template = listbox_show_tbody_template;\n tbody_template = listbox_show_tbody_template;\n
...@@ -641,30 +641,32 @@ ...@@ -641,30 +641,32 @@
//hide closed\n //hide closed\n
//maybe submit\n //maybe submit\n
all_hide_elements = gadget.props.element.querySelectorAll(".hide_element");\n all_hide_elements = gadget.props.element.querySelectorAll(".hide_element");\n
hide_elements = gadget.props.element.querySelectorAll(".hide_element:checked");\n for (i = 0; i < all_hide_elements.length; i += 1) {\n
//nothing selected, show all\n if (!all_hide_elements[i].checked) {\n
if (hide_elements.length === 0) {\n hide_elements.push(all_hide_elements[i]);\n
return gadget.redirect({\n }\n
command: \'store_and_change\',\n
options: {\n
"extended_search": ""\n
}\n
});\n
}\n }\n
\n if (hide_elements.length) {\n
if (hide_elements.length < all_hide_elements.length) {\n
for (i = 0; i < hide_elements.length; i += 1) {\n for (i = 0; i < hide_elements.length; i += 1) {\n
query_list.push(new SimpleQuery({\n query_list.push(new SimpleQuery({\n
key: "catalog.uid",\n key: "catalog.uid",\n
type: "simple",\n type: "simple",\n
operator: "!=",\n
value: hide_elements[i].getAttribute("value")\n value: hide_elements[i].getAttribute("value")\n
}));\n }));\n
}\n }\n
if (gadget.props.extended_search) {\n
search_query = QueryFactory.create(gadget.props.extended_search);\n
}\n
if (search_query) {\n
query_list.push(search_query);\n
}\n
search_query = new ComplexQuery({\n search_query = new ComplexQuery({\n
operator: "OR",\n operator: "AND",\n
query_list: query_list,\n query_list: query_list,\n
type: "complex"\n type: "complex"\n
});\n });\n
\n
return gadget.redirect({\n return gadget.redirect({\n
command: \'store_and_change\',\n command: \'store_and_change\',\n
options: {\n options: {\n
...@@ -704,7 +706,7 @@ ...@@ -704,7 +706,7 @@
});\n });\n
\n \n
}(window, document, rJS, URI, RSVP, loopEventListener,\n }(window, document, rJS, URI, RSVP, loopEventListener,\n
SimpleQuery, ComplexQuery, Query, Handlebars, console)); SimpleQuery, ComplexQuery, Query, Handlebars, console, QueryFactory));
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -841,7 +843,7 @@ ...@@ -841,7 +843,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>949.12124.31713.21350</string> </value> <value> <string>949.16491.61409.54647</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -859,7 +861,7 @@ ...@@ -859,7 +861,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1455620978.91</float> <float>1455884364.32</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -85,6 +85,65 @@ ...@@ -85,6 +85,65 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />\n <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />\n
\n \n
\n \n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//button[@data-i18n=\'Sort\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@data-i18n=\'Sort\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//form[@class=\'plus\']</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<tr>\n
<td>click</td>\n
<td>//form[@class=\'plus\']//button</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//div[@class=\'sort_item_container ui-controlgroup ui-corner_all\']/div[1]</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
\n
<tr>\n
<td>select</td>\n
<td>//div[@class=\'sort_item_container ui-controlgroup ui-corner_all\']/div[1]/div[2]//select</td>\n
<td>index=0</td>\n
</tr>\n
\n
\n
\n
<tr>\n
<td>click</td>\n
<td>//form[@class="submit"]//button</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>link=Title 0</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<tr>\n <tr>\n
<td>waitForElementPresent</td>\n <td>waitForElementPresent</td>\n
<td>//button[@data-i18n=\'Hide Rows\']</td>\n <td>//button[@data-i18n=\'Hide Rows\']</td>\n
...@@ -159,10 +218,15 @@ ...@@ -159,10 +218,15 @@
\n \n
<tr>\n <tr>\n
<td>verifyElementNotPresent</td>\n <td>verifyElementNotPresent</td>\n
<td>//tbody/tr[2]</td>\n <td>//input[@value=\'1\']</td>\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
\n \n
<tr>\n
<td>verifyElementNotPresent</td>\n
<td>//input[@value=\'2\']</td>\n
<td></td>\n
</tr>\n
\n \n
\n \n
<tr>\n <tr>\n
...@@ -217,27 +281,28 @@ ...@@ -217,27 +281,28 @@
\n \n
\n \n
<tr>\n <tr>\n
<td>verifyElementPresent</td>\n <td>verifyElementNotPresent</td>\n
<td>//tbody/tr/th</td>\n <td>//input[@value=\'0\']</td>\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
\n \n
\n \n
<tr>\n <tr>\n
<td>verifyElementPresent</td>\n <td>verifyElementNotPresent</td>\n
<td>//tbody/tr[2]</td>\n <td>//input[@value=\'1\']</td>\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
\n \n
<tr>\n <tr>\n
<td>verifyElementPresent</td>\n <td>verifyElementNotPresent</td>\n
<td>//tbody/tr[3]</td>\n <td>//input[@value=\'2\']</td>\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
\n \n
\n \n
\n \n
\n \n
\n
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />\n <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />\n
\n \n
\n \n
......
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