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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
erp5
Commits
87b8fe07
Commit
87b8fe07
authored
Sep 20, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Reduce number of created Queue
parent
ee9ff19e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
68 deletions
+52
-68
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.js
...thTemplateItem/web_page_module/rjs_gadget_erp5_form_js.js
+13
-13
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
...hTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
...mplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
+35
-51
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
...plateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.js
View file @
87b8fe07
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
function
addField
(
field
,
rendered_document
,
form_definition
,
form_gadget
,
group_name
,
modification_dict
)
{
function
addField
(
field
,
rendered_document
,
form_definition
,
form_gadget
,
group_name
,
modification_dict
)
{
var
field_name
=
field
[
0
],
var
field_name
=
field
[
0
],
field_element
,
field_element
,
suboptions
;
suboptions
,
queue
;
if
(
!
rendered_document
.
hasOwnProperty
(
field_name
))
{
if
(
!
rendered_document
.
hasOwnProperty
(
field_name
))
{
return
;
return
;
...
@@ -45,18 +46,17 @@
...
@@ -45,18 +46,17 @@
}
}
field_element
=
document
.
createElement
(
"
div
"
);
field_element
=
document
.
createElement
(
"
div
"
);
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
modification_dict
.
hasOwnProperty
(
'
hash
'
))
{
var
rendered_field_name
=
rendered_document
[
field_name
].
key
;
queue
=
form_gadget
.
declareGadget
(
'
gadget_erp5_label_field.html
'
,
{
if
(
modification_dict
.
hasOwnProperty
(
'
hash
'
))
{
scope
:
rendered_document
[
field_name
].
key
,
// ugly! Should be just `field_name` but too many tests depend on it
return
form_gadget
.
declareGadget
(
'
gadget_erp5_label_field.html
'
,
{
element
:
field_element
,
scope
:
rendered_field_name
,
// ugly! Should be just `field_name` but too many tests depend on it
sandbox
:
"
public
"
element
:
field_element
,
});
sandbox
:
"
public
"
}
else
{
});
queue
=
form_gadget
.
getDeclaredGadget
(
rendered_document
[
field_name
].
key
);
}
}
return
form_gadget
.
getDeclaredGadget
(
rendered_field_name
);
return
queue
})
.
push
(
function
(
label_gadget
)
{
.
push
(
function
(
label_gadget
)
{
if
(
modification_dict
.
hasOwnProperty
(
'
hash
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
hash
'
))
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
View file @
87b8fe07
...
@@ -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
64.58561.19908.14080
</string>
</value>
<value>
<string>
9
70.11330.19298.59511
</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>
15
16274548.8
8
</float>
<float>
15
37454067.9
8
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
87b8fe07
...
@@ -8,21 +8,19 @@
...
@@ -8,21 +8,19 @@
var
MAIN_SCOPE
=
"
m
"
;
var
MAIN_SCOPE
=
"
m
"
;
function
renderMainGadget
(
gadget
,
url
,
options
)
{
function
renderMainGadget
(
gadget
,
url
,
options
)
{
var
page_gadget
;
return
gadget
.
declareGadget
(
url
,
{
return
gadget
.
declareGadget
(
url
,
{
scope
:
MAIN_SCOPE
scope
:
MAIN_SCOPE
})
})
.
push
(
function
(
page_gadget
)
{
.
push
(
function
(
result
)
{
page_gadget
=
result
;
gadget
.
props
.
m_options_string
=
JSON
.
stringify
(
options
);
gadget
.
props
.
m_options_string
=
JSON
.
stringify
(
options
);
if
(
page_gadget
.
render
=
==
undefined
)
{
if
(
page_gadget
.
render
!
==
undefined
)
{
return
[
page_gadget
]
;
return
page_gadget
.
render
(
options
)
;
}
}
return
RSVP
.
all
([
page_gadget
,
page_gadget
.
render
(
options
)
]);
})
})
.
push
(
function
(
all_result
)
{
.
push
(
function
()
{
return
all_result
[
0
]
;
return
page_gadget
;
});
});
}
}
...
@@ -67,42 +65,34 @@
...
@@ -67,42 +65,34 @@
}
}
function
increaseLoadingCounter
(
gadget
)
{
function
increaseLoadingCounter
(
gadget
)
{
return
new
RSVP
.
Queue
()
gadget
.
props
.
loading_counter
+=
1
;
.
push
(
function
()
{
if
(
gadget
.
props
.
loading_counter
===
1
)
{
gadget
.
props
.
loading_counter
+=
1
;
return
gadget
.
getDeclaredGadget
(
"
header
"
)
if
(
gadget
.
props
.
loading_counter
===
1
)
{
.
push
(
function
(
header_gadget
)
{
return
gadget
.
getDeclaredGadget
(
"
header
"
)
return
header_gadget
.
notifyLoading
();
.
push
(
function
(
header_gadget
)
{
});
return
header_gadget
.
notifyLoading
();
}
});
return
new
RSVP
.
Queue
();
}
});
}
}
function
decreaseLoadingCounter
(
gadget
)
{
function
decreaseLoadingCounter
(
gadget
)
{
return
new
RSVP
.
Queue
()
gadget
.
props
.
loading_counter
-=
1
;
.
push
(
function
()
{
if
(
gadget
.
props
.
loading_counter
<
0
)
{
gadget
.
props
.
loading_counter
-=
1
;
gadget
.
props
.
loading_counter
=
0
;
if
(
gadget
.
props
.
loading_counter
<
0
)
{
// throw new Error("Unexpected negative loading counter");
gadget
.
props
.
loading_counter
=
0
;
}
// throw new Error("Unexpected negative loading counter");
if
(
gadget
.
props
.
loading_counter
===
0
)
{
}
return
gadget
.
getDeclaredGadget
(
"
header
"
)
if
(
gadget
.
props
.
loading_counter
===
0
)
{
.
push
(
function
(
header_gadget
)
{
return
gadget
.
getDeclaredGadget
(
"
header
"
)
return
header_gadget
.
notifyLoaded
();
.
push
(
function
(
header_gadget
)
{
});
return
header_gadget
.
notifyLoaded
();
}
});
return
new
RSVP
.
Queue
();
}
});
}
}
function
callJioGadget
(
gadget
,
method
,
param_list
)
{
function
callJioGadget
(
gadget
,
method
,
param_list
)
{
var
called
=
false
;
var
called
=
true
;
return
new
RSVP
.
Queue
()
return
increaseLoadingCounter
(
gadget
)
.
push
(
function
()
{
called
=
true
;
return
increaseLoadingCounter
(
gadget
);
})
.
push
(
function
()
{
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
})
...
@@ -577,14 +567,11 @@
...
@@ -577,14 +567,11 @@
}
}
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
return
new
RSVP
.
Queue
()
return
renderMainGadget
(
.
push
(
function
()
{
gadget
,
return
renderMainGadget
(
route_result
.
url
,
gadget
,
route_result
.
options
route_result
.
url
,
)
route_result
.
options
);
})
.
push
(
function
(
main_gadget
)
{
.
push
(
function
(
main_gadget
)
{
// Append loaded gadget in the page
// Append loaded gadget in the page
if
(
main_gadget
!==
undefined
)
{
if
(
main_gadget
!==
undefined
)
{
...
@@ -637,10 +624,7 @@
...
@@ -637,10 +624,7 @@
// (ERP5 title by default + sidebar)
// (ERP5 title by default + sidebar)
initHeaderOptions
(
gadget
);
initHeaderOptions
(
gadget
);
initPanelOptions
(
gadget
);
initPanelOptions
(
gadget
);
return
new
RSVP
.
Queue
()
return
increaseLoadingCounter
(
gadget
)
.
push
(
function
()
{
return
increaseLoadingCounter
(
gadget
);
})
.
push
(
function
()
{
.
push
(
function
()
{
var
promise_list
=
[
var
promise_list
=
[
route
(
gadget
,
'
panel
'
,
'
close
'
),
route
(
gadget
,
'
panel
'
,
'
close
'
),
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
87b8fe07
...
@@ -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
68.42891.50280.153
</string>
</value>
<value>
<string>
9
70.25626.47614.53111
</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>
153
0622831.54
</float>
<float>
153
7451374.56
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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