Commit 2712a770 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: few improvements

parent 8f5c527d
...@@ -160,22 +160,53 @@ ...@@ -160,22 +160,53 @@
return gadget.getUrlParameter('extended_search') return gadget.getUrlParameter('extended_search')
.push(function (extended_search) { .push(function (extended_search) {
var query,
extended_search_domain_list = [];
if (extended_search) { if (extended_search) {
jio_query_list.push(Query.parseStringToObject(extended_search)); query = Query.parseStringToObject(extended_search);
if (query.type === "complex") {
for (i = 0; i < query.query_list.length; i += 1) {
if (query.query_list[i].key.indexOf("selection_domain_") === 0) {
extended_search_domain_list.push(query.query_list[i]);
} else {
jio_query_list.push(new SimpleQuery(query.query_list[i]));
}
}
} else {
jio_query_list.push(new SimpleQuery(query));
}
} }
if (domain_id) { if (domain_id) {
domain_list = options.layout.x.domain_list || []; domain_list = options.layout.x.domain_list || [];
for (i = 0; i < domain_list.length; i += 1) { for (i = 0; i < domain_list.length; i += 1) {
sub_query_list = [];
data.extended_search_mapping[column_list[i]] = { data.extended_search_mapping[column_list[i]] = {
"key": "selection_domain_" + domain_id, "key": "selection_domain_" + domain_id,
"value": domain_list[i] "value": domain_list[i]
}; };
if (extended_search_domain_list.length > 0) {
for (j = 0; j < extended_search_domain_list.length; j += 1) {
if (extended_search_domain_list[j].key === "selection_domain_" + domain_id &&
extended_search_domain_list[j].value === domain_list[i]) {
sub_query_list.push(new SimpleQuery({
key: extended_search_domain_list[j].key,
operator: "",
type: "simple",
value: extended_search_domain_list[j].value
}));
}
}
} else {
sub_query_list.push(new SimpleQuery({ sub_query_list.push(new SimpleQuery({
key: "selection_domain_" + domain_id, key: "selection_domain_" + domain_id,
operator: "", operator: "",
type: "simple", type: "simple",
value: domain_list[i] value: domain_list[i]
})); }));
}
if (sub_query_list.length > 0) {
query_list.push({ query_list.push({
"query": Query.objectToSearchText(new ComplexQuery({ "query": Query.objectToSearchText(new ComplexQuery({
operator: "AND", operator: "AND",
...@@ -188,7 +219,7 @@ ...@@ -188,7 +219,7 @@
"group_by": group_by, "group_by": group_by,
"select_list": select_list "select_list": select_list
}); });
sub_query_list = []; }
} }
data.query_list = query_list; data.query_list = query_list;
} else if (group_by instanceof Array && group_by.length > 1) { } else if (group_by instanceof Array && group_by.length > 1) {
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>997.50503.16089.7338</string> </value> <value> <string>997.52346.20864.10120</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1643288573.04</float> <float>1643321915.13</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