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
Matevz Golob
erp5
Commits
6aed2a71
Commit
6aed2a71
authored
Oct 15, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Warmup most used gadgets in ERP5 Form
Do the calculations while ERP5 renders the form in JSON
parent
4687f745
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
4 deletions
+51
-4
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
...plateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
+48
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
...lateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
+3
-3
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
View file @
6aed2a71
...
@@ -7,6 +7,34 @@ and handling data send&receive.
...
@@ -7,6 +7,34 @@ and handling data send&receive.
(
function
(
window
,
document
,
rJS
,
URI
,
RSVP
,
jIO
,
Blob
,
URL
,
asBoolean
)
{
(
function
(
window
,
document
,
rJS
,
URI
,
RSVP
,
jIO
,
Blob
,
URL
,
asBoolean
)
{
"
use strict
"
;
"
use strict
"
;
var
warmup_gadget_done
=
false
,
warmup_list
=
[
'
gadget_erp5_label_field.html
'
,
'
gadget_erp5_pt_form_list.html
'
,
'
gadget_erp5_pt_form_dialog.html
'
,
'
gadget_erp5_pt_form_view_editable.html
'
,
'
gadget_erp5_pt_form_view.html
'
,
'
gadget_erp5_pt_embedded_form_render.html
'
,
'
gadget_html5_input.html
'
,
'
gadget_html5_textarea.html
'
,
'
gadget_html5_input.html
'
,
'
gadget_html5_select.html
'
,
'
gadget_html5_element.html
'
,
'
gadget_erp5_field_datetime.html
'
,
'
gadget_erp5_field_float.html
'
,
'
gadget_erp5_field_integer.html
'
,
'
gadget_erp5_field_list.html
'
,
'
gadget_erp5_field_email.html
'
,
'
gadget_erp5_field_formbox.html
'
,
'
gadget_erp5_field_listbox.html
'
,
'
gadget_erp5_field_multilist.html
'
,
'
gadget_erp5_field_relationstring.html
'
,
'
gadget_erp5_field_multirelationstring.html
'
,
'
gadget_erp5_relation_input.html
'
,
'
gadget_erp5_field_string.html
'
,
'
gadget_erp5_field_textarea.html
'
,
'
gadget_erp5_form.html
'
];
/** Return local modifications to editable form fields after leaving the form
/** Return local modifications to editable form fields after leaving the form
for a while - for example selecting a related object.
for a while - for example selecting a related object.
...
@@ -132,7 +160,26 @@ and handling data send&receive.
...
@@ -132,7 +160,26 @@ and handling data send&receive.
}
else
{
}
else
{
promise_queue
promise_queue
.
push
(
function
()
{
.
push
(
function
()
{
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
options
.
view
);
var
result
=
gadget
.
jio_getAttachment
(
options
.
jio_key
,
options
.
view
),
i
;
if
(
!
warmup_gadget_done
)
{
// In order to speed up initial form rendering,
// preload most used gadgets while waiting for ERP5 form
// calculation
// Wait a big for the ajax query to be triggered
RSVP
.
delay
(
10
)
.
then
(
function
()
{
for
(
i
=
0
;
i
<
warmup_list
.
length
;
i
+=
1
)
{
// No need to check the result, as it will fail later
// when rJS will try to instanciate one of this gadget
rJS
.
declareGadgetKlass
(
rJS
.
getAbsoluteURL
(
warmup_list
[
i
],
gadget
.
__path
));
}
});
warmup_gadget_done
=
true
;
}
return
result
;
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
new_state
.
erp5_document
=
result
;
new_state
.
erp5_document
=
result
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
View file @
6aed2a71
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
66.9690.7007.3899
7
</string>
</value>
<value>
<string>
9
70.64578.22606.1810
7
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,8 +248,8 @@
...
@@ -248,8 +248,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15
20945628.31
</float>
<float>
15
39702055.43
</float>
<string>
GMT+1
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
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