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
Hamza
erp5
Commits
eb39ffef
Commit
eb39ffef
authored
Sep 05, 2019
by
Sven Franck
Committed by
Romain Courteaud
Sep 06, 2019
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 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
,
document
)
{
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
,
document
,
Boolean
)
{
"
use strict
"
;
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
),
var
gadget_klass
=
rJS
(
window
),
...
@@ -52,7 +52,8 @@
...
@@ -52,7 +52,8 @@
// get categories and flatten array of category arrays
// get categories and flatten array of category arrays
categories
=
softwares
categories
=
softwares
.
map
((
obj
)
=>
obj
.
value
.
category_list
)
.
map
((
obj
)
=>
obj
.
value
.
category_list
)
.
reduce
((
cur
,
prev
)
=>
cur
.
concat
(
prev
)),
.
reduce
((
cur
,
prev
)
=>
cur
.
concat
(
prev
))
.
filter
(
Boolean
),
// remove duplicates (case sensitive!)
// remove duplicates (case sensitive!)
unique_categories
=
Array
.
from
(
new
Set
(
categories
)),
unique_categories
=
Array
.
from
(
new
Set
(
categories
)),
...
@@ -86,7 +87,7 @@
...
@@ -86,7 +87,7 @@
};
};
});
});
});
});
return
RSVP
.
all
(
softwares_by_category
);
return
RSVP
.
all
(
softwares_by_category
);
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
...
@@ -99,4 +100,4 @@
...
@@ -99,4 +100,4 @@
masonry_container
.
innerHTML
=
content
;
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 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1
496170069.03
</float>
<float>
1
567678787.12
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs_afs_directory/PathTemplateItem/web_page_module/gadget_erp5_page_afs_publisher_js.js
View file @
eb39ffef
...
@@ -3,7 +3,12 @@
...
@@ -3,7 +3,12 @@
(
function
(
window
,
RSVP
,
rJS
,
Handlebars
,
jIO
)
{
(
function
(
window
,
RSVP
,
rJS
,
Handlebars
,
jIO
)
{
"
use strict
"
;
"
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
,
templater
=
gadget_klass
.
__template_element
,
display_widget_table
=
Handlebars
.
compile
(
display_widget_table
=
Handlebars
.
compile
(
templater
.
getElementById
(
"
display-template
"
).
innerHTML
templater
.
getElementById
(
"
display-template
"
).
innerHTML
...
@@ -30,47 +35,45 @@
...
@@ -30,47 +35,45 @@
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
gadget
=
this
;
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
return
gadget
.
jio_get
(
options
.
jio_key
)
.
push
(
function
()
{
return
gadget
.
jio_get
(
options
.
jio_key
);
})
.
push
(
function
(
publisher
)
{
.
push
(
function
(
publisher
)
{
// https://en.wikipedia.org/api/rest_v1/
var
wiki_list
=
[];
// only works in for english
var
wikipedia_api_url
=
'
https://en.wikipedia.org/api/rest_v1/page/summary/
'
,
wiki_list
=
[];
publisher
.
free_software_list
.
map
(
function
(
software
)
{
publisher
.
free_software_list
.
map
(
function
(
software
)
{
if
(
software
.
commercial_support
===
"
N/A
"
)
{
if
(
EMPTY
.
includes
(
software
.
commercial_support
)
)
{
delete
software
.
commercial_support
;
delete
software
.
commercial_support
;
}
}
if
(
software
.
logo
===
"
N/A
"
||
software
.
logo
===
""
)
{
if
(
EMPTY
.
includes
(
software
.
logo
)
)
{
software
.
logo
=
'
gadget_erp5_afs_camera.png?format=png
'
;
software
.
logo
=
FALLBACK_SOFTWARE_LOGO_PATH
;
}
}
if
(
software
.
success_case_list
.
length
===
0
||
if
(
EMPTY
.
includes
(
software
.
success_case_list
)
||
software
.
success_case_list
===
"
N/A
"
||
EMPTY
.
includes
(
software
.
success_case_list
.
length
)
software
.
success_case_list
[
0
].
title
===
"
N/A
"
||
)
{
software
.
success_case_list
[
0
].
title
===
""
)
{
delete
software
.
success_case_list
;
delete
software
.
success_case_list
;
}
else
{
}
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
);
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
;
delete
software
.
wikipedia_url
;
}
else
{
}
else
{
wiki_list
.
push
(
wiki_list
.
push
(
new
RSVP
.
Queue
()
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
return
jIO
.
util
.
ajax
({
return
jIO
.
util
.
ajax
({
type
:
"
GET
"
,
type
:
GET
,
headers
:
{
"
api-user-agent
"
:
"
https://www.nexedi.com/contact
"
}
,
headers
:
HEADERS_DICT
,
url
:
wikipedia_api_url
+
software
.
wikipedia_url
.
split
(
"
/
"
).
pop
()
url
:
WIKI_URL
+
software
.
wikipedia_url
.
split
(
"
/
"
).
pop
()
});
});
})
})
.
push
(
function
(
my_content
)
{
.
push
(
function
(
my_content
)
{
var
response
=
my_content
.
target
.
response
||
my_content
.
target
.
responseText
;
return
JSON
.
parse
(
return
JSON
.
parse
(
response
).
extract
;
my_content
.
target
.
response
||
my_content
.
target
.
responseText
).
extract
;
},
function
()
{
},
function
()
{
return
undefined
;
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 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1
496067089.61
</float>
<float>
1
567678597.73
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs_afs_directory_ui_test/PathTemplateItem/portal_tests/afs_ui_zuite/testAfsRenderjsListNavigation.zpt
View file @
eb39ffef
...
@@ -9,10 +9,10 @@
...
@@ -9,10 +9,10 @@
<thead>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test RenderJS UI
</td></tr>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test RenderJS UI
</td></tr>
</thead><tbody>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<!-- Clean Up -->
<!-- Clean Up -->
<tr>
<
!--
tr>
<td>open</td>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
<td></td>
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<td>assertTextPresent</td>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td>Reset Successfully.</td>
<td></td>
<td></td>
</tr>
</tr
--
>
<!-- Initialize -->
<!-- Initialize -->
<tr>
<tr>
...
@@ -232,7 +232,7 @@
...
@@ -232,7 +232,7 @@
</tr>
</tr>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//span[text()='
1
Records']
</td>
<td>
//span[text()='
2
Records']
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
...
...
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