Commit da86f6d1 authored by Roque's avatar Roque

erp5_web_project_ui: constants

parent 56683e08
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
const STATUS_SPAN = "status"; const STATUS_SPAN = "status";
const TOTAL_SPAN = "total"; const TOTAL_SPAN = "total";
const OUTDATED_SPAN = "outdated"; const OUTDATED_SPAN = "outdated";
const QUERY_LIMIT = 100000;
//XXX hardcoded portal_type-title dict (build a template?) //XXX hardcoded portal_type-title dict (build a template?)
const PORTAL_TITLE_DICT = {"Task": "Tasks", const PORTAL_TITLE_DICT = {"Task": "Tasks",
"Test Result" : "Test Results", "Test Result" : "Test Results",
...@@ -70,7 +71,7 @@ ...@@ -70,7 +71,7 @@
} }
return gadget.jio_allDocs({ return gadget.jio_allDocs({
query: document_query, query: document_query,
limit: 10000, limit: QUERY_LIMIT,
select_list: ['source_project__relative_url', 'portal_type', 'count(*)'], select_list: ['source_project__relative_url', 'portal_type', 'count(*)'],
group_by: ['portal_type', 'source_project__relative_url'], group_by: ['portal_type', 'source_project__relative_url'],
sort_on: [["modification_date", "descending"]] sort_on: [["modification_date", "descending"]]
...@@ -87,7 +88,7 @@ ...@@ -87,7 +88,7 @@
"AND")); "AND"));
return gadget.jio_allDocs({ return gadget.jio_allDocs({
query: project_query, query: project_query,
limit: 10000, limit: QUERY_LIMIT,
select_list: ['title'], select_list: ['title'],
sort_on: [["modification_date", "ascending"]] sort_on: [["modification_date", "ascending"]]
}) })
...@@ -237,12 +238,13 @@ ...@@ -237,12 +238,13 @@
"parent__portal_type" : "Project"}, "parent__portal_type" : "Project"},
"AND")), "AND")),
milestone_limit_date = new Date(); milestone_limit_date = new Date();
//TODO Where to define/get the limit date? byt portal_type or the same for all documents?
milestone_limit_date.setFullYear(milestone_limit_date.getFullYear() - 1); milestone_limit_date.setFullYear(milestone_limit_date.getFullYear() - 1);
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return gadget.jio_allDocs({ return gadget.jio_allDocs({
query: milestone_query, query: milestone_query,
limit: 10000, limit: QUERY_LIMIT,
select_list: ["title", 'portal_type', "parent__title", "parent__relative_url"], select_list: ["title", 'portal_type', "parent__title", "parent__relative_url"],
sort_on: [["modification_date", "descending"]] sort_on: [["modification_date", "descending"]]
}) })
...@@ -277,6 +279,7 @@ ...@@ -277,6 +279,7 @@
i, i,
document_list, document_list,
limit_date = new Date(); limit_date = new Date();
//TODO Where to define/get the limit date? byt portal_type or the same for all documents?
limit_date.setFullYear(limit_date.getFullYear() - 1); limit_date.setFullYear(limit_date.getFullYear() - 1);
limit_date = limit_date.toISOString(); limit_date = limit_date.toISOString();
//XXX For testing //XXX For testing
...@@ -297,15 +300,15 @@ ...@@ -297,15 +300,15 @@
i, i,
test_list, test_list,
test_result_query = Query.objectToSearchText( test_result_query = Query.objectToSearchText(
          getComplexQuery({"portal_type" : "Test Result", getComplexQuery({"portal_type" : "Test Result",
                           "source_project__validation_state" : "validated"}, "source_project__validation_state" : "validated"},
                          "AND")), "AND")),
test_state_list = ["failed", "stopped", "public_stopped"]; test_state_list = ["failed", "stopped", "public_stopped"];
test_result_query += ' AND simulation_state: ("' + test_state_list.join('", "') + '")'; test_result_query += ' AND simulation_state: ("' + test_state_list.join('", "') + '")';
return gadget.jio_allDocs({ return gadget.jio_allDocs({
query: test_result_query, query: test_result_query,
limit: 10000, limit: QUERY_LIMIT,
select_list: ['source_project__relative_url', 'portal_type'], select_list: ['source_project__relative_url', 'portal_type'],
group_by: ['source_project__relative_url'], group_by: ['source_project__relative_url'],
sort_on: [["modification_date", "descending"]] sort_on: [["modification_date", "descending"]]
...@@ -319,7 +322,7 @@ ...@@ -319,7 +322,7 @@
test_list[i].value.portal_type, test_list[i].value.portal_type,
// //
1, //parseInt(test_list[i].value.all_test, RADIX) 1, //parseInt(test_list[i].value.all_test, RADIX)
0); //parseInt(test_list[i].value.failed, RADIX) 0); //parseInt(test_list[i].value.failures, RADIX)
} }
}); });
}) })
......
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