Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yoji Takeuchi
erp5
Commits
1c81ac54
Commit
1c81ac54
authored
Feb 16, 2016
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: hide rows should be a way to exclude objects
parent
875f7f48
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
25 deletions
+92
-25
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+20
-18
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testHideItem.xml
...m/portal_tests/renderjs_ui_listbox_zuite/testHideItem.xml
+72
-7
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
1c81ac54
...
@@ -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
command:
\'store_and_change\',\n
options:
{\n
"extended_search":
""\n
}\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.1
2124.31713.21350
</string>
</value>
<value>
<string>
949.1
6491.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>
1455
620978.91
</float>
<float>
1455
884364.32
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testHideItem.xml
View file @
1c81ac54
...
@@ -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>
verifyElement
Not
Present
</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>
verifyElement
Not
Present
</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>
verifyElement
Not
Present
</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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment