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