Commit a6b66734 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: avoid useless queries to catalog

parent cd9bbb5c
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>994.9738.18277.17732</string> </value> <value> <string>1007.8683.53031.17203</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1629923258.92</float> <float>1679162359.14</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -982,6 +982,7 @@ ...@@ -982,6 +982,7 @@
loading_element.textContent = ''; loading_element.textContent = '';
tbody_classList.add(disabled_class); tbody_classList.add(disabled_class);
} }
return gadget.fetchLineContent(false); return gadget.fetchLineContent(false);
}); });
...@@ -1219,15 +1220,6 @@ ...@@ -1219,15 +1220,6 @@
loading_element_classList.remove.apply(loading_element_classList, loading_class_list); loading_element_classList.remove.apply(loading_element_classList, loading_class_list);
loading_element.textContent = '(' + pagination_message + ')'; loading_element.textContent = '(' + pagination_message + ')';
} }
// XXX if is duplicated. Look at line 1222
if (gadget.state.enable_graphic && ((
gadget.state.graphic_type && !gadget.state.extended_search && gadget.state.only_graphic
) || (gadget.state.graphic_type && gadget.state.extended_search &&
gadget.state.only_graphic))) {
domsugar(gadget.element.querySelector(".graphic_section"), [
domsugar("div", {"class": "graphic_area"})
]);
}
}); });
}); });
if (gadget.state.enable_graphic && (( if (gadget.state.enable_graphic && ((
...@@ -1237,6 +1229,9 @@ ...@@ -1237,6 +1229,9 @@
))) { ))) {
result_queue result_queue
.push(function () { .push(function () {
domsugar(gadget.element.querySelector(".graphic_section"), [
domsugar("div", {"class": "graphic_area"})
]);
return gadget.declareGadget('gadget_graphic.html', { return gadget.declareGadget('gadget_graphic.html', {
scope: 'gadget_graphic', scope: 'gadget_graphic',
element: gadget.element.querySelector(".graphic_area") element: gadget.element.querySelector(".graphic_area")
...@@ -1395,6 +1390,17 @@ ...@@ -1395,6 +1390,17 @@
aggregation_option_list.push("count"); aggregation_option_list.push("count");
} }
if (gadget.state.only_graphic) {
return gadget.changeState({
allDocs_result: JSON.stringify({
"data": {
"rows": [],
"total_rows": 0
}
})
});
}
return gadget.jio_allDocs({ return gadget.jio_allDocs({
// XXX Not jIO compatible, but until a better api is found... // XXX Not jIO compatible, but until a better api is found...
"list_method_template": this.state.list_method_template, "list_method_template": this.state.list_method_template,
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1007.5849.9718.43042</string> </value> <value> <string>1007.11433.56639.58675</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1678989684.55</float> <float>1679324833.76</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