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
alecs_myu
erp5
Commits
6daac17e
Commit
6daac17e
authored
Feb 12, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Module list: manually filter/sort the modules
parent
a75086f3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
191 additions
and
17 deletions
+191
-17
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.html
...em/web_page_module/rjs_gadget_erp5_pt_frontpage_html.html
+2
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.xml
...tem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.js
+67
-13
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
+2
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_zuite/testPageFrontSearchModuleList.xml
.../renderjs_ui_page_zuite/testPageFrontSearchModuleList.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_zuite/testPageFrontSearchModuleList.zpt
.../renderjs_ui_page_zuite/testPageFrontSearchModuleList.zpt
+60
-0
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.html
View file @
6daac17e
...
...
@@ -2,6 +2,7 @@
<html>
<!--
data-i18n=Title
data-i18n=Domain
-->
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
...
...
@@ -13,6 +14,7 @@
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"jiodev.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_global.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_erp5_page_front.js"
type=
"text/javascript"
></script>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.xml
View file @
6daac17e
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
54.5909.42680.32921
</string>
</value>
<value>
<string>
9
65.28992.43927.42052
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1
474563730.2
</float>
<float>
1
518424688.54
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.js
View file @
6daac17e
/*global window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
)
{
/*global window, rJS
, jIO, RSVP
*/
/*jslint nomen: true, indent: 2, maxerr: 3
, maxlen: 80
*/
(
function
(
window
,
rJS
,
jIO
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
)
...
...
@@ -10,6 +10,7 @@
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
/////////////////////////////////////////////////////////////////
// declared methods
...
...
@@ -19,19 +20,67 @@
})
.
allowPublicAcquisition
(
'
getUrlFor
'
,
function
(
argument_list
)
{
if
(
argument_list
[
0
].
command
===
'
index
'
)
{
return
this
.
getUrlFor
({
command
:
'
display_stored_state
'
,
options
:
{
jio_key
:
argument_list
[
0
].
options
.
jio_key
}});
return
this
.
getUrlFor
({
command
:
'
display_stored_state
'
,
options
:
{
jio_key
:
argument_list
[
0
].
options
.
jio_key
}
});
}
return
this
.
getUrlFor
.
apply
(
this
,
argument_list
);
})
.
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
[[
'
title
'
,
'
ascending
'
]];
.
allowPublicAcquisition
(
'
jio_allDocs
'
,
function
(
argument_list
)
{
// ERP5 does not support filtering/sorting on translated properties
// Fetch the list of all modules from ERP5
// and filter/sort it manually after
var
allDocs_options
=
argument_list
[
0
],
select_list
=
[
'
translated_title
'
,
'
business_application_translated_title
'
,
'
uid
'
,
'
id
'
,
'
title
'
,
'
__id
'
],
new_allDocs_options
=
{
limit
:
allDocs_options
.
limit
,
query
:
'
(parent_uid:"0" AND meta_type:"ERP5 Folder" AND id:"%_module")
'
,
select_list
:
select_list
,
sort_on
:
[]
},
context
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
context
.
jio_allDocs
(
new_allDocs_options
),
context
.
getUrlParameter
(
'
extended_search
'
)
]);
})
.
push
(
function
(
result_list
)
{
var
data_rows
=
[],
i
,
len
=
result_list
[
0
].
data
.
total_rows
,
query
=
result_list
[
1
]
||
""
;
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
// queries do not accept null value
result_list
[
0
].
data
.
rows
[
i
].
value
.
business_application_translated_title
=
result_list
[
0
].
data
.
rows
[
i
].
value
.
business_application_translated_title
||
''
;
result_list
[
0
].
data
.
rows
[
i
].
value
.
id
=
result_list
[
0
].
data
.
rows
[
i
].
id
;
data_rows
.
push
(
result_list
[
0
].
data
.
rows
[
i
].
value
);
}
return
result
;
return
jIO
.
QueryFactory
.
create
(
query
)
.
exec
(
data_rows
,
{
query
:
query
,
select_list
:
select_list
,
sort_on
:
allDocs_options
.
sort_on
});
})
.
push
(
function
(
document_list
)
{
var
len
=
document_list
.
length
,
i
,
result
=
[];
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
result
.
push
({
id
:
document_list
[
i
].
id
,
value
:
document_list
[
i
]});
}
return
{
data
:
{
rows
:
result
,
total_rows
:
len
}};
});
})
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
var
argument_list
=
arguments
;
return
this
.
getDeclaredGadget
(
'
form_list
'
)
...
...
@@ -53,7 +102,9 @@
})
.
push
(
function
(
form_gadget
)
{
var
column_list
=
[
[
'
translated_title
'
,
'
Title
'
]];
[
'
translated_title
'
,
'
Title
'
],
[
'
business_application_translated_title
'
,
'
Domain
'
]
];
return
form_gadget
.
render
({
erp5_document
:
{
"
_embedded
"
:
{
"
_view
"
:
{
"
listbox
"
:
{
...
...
@@ -65,10 +116,13 @@
"
key
"
:
"
field_listbox
"
,
"
lines
"
:
1000
,
"
list_method
"
:
"
portal_catalog
"
,
"
query
"
:
"
urn:jio:allDocs?query=parent_uid%3A%220%22%20AND%20meta_type%3A%22ERP5%20Folder%22%20AND%20id%3A%22%25_module%22
"
,
"
query
"
:
"
urn:jio:allDocs?query=parent_uid%3A%220%22%20AND
"
+
"
%20meta_type%3A%22ERP5%20Folder%22%20AND
"
+
"
%20id%3A%22%25_module%22
"
,
"
portal_type
"
:
[],
"
search_column_list
"
:
column_list
,
"
sort_column_list
"
:
column_list
,
"
sort
"
:
[[
"
translated_title
"
,
"
ASC
"
]],
"
title
"
:
"
Modules
"
,
"
type
"
:
"
ListBox
"
}
...
...
@@ -88,4 +142,4 @@
});
});
});
}(
window
,
rJS
));
\ No newline at end of file
}(
window
,
rJS
,
jIO
,
RSVP
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
View file @
6daac17e
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
59.26374.14159.14984
</string>
</value>
<value>
<string>
9
65.29083.22768.16418
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
1
497280148.2
</float>
<float>
1
518429915.13
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_zuite/testPageFrontSearchModuleList.xml
0 → 100644
View file @
6daac17e
<?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>
testPageFrontSearchModuleList
</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_page_zuite/testPageFrontSearchModuleList.zpt
0 → 100644
View file @
6daac17e
<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 Page Front
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test Page Front
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<!-- Go to the list of modules and check that it is possible to search -->
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/renderjs_runner/#/?page=front
</td>
<td></td>
</tr>
<!-- Wait for gadget to be loaded -->
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_front.html']
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded"
/>
<!-- All entries to module -->
<tr>
<td>
assertElementPresent
</td>
<td>
//div[@data-gadget-scope='m']//a[text()='Bars' and contains(@href, '#!display_stored_state') and contains(@href, 'n.jio_key=bar_module')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[@data-gadget-scope='m']//a[text()='Foos' and contains(@href, '#!display_stored_state') and contains(@href, 'n.jio_key=foo_module')]
</td>
<td></td>
</tr>
<tal:block
tal:define=
"search_query python: 'Foos'"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list"
/>
</tal:block>
<!-- Less entries to module -->
<tr>
<td>
assertElementNotPresent
</td>
<td>
//div[@data-gadget-scope='m']//a[text()='Bars' and contains(@href, '#!display_stored_state') and contains(@href, 'n.jio_key=bar_module')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[@data-gadget-scope='m']//a[text()='Foos' and contains(@href, '#!display_stored_state') and contains(@href, 'n.jio_key=foo_module')]
</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