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
Labels
Merge Requests
139
Merge Requests
139
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
eb39ffef
Commit
eb39ffef
authored
Sep 05, 2019
by
Sven Franck
Committed by
Romain Courteaud
Sep 06, 2019
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_officejs_afs_directory] Fix slowness occuring when increasing the data size
parent
3c810f5b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
37 deletions
+41
-37
bt5/erp5_officejs_afs_directory/PathTemplateItem/web_page_module/gadget_erp5_page_afs_directory_js.js
...Item/web_page_module/gadget_erp5_page_afs_directory_js.js
+6
-5
bt5/erp5_officejs_afs_directory/PathTemplateItem/web_page_module/gadget_erp5_page_afs_directory_js.xml
...tem/web_page_module/gadget_erp5_page_afs_directory_js.xml
+2
-2
bt5/erp5_officejs_afs_directory/PathTemplateItem/web_page_module/gadget_erp5_page_afs_publisher_js.js
...Item/web_page_module/gadget_erp5_page_afs_publisher_js.js
+27
-24
bt5/erp5_officejs_afs_directory/PathTemplateItem/web_page_module/gadget_erp5_page_afs_publisher_js.xml
...tem/web_page_module/gadget_erp5_page_afs_publisher_js.xml
+2
-2
bt5/erp5_officejs_afs_directory_ui_test/PathTemplateItem/portal_tests/afs_ui_zuite/testAfsRenderjsListNavigation.zpt
...rtal_tests/afs_ui_zuite/testAfsRenderjsListNavigation.zpt
+4
-4
No files found.
bt5/erp5_officejs_afs_directory/PathTemplateItem/web_page_module/gadget_erp5_page_afs_directory_js.js
View file @
eb39ffef
/*global window, rJS, RSVP, Handlebars, URI, console, jIO, document */
/*global window, rJS, RSVP, Handlebars, URI, console, jIO, document
, Boolean
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
,
document
)
{
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
,
document
,
Boolean
)
{
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
),
...
...
@@ -52,7 +52,8 @@
// get categories and flatten array of category arrays
categories
=
softwares
.
map
((
obj
)
=>
obj
.
value
.
category_list
)
.
reduce
((
cur
,
prev
)
=>
cur
.
concat
(
prev
)),
.
reduce
((
cur
,
prev
)
=>
cur
.
concat
(
prev
))
.
filter
(
Boolean
),
// remove duplicates (case sensitive!)
unique_categories
=
Array
.
from
(
new
Set
(
categories
)),
...
...
@@ -86,7 +87,7 @@
};
});
});
return
RSVP
.
all
(
softwares_by_category
);
})
.
push
(
function
(
result
)
{
...
...
@@ -99,4 +100,4 @@
masonry_container
.
innerHTML
=
content
;
});
});
}(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
,
document
));
}(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
,
document
,
Boolean
));
bt5/erp5_officejs_afs_directory/PathTemplateItem/web_page_module/gadget_erp5_page_afs_directory_js.xml
View file @
eb39ffef
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
59.46981.52420.6418
7
</string>
</value>
<value>
<string>
9
78.14093.21437.3201
7
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
1
496170069.03
</float>
<float>
1
567678787.12
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_afs_directory/PathTemplateItem/web_page_module/gadget_erp5_page_afs_publisher_js.js
View file @
eb39ffef
...
...
@@ -3,7 +3,12 @@
(
function
(
window
,
RSVP
,
rJS
,
Handlebars
,
jIO
)
{
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
),
var
WIKI_URL
=
"
https://en.wikipedia.org/api/rest_v1/page/summary/
"
,
EMPTY
=
[
"
N/A
"
,
""
,
0
],
FALLBACK_SOFTWARE_LOGO_PATH
=
"
gadget_erp5_afs_camera.png?format=png
"
,
GET
=
"
GET
"
,
HEADERS_DICT
=
{
"
api-user-agent
"
:
"
https://www.nexedi.com/contact
"
},
gadget_klass
=
rJS
(
window
),
templater
=
gadget_klass
.
__template_element
,
display_widget_table
=
Handlebars
.
compile
(
templater
.
getElementById
(
"
display-template
"
).
innerHTML
...
...
@@ -30,47 +35,45 @@
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
jio_get
(
options
.
jio_key
);
})
return
gadget
.
jio_get
(
options
.
jio_key
)
.
push
(
function
(
publisher
)
{
// https://en.wikipedia.org/api/rest_v1/
// only works in for english
var
wikipedia_api_url
=
'
https://en.wikipedia.org/api/rest_v1/page/summary/
'
,
wiki_list
=
[];
var
wiki_list
=
[];
publisher
.
free_software_list
.
map
(
function
(
software
)
{
if
(
software
.
commercial_support
===
"
N/A
"
)
{
if
(
EMPTY
.
includes
(
software
.
commercial_support
)
)
{
delete
software
.
commercial_support
;
}
if
(
software
.
logo
===
"
N/A
"
||
software
.
logo
===
""
)
{
software
.
logo
=
'
gadget_erp5_afs_camera.png?format=png
'
;
if
(
EMPTY
.
includes
(
software
.
logo
)
)
{
software
.
logo
=
FALLBACK_SOFTWARE_LOGO_PATH
;
}
if
(
software
.
success_case_list
.
length
===
0
||
software
.
success_case_list
===
"
N/A
"
||
software
.
success_case_list
[
0
].
title
===
"
N/A
"
||
software
.
success_case_list
[
0
].
title
===
""
)
{
if
(
EMPTY
.
includes
(
software
.
success_case_list
)
||
EMPTY
.
includes
(
software
.
success_case_list
.
length
)
)
{
delete
software
.
success_case_list
;
}
else
{
software
.
success_case_list
=
software
.
success_case_list
.
filter
(
function
(
entry
)
{
if
(
!!
EMPTY
.
includes
(
entry
.
title
))
{
return
entry
;
}
});
software
.
success_case_list
=
clean
(
software
.
success_case_list
);
}
if
(
software
.
wikipedia_url
===
"
N/A
"
)
{
if
(
EMPTY
.
includes
(
software
.
wikipedia_url
)
)
{
delete
software
.
wikipedia_url
;
}
else
{
wiki_list
.
push
(
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
jIO
.
util
.
ajax
({
type
:
"
GET
"
,
headers
:
{
"
api-user-agent
"
:
"
https://www.nexedi.com/contact
"
}
,
url
:
wikipedia_api_url
+
software
.
wikipedia_url
.
split
(
"
/
"
).
pop
()
type
:
GET
,
headers
:
HEADERS_DICT
,
url
:
WIKI_URL
+
software
.
wikipedia_url
.
split
(
"
/
"
).
pop
()
});
})
.
push
(
function
(
my_content
)
{
var
response
=
my_content
.
target
.
response
||
my_content
.
target
.
responseText
;
return
JSON
.
parse
(
response
).
extract
;
return
JSON
.
parse
(
my_content
.
target
.
response
||
my_content
.
target
.
responseText
).
extract
;
},
function
()
{
return
undefined
;
})
...
...
bt5/erp5_officejs_afs_directory/PathTemplateItem/web_page_module/gadget_erp5_page_afs_publisher_js.xml
View file @
eb39ffef
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
59.45186.37882.22272
</string>
</value>
<value>
<string>
9
78.15194.20575.26129
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
1
496067089.61
</float>
<float>
1
567678597.73
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_afs_directory_ui_test/PathTemplateItem/portal_tests/afs_ui_zuite/testAfsRenderjsListNavigation.zpt
View file @
eb39ffef
...
...
@@ -9,10 +9,10 @@
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test RenderJS UI
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<!-- Clean Up -->
<tr>
<
!--
tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
...
...
@@ -21,7 +21,7 @@
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
</tr
--
>
<!-- Initialize -->
<tr>
...
...
@@ -232,7 +232,7 @@
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//span[text()='
1
Records']
</td>
<td>
//span[text()='
2
Records']
</td>
<td></td>
</tr>
<tr>
...
...
Jérome Perrin
@jerome
mentioned in commit
c1d27830
·
Sep 10, 2019
mentioned in commit
c1d27830
mentioned in commit c1d2783044e5374182eb843cd953815e0d9acfc3
Toggle commit list
Jérome Perrin
@jerome
mentioned in commit
23561ba0
·
Sep 10, 2019
mentioned in commit
23561ba0
mentioned in commit 23561ba020ea07be8ec627e2464b2f45a7273628
Toggle commit list
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