Commit d9fbf632 authored by Roque's avatar Roque

erp5_web_project_ui: include project objects by project-lines relation

parent 9510f936
Pipeline #7254 failed with stage
in 0 seconds
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
return view_list.filter(d => d.name === name)[0].href; return view_list.filter(d => d.name === name)[0].href;
} }
function setLatestTestResult(gadget, project_title, svg_element) { function setLatestTestResult(gadget, project_title, svg_element, project_id) {
var query = createProjectQuery(project_title, var query = createProjectQuery(project_id,
[["portal_type", "Test Result"]]); [["portal_type", "Test Result"]]);
return gadget.jio_allDocs({ return gadget.jio_allDocs({
query: query, query: query,
...@@ -73,15 +73,27 @@ ...@@ -73,15 +73,27 @@
}); });
} }
function createProjectQuery(project_title, key_value_list) { function createProjectQuery(project_jio_key, key_value_list) {
var i, query_list = []; var i, query_list = [], id_query_list = [], id_complex_query;
if (project_title) { if (project_jio_key) {
query_list.push(new SimpleQuery({ id_query_list.push(new SimpleQuery({
key: "source_project_title", key: "source_project__relative_url",
operator: "", operator: "",
type: "simple", type: "simple",
value: project_title value: project_jio_key
})); }));
id_query_list.push(new SimpleQuery({
key: "source_project__relative_url",
operator: "",
type: "simple",
value: project_jio_key + "/%%"
}));
id_complex_query = new ComplexQuery({
operator: "OR",
query_list: id_query_list,
type: "complex"
});
query_list.push(id_complex_query);
} }
for (i = 0; i < key_value_list.length; i += 1) { for (i = 0; i < key_value_list.length; i += 1) {
query_list.push(new SimpleQuery({ query_list.push(new SimpleQuery({
...@@ -222,23 +234,23 @@ ...@@ -222,23 +234,23 @@
null, createProjectQuery(null, [["selection_domain_date_milestone_domain", "future"]])), null, createProjectQuery(null, [["selection_domain_date_milestone_domain", "future"]])),
getUrlParameterDict('task_module', "view", [["delivery.start_date", "descending"]], getUrlParameterDict('task_module', "view", [["delivery.start_date", "descending"]],
["title", "delivery.start_date", "source_title"], ["title", "delivery.start_date", "source_title"],
createProjectQuery(modification_dict.project_title, createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_task_domain", "confirmed"]])), [["selection_domain_state_task_domain", "confirmed"]])),
getUrlParameterDict('support_request_module', "view", [["delivery.start_date", "descending"]], getUrlParameterDict('support_request_module', "view", [["delivery.start_date", "descending"]],
null, createProjectQuery(modification_dict.project_title, null, createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_support_domain", "validated"]])), [["selection_domain_state_support_domain", "validated"]])),
getUrlParameterDict('bug_module', "view", [["delivery.start_date", "descending"]], getUrlParameterDict('bug_module', "view", [["delivery.start_date", "descending"]],
["title", "description", "source_person_title", "destination_person_title", "delivery.start_date"], ["title", "description", "source_person_title", "destination_person_title", "delivery.start_date"],
createProjectQuery(modification_dict.project_title, createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_bug_domain", "open"]])), [["selection_domain_state_bug_domain", "open"]])),
getUrlParameterDict('task_report_module', 'view', [["delivery.start_date", "descending"]], getUrlParameterDict('task_report_module', 'view', [["delivery.start_date", "descending"]],
["title", "delivery.start_date", "source_title"], ["title", "delivery.start_date", "source_title"],
createProjectQuery(modification_dict.project_title, createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_task_report_domain", "confirmed"]])), [["selection_domain_state_task_report_domain", "confirmed"]])),
getUrlParameterDict('test_result_module', 'view', [["delivery.start_date", "descending"]], getUrlParameterDict('test_result_module', 'view', [["delivery.start_date", "descending"]],
null, createProjectQuery(modification_dict.project_title, [])), null, createProjectQuery(modification_dict.jio_key, [])),
getUrlParameterDict('test_suite_module', 'view', [["creation_date", "descending"]], getUrlParameterDict('test_suite_module', 'view', [["creation_date", "descending"]],
null, createProjectQuery(modification_dict.project_title, [])), null, createProjectQuery(modification_dict.jio_key, [["translated_validation_state_title", "validated"]])),
getUrlParameterDict(web_page_info.id, web_page_info.edit_view), getUrlParameterDict(web_page_info.id, web_page_info.edit_view),
getUrlParameterDict(modification_dict.jio_key, document_view, [["modification_date", "descending"]], getUrlParameterDict(modification_dict.jio_key, document_view, [["modification_date", "descending"]],
["download", "title", "reference", "modification_date"], createProjectQuery(null, [["selection_domain_state_document_domain", "confirmed"]])), ["download", "title", "reference", "modification_date"], createProjectQuery(null, [["selection_domain_state_document_domain", "confirmed"]])),
...@@ -259,7 +271,7 @@ ...@@ -259,7 +271,7 @@
enableLink(document.getElementById("document_link"), url_list[8]); enableLink(document.getElementById("document_link"), url_list[8]);
enableLink(document.getElementById("activity_link"), url_list[9]); enableLink(document.getElementById("activity_link"), url_list[9]);
setLatestTestResult(gadget, modification_dict.project_title, setLatestTestResult(gadget, modification_dict.project_title,
document.getElementById("test_result_svg")); document.getElementById("test_result_svg"), modification_dict.jio_key);
}); });
}) })
......
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