Commit d7b7edcc authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Create a function

This commit does not change the behaviour of the gadget.

The goal is only to make the next commit more readable.
parent 2eb01519
...@@ -120,12 +120,14 @@ ...@@ -120,12 +120,14 @@
}) })
.declareMethod('allDocs', function (options) { .declareMethod('allDocs', function (options) {
var context = this;
// throw new Error('do not use all docs'); // throw new Error('do not use all docs');
if (options.list_method_template === undefined) { if (options.list_method_template === undefined) {
return wrapJioCall(this, 'allDocs', arguments); return wrapJioCall(this, 'allDocs', arguments);
} }
function triggerAllDocs() {
var query = options.query, var query = options.query,
i, i,
key, key,
...@@ -217,7 +219,7 @@ ...@@ -217,7 +219,7 @@
options.selection_domain = selection_domain; options.selection_domain = selection_domain;
return wrapJioCall( return wrapJioCall(
this, context,
'getAttachment', 'getAttachment',
[ [
// XXX Ugly hardcoded meaningless id... // XXX Ugly hardcoded meaningless id...
...@@ -226,7 +228,10 @@ ...@@ -226,7 +228,10 @@
.expand(options), .expand(options),
{format: "json"} {format: "json"}
] ]
) );
}
return triggerAllDocs()
.push(function (catalog_json) { .push(function (catalog_json) {
var data = catalog_json._embedded.contents || [], var data = catalog_json._embedded.contents || [],
summary = catalog_json._embedded.sum || [], summary = catalog_json._embedded.sum || [],
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>970.5239.3705.62003</string> </value> <value> <string>975.47596.63165.63232</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>1536227971.17</float> <float>1557912100.81</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment