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
Nikola Balog
erp5
Commits
f4e93e19
Commit
f4e93e19
authored
Jan 19, 2018
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: add support for 'Default Sort' & 'Parameter List' paramete…
…r in (multi)relation field /reviewed-on
!556
parent
2b94959d
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
767 additions
and
26 deletions
+767
-26
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+12
-6
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multirelationstringfield_js.js
...age_module/rjs_gadget_erp5_multirelationstringfield_js.js
+2
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multirelationstringfield_js.xml
...ge_module/rjs_gadget_erp5_multirelationstringfield_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_relation_search_js.js
...eb_page_module/rjs_gadget_erp5_page_relation_search_js.js
+0
-9
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_relation_search_js.xml
...b_page_module/rjs_gadget_erp5_page_relation_search_js.xml
+5
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relation_input_js.js
...Item/web_page_module/rjs_gadget_erp5_relation_input_js.js
+13
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relation_input_js.xml
...tem/web_page_module/rjs_gadget_erp5_relation_input_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relationstringfield_js.js
...web_page_module/rjs_gadget_erp5_relationstringfield_js.js
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relationstringfield_js.xml
...eb_page_module/rjs_gadget_erp5_relationstringfield_js.xml
+2
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_relation_field_zuite/testMultiRelationDefaultSortAndParameterList.xml
...ld_zuite/testMultiRelationDefaultSortAndParameterList.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_relation_field_zuite/testMultiRelationDefaultSortAndParameterList.zpt
...ld_zuite/testMultiRelationDefaultSortAndParameterList.zpt
+306
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_relation_field_zuite/testRelationDefaultSortAndParameterList.xml
...n_field_zuite/testRelationDefaultSortAndParameterList.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_relation_field_zuite/testRelationDefaultSortAndParameterList.zpt
...n_field_zuite/testRelationDefaultSortAndParameterList.zpt
+306
-0
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
f4e93e19
...
@@ -492,6 +492,7 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
...
@@ -492,6 +492,7 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
portal_type_list
=
field
.
get_value
(
'portal_type'
)
portal_type_list
=
field
.
get_value
(
'portal_type'
)
translated_portal_type
=
[]
translated_portal_type
=
[]
jump_reference_list
=
[]
jump_reference_list
=
[]
relation_sort
=
field
.
get_value
(
'sort'
)
if
portal_type_list
:
if
portal_type_list
:
portal_type_list
=
[
x
[
0
]
for
x
in
portal_type_list
]
portal_type_list
=
[
x
[
0
]
for
x
in
portal_type_list
]
translated_portal_type
=
[
Base_translateString
(
x
)
for
x
in
portal_type_list
]
translated_portal_type
=
[
Base_translateString
(
x
)
for
x
in
portal_type_list
]
...
@@ -513,10 +514,10 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
...
@@ -513,10 +514,10 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
result
.
update
({
result
.
update
({
"editable"
:
False
"editable"
:
False
})
})
relation_query_kw
=
kw
.
copy
()
relation_query_kw
[
'portal_type'
]
=
portal_type_list
query
=
url_template_dict
[
"jio_search_template"
]
%
{
query
=
url_template_dict
[
"jio_search_template"
]
%
{
"query"
:
make_query
({
"query"
:
sql_catalog
.
buildQuery
(
"query"
:
make_query
({
"query"
:
sql_catalog
.
buildQuery
(
relation_query_kw
).
asSearchTextExpression
(
sql_catalog
)})
{
"portal_type"
:
portal_type_list
}
).
asSearchTextExpression
(
sql_catalog
)})
}
}
title
=
field
.
get_value
(
"title"
)
title
=
field
.
get_value
(
"title"
)
column_list
=
field
.
get_value
(
"columns"
)
column_list
=
field
.
get_value
(
"columns"
)
...
@@ -543,10 +544,14 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
...
@@ -543,10 +544,14 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
# overwrite, like Base_getRelatedObjectParameter does
# overwrite, like Base_getRelatedObjectParameter does
if
subfield
[
"portal_type"
]
==
[]:
if
subfield
[
"portal_type"
]
==
[]:
subfield
[
"portal_type"
]
=
field
.
get_value
(
'portal_type'
)
subfield
[
"portal_type"
]
=
field
.
get_value
(
'portal_type'
)
if
relation_sort
:
subfield
[
"sort"
]
=
relation_sort
listbox_query_kw
=
kw
.
copy
()
listbox_query_kw
.
update
(
dict
(
portal_type
=
[
x
[
-
1
]
for
x
in
subfield
[
"portal_type"
]],
**
subfield
[
"default_params"
]))
subfield
[
"query"
]
=
url_template_dict
[
"jio_search_template"
]
%
{
subfield
[
"query"
]
=
url_template_dict
[
"jio_search_template"
]
%
{
"query"
:
make_query
({
"query"
:
sql_catalog
.
buildQuery
(
"query"
:
make_query
({
"query"
:
sql_catalog
.
buildQuery
(
dict
(
portal_type
=
[
x
[
-
1
]
for
x
in
subfield
[
"portal_type"
]],
listbox_query_kw
,
ignore_unknown_columns
=
True
**
subfield
[
"default_params"
]),
ignore_unknown_columns
=
True
).
asSearchTextExpression
(
sql_catalog
)})
).
asSearchTextExpression
(
sql_catalog
)})
}
}
# Kato: why?
# Kato: why?
...
@@ -570,6 +575,7 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
...
@@ -570,6 +575,7 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
"translated_portal_types"
:
translated_portal_type
,
"translated_portal_types"
:
translated_portal_type
,
"portal_types"
:
portal_type_list
,
"portal_types"
:
portal_type_list
,
"query"
:
query
,
"query"
:
query
,
"sort"
:
relation_sort
,
"catalog_index"
:
field
.
get_value
(
'catalog_index'
),
"catalog_index"
:
field
.
get_value
(
'catalog_index'
),
"allow_jump"
:
field
.
get_value
(
'allow_jump'
),
"allow_jump"
:
field
.
get_value
(
'allow_jump'
),
"allow_creation"
:
field
.
get_value
(
'allow_creation'
),
"allow_creation"
:
field
.
get_value
(
'allow_creation'
),
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multirelationstringfield_js.js
View file @
f4e93e19
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
return
input_gadget
.
render
({
return
input_gadget
.
render
({
editable
:
gadget
.
state
.
editable
,
editable
:
gadget
.
state
.
editable
,
query
:
gadget
.
state
.
query
,
query
:
gadget
.
state
.
query
,
sort_list_json
:
gadget
.
state
.
sort_list_json
,
catalog_index
:
gadget
.
state
.
catalog_index
,
catalog_index
:
gadget
.
state
.
catalog_index
,
allow_jump
:
gadget
.
state
.
allow_jump
,
allow_jump
:
gadget
.
state
.
allow_jump
,
// required: field_json.required,
// required: field_json.required,
...
@@ -47,6 +48,7 @@
...
@@ -47,6 +48,7 @@
state_dict
=
{
state_dict
=
{
editable
:
field_json
.
editable
,
editable
:
field_json
.
editable
,
query
:
field_json
.
query
,
query
:
field_json
.
query
,
sort_list_json
:
JSON
.
stringify
(
field_json
.
sort
),
catalog_index
:
field_json
.
catalog_index
,
catalog_index
:
field_json
.
catalog_index
,
allow_jump
:
field_json
.
allow_jump
,
allow_jump
:
field_json
.
allow_jump
,
required
:
field_json
.
required
,
required
:
field_json
.
required
,
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multirelationstringfield_js.xml
View file @
f4e93e19
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
964.
38497.25325.33501
</string>
</value>
<value>
<string>
964.
60244.25298.44253
</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>
151
5062767.93
</float>
<float>
151
6369404.81
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_relation_search_js.js
View file @
f4e93e19
...
@@ -62,15 +62,6 @@
...
@@ -62,15 +62,6 @@
filter_action
:
true
filter_action
:
true
});
});
})
})
.
allowPublicAcquisition
(
'
getUrlParameter
'
,
function
(
argument_list
)
{
return
this
.
getUrlParameter
(
argument_list
)
.
push
(
function
(
result
)
{
if
((
result
===
undefined
)
&&
(
argument_list
[
0
]
===
'
field_listbox_sort_list:json
'
))
{
return
[];
}
return
result
;
});
})
.
declareMethod
(
"
render
"
,
function
(
options
)
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
var
gadget
=
this
,
select_template
=
options
.
select_template
||
""
;
select_template
=
options
.
select_template
||
""
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_relation_search_js.xml
View file @
f4e93e19
...
@@ -71,7 +71,9 @@
...
@@ -71,7 +71,9 @@
</item>
</item>
<item>
<item>
<key>
<string>
content_type
</string>
</key>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/javascript
</string>
</value>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
...
@@ -234,7 +236,7 @@
...
@@ -234,7 +236,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
54.5791.20424.25736
</string>
</value>
<value>
<string>
9
64.60339.56148.38212
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -252,7 +254,7 @@
...
@@ -252,7 +254,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1
474556136.49
</float>
<float>
1
516373132.37
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relation_input_js.js
View file @
f4e93e19
...
@@ -145,7 +145,17 @@
...
@@ -145,7 +145,17 @@
value_uid
:
options
.
value_uid
,
value_uid
:
options
.
value_uid
,
value_text
:
options
.
value_text
,
value_text
:
options
.
value_text
,
value_portal_type
:
options
.
value_portal_type
value_portal_type
:
options
.
value_portal_type
};
},
sort_list
=
JSON
.
parse
(
options
.
sort_list_json
);
sort_list
.
map
(
function
(
sort
)
{
var
order
=
sort
[
1
].
toLowerCase
();
if
(
order
.
startsWith
(
'
asc
'
))
{
sort
[
1
]
=
'
ascending
'
;
}
else
if
(
order
.
startsWith
(
'
desc
'
))
{
sort
[
1
]
=
'
descending
'
;
}
});
state_dict
.
sort_list_json
=
JSON
.
stringify
(
sort_list
);
return
this
.
changeState
(
state_dict
);
return
this
.
changeState
(
state_dict
);
})
})
...
@@ -299,7 +309,8 @@
...
@@ -299,7 +309,8 @@
]
]
})),
})),
limit
:
[
0
,
10
],
limit
:
[
0
,
10
],
select_list
:
[
gadget
.
state
.
catalog_index
,
"
uid
"
]
select_list
:
[
gadget
.
state
.
catalog_index
,
"
uid
"
],
sort_on
:
JSON
.
parse
(
gadget
.
state
.
sort_list_json
)
});
});
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relation_input_js.xml
View file @
f4e93e19
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
964.
8568.54116.8601
</string>
</value>
<value>
<string>
964.
64317.62914.20172
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +254,7 @@
...
@@ -254,7 +254,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
151
3266821.11
</float>
<float>
151
6635043.86
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relationstringfield_js.js
View file @
f4e93e19
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
var
render_options
=
{
var
render_options
=
{
editable
:
field_json
.
editable
,
editable
:
field_json
.
editable
,
query
:
field_json
.
query
,
query
:
field_json
.
query
,
sort_list_json
:
JSON
.
stringify
(
field_json
.
sort
),
catalog_index
:
field_json
.
catalog_index
,
catalog_index
:
field_json
.
catalog_index
,
allow_jump
:
field_json
.
allow_jump
,
allow_jump
:
field_json
.
allow_jump
,
// required: field_json.required,
// required: field_json.required,
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relationstringfield_js.xml
View file @
f4e93e19
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
8.19776.55952.3225
</string>
</value>
<value>
<string>
95
9.26374.14159.14984
</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>
1
490691939.14
</float>
<float>
1
516369688.01
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_relation_field_zuite/testMultiRelationDefaultSortAndParameterList.xml
0 → 100644
View file @
f4e93e19
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testMultiRelationDefaultSortAndParameterList
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_relation_field_zuite/testMultiRelationDefaultSortAndParameterList.zpt
0 → 100644
View file @
f4e93e19
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test RenderJS UI
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test RenderJS UI
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<!-- Clean Up -->
<tr>
<td>
open
</td>
<td>
${base_url}/foo_module/ListBoxZuite_reset
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Reset Successfully.
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_viewRelationField/my_bar_category_title_list/manage_main
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//textarea[@name='field_sort']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//textarea[@name='field_sort']
</td>
<td>
id | DESC
</td>
</tr>
<tr>
<td>
click
</td>
<td>
//input[@value='Save Changes']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='system-msg']
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_viewRelationField/my_bar_category_title_list/manage_talesForm
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//input[@name='field_parameter_list']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//input[@name='field_parameter_list']
</td>
<td>
python: [('id', '
<5
AND
>
2')]
</td>
</tr>
<tr>
<td>
click
</td>
<td>
//input[@value='Save Changes']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='system-msg']
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/foo_module/FooModule_createObjects
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Created Successfully.
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/wait_for_activities"
/>
<!-- Initialize -->
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/renderjs_runner/#/foo_module
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//a[@data-i18n='Add']
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
link=Add
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tr>
<td>
waitForTextPresent
</td>
<td>
Save
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Quantity
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_foo_relation_field_view"
/>
<tr>
<td>
waitForElementPresent
</td>
<td>
//input[@name='field_my_bar_category_title_list']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//input[@name='field_my_bar_category_title_list']
</td>
<td>
%
</td>
</tr>
<tr>
<td>
fireEvent
</td>
<td>
//input[@name='field_my_bar_category_title_list']
</td>
<td>
input
</td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-scope='field_my_bar_category_title_list']//ul[@class='ui-listview ui-corner-all search_ul']//li
</td>
<td></td>
</tr>
<!-- test sort -->
<tr>
<td>
verifyAttribute
</td>
<td>
//div[@data-gadget-scope='field_my_bar_category_title_list']//ul[@class='ui-listview ui-corner-all search_ul']/li[1]@data-relative-url
</td>
<td>
foo_module/4
</td>
</tr>
<tr>
<td>
verifyAttribute
</td>
<td>
//div[@data-gadget-scope='field_my_bar_category_title_list']//ul[@class='ui-listview ui-corner-all search_ul']/li[2]@data-relative-url
</td>
<td>
foo_module/3
</td>
</tr>
<!-- test parameter list -->
<tr>
<td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-scope='field_my_bar_category_title_list']//ul[@class='ui-listview ui-corner-all search_ul']//li[@data-relative-url='foo_module/5']
</td>
<td></td>
</tr>
<tr>
<td>
fireEvent
</td>
<td>
//input[@name="field_my_bar_category_title_list"]
</td>
<td>
blur
</td>
</tr>
<tr>
<td>
click
</td>
<td>
//li[@data-explore="true"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//a[@data-i18n="Previous"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-scope='field_listbox']//tbody/tr[1]
</td>
<td></td>
</tr>
<!-- test sort -->
<tr>
<td>
verifyElementPresent
</td>
<td>
//div[@data-gadget-scope='field_listbox']//tbody/tr[1]//a[contains(text(), '4')]
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementPresent
</td>
<td>
//div[@data-gadget-scope='field_listbox']//tbody/tr[2]//a[contains(text(), '3')]
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-scope='field_listbox']//a[contains(text(), '5')]
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_viewRelationField/my_bar_category_title_list/manage_main
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//textarea[@name='field_sort']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//textarea[@name='field_sort']
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
//input[@value='Save Changes']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='system-msg']
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_viewRelationField/my_bar_category_title_list/manage_talesForm
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//input[@name='field_parameter_list']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//input[@name='field_parameter_list']
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
//input[@value='Save Changes']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='system-msg']
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_relation_field_zuite/testRelationDefaultSortAndParameterList.xml
0 → 100644
View file @
f4e93e19
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testRelationDefaultSortAndParameterList
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_relation_field_zuite/testRelationDefaultSortAndParameterList.zpt
0 → 100644
View file @
f4e93e19
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test RenderJS UI
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test RenderJS UI
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<!-- Clean Up -->
<tr>
<td>
open
</td>
<td>
${base_url}/foo_module/ListBoxZuite_reset
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Reset Successfully.
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_viewRelationField/my_successor_title/manage_main
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//textarea[@name='field_sort']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//textarea[@name='field_sort']
</td>
<td>
id | DESC
</td>
</tr>
<tr>
<td>
click
</td>
<td>
//input[@value='Save Changes']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='system-msg']
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_viewRelationField/my_successor_title/manage_talesForm
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//input[@name='field_parameter_list']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//input[@name='field_parameter_list']
</td>
<td>
python: [('id', '
<5
AND
>
2')]
</td>
</tr>
<tr>
<td>
click
</td>
<td>
//input[@value='Save Changes']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='system-msg']
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/foo_module/FooModule_createObjects
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Created Successfully.
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/wait_for_activities"
/>
<!-- Initialize -->
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/renderjs_runner/#/foo_module
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//a[@data-i18n='Add']
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
link=Add
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tr>
<td>
waitForTextPresent
</td>
<td>
Save
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Quantity
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_foo_relation_field_view"
/>
<tr>
<td>
waitForElementPresent
</td>
<td>
//input[@name='field_my_successor_title']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//input[@name='field_my_successor_title']
</td>
<td>
%
</td>
</tr>
<tr>
<td>
fireEvent
</td>
<td>
//input[@name='field_my_successor_title']
</td>
<td>
input
</td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-scope='field_my_successor_title']//ul[@class='ui-listview ui-corner-all search_ul']//li
</td>
<td></td>
</tr>
<!-- test sort -->
<tr>
<td>
verifyAttribute
</td>
<td>
//div[@data-gadget-scope='field_my_successor_title']//ul[@class='ui-listview ui-corner-all search_ul']/li[1]@data-relative-url
</td>
<td>
foo_module/4
</td>
</tr>
<tr>
<td>
verifyAttribute
</td>
<td>
//div[@data-gadget-scope='field_my_successor_title']//ul[@class='ui-listview ui-corner-all search_ul']/li[2]@data-relative-url
</td>
<td>
foo_module/3
</td>
</tr>
<!-- test parameter list -->
<tr>
<td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-scope='field_my_successor_title']//ul[@class='ui-listview ui-corner-all search_ul']//li[@data-relative-url='foo_module/5']
</td>
<td></td>
</tr>
<tr>
<td>
fireEvent
</td>
<td>
//input[@name="field_my_successor_title"]
</td>
<td>
blur
</td>
</tr>
<tr>
<td>
click
</td>
<td>
//li[@data-explore="true"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//a[@data-i18n="Previous"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-scope='field_listbox']//tbody/tr[1]
</td>
<td></td>
</tr>
<!-- test sort -->
<tr>
<td>
verifyElementPresent
</td>
<td>
//div[@data-gadget-scope='field_listbox']//tbody/tr[1]//a[contains(text(), '4')]
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementPresent
</td>
<td>
//div[@data-gadget-scope='field_listbox']//tbody/tr[2]//a[contains(text(), '3')]
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementNotPresent
</td>
<td>
//div[@data-gadget-scope='field_listbox']//a[contains(text(), '5')]
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_viewRelationField/my_successor_title/manage_main
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//textarea[@name='field_sort']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//textarea[@name='field_sort']
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
//input[@value='Save Changes']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='system-msg']
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_viewRelationField/my_successor_title/manage_talesForm
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//input[@name='field_parameter_list']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//input[@name='field_parameter_list']
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
//input[@value='Save Changes']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='system-msg']
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
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