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

erp5_web_renderjs_ui: few improvements

parent 8f5c527d
...@@ -160,35 +160,66 @@ ...@@ -160,35 +160,66 @@
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]
}; };
sub_query_list.push(new SimpleQuery({
key: "selection_domain_" + domain_id, if (extended_search_domain_list.length > 0) {
operator: "", for (j = 0; j < extended_search_domain_list.length; j += 1) {
type: "simple", if (extended_search_domain_list[j].key === "selection_domain_" + domain_id &&
value: domain_list[i] extended_search_domain_list[j].value === domain_list[i]) {
})); sub_query_list.push(new SimpleQuery({
query_list.push({ key: extended_search_domain_list[j].key,
"query": Query.objectToSearchText(new ComplexQuery({ operator: "",
operator: "AND", type: "simple",
query_list: jio_query_list.concat(sub_query_list), value: extended_search_domain_list[j].value
type: "complex" }));
})), }
"list_method_template": options.list_method_template, }
"list_method": options.list_method, } else {
"relative_url": options.relative_url, sub_query_list.push(new SimpleQuery({
"group_by": group_by, key: "selection_domain_" + domain_id,
"select_list": select_list operator: "",
}); type: "simple",
sub_query_list = []; value: domain_list[i]
}));
}
if (sub_query_list.length > 0) {
query_list.push({
"query": Query.objectToSearchText(new ComplexQuery({
operator: "AND",
query_list: jio_query_list.concat(sub_query_list),
type: "complex"
})),
"list_method_template": options.list_method_template,
"list_method": options.list_method,
"relative_url": options.relative_url,
"group_by": group_by,
"select_list": select_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