Commit 2a0d8e8f authored by Roque's avatar Roque Committed by Roque

Fixes on project management

/reviewed-on !999
parent 041b0614
...@@ -91,12 +91,28 @@ input[type="submit"] { ...@@ -91,12 +91,28 @@ input[type="submit"] {
min-width: 8em; min-width: 8em;
} }
.gadget-content span.pass { .gadget-content svg.test-result.ui-hidden {
background-color: #00a616; visibility: hidden;
} }
.gadget-content span.fail { .gadget-content svg.test-result path.ui-hidden {
background-color: #ff0400; visibility: hidden;
}
.gadget-content svg.test-result.fail {
fill: red;
}
.gadget-content svg.test-result.pass {
fill: green;
}
.gadget-content svg.test-result.running {
fill: blue;
}
.gadget-content svg.test-result.cancelled {
fill: grey;
} }
.gadget-content span.test-result a { .gadget-content span.test-result a {
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<a id="test_result_link" class="ui-disabled" data-i18n="[value]Last test result" disabled >Last test result</a> <a id="test_result_link" class="ui-disabled" data-i18n="[value]Last test result" disabled >Last test result</a>
</span> </span>
<a id="test_suite_link" class="first-line-buttons ui-disabled" data-i18n="[value]Test suite" disabled >Test suite</a> <a id="test_suite_link" class="first-line-buttons ui-disabled" data-i18n="[value]Test suite" disabled >Test suite</a>
<svg id="test_result_svg" class="test-result ui-hidden" width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><g fill-rule="evenodd"><path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"></path><path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="#FFF"></path><path id="test_result_fail" class="ui-hidden" d="M7 5.969L5.599 4.568a.29.29 0 0 0-.413.004l-.614.614a.294.294 0 0 0-.004.413L5.968 7l-1.4 1.401a.29.29 0 0 0 .004.413l.614.614c.113.114.3.117.413.004L7 8.032l1.401 1.4a.29.29 0 0 0 .413-.004l.614-.614a.294.294 0 0 0 .004-.413L8.032 7l1.4-1.401a.29.29 0 0 0-.004-.413l-.614-.614a.294.294 0 0 0-.413-.004L7 5.968z"></path><path id="test_result_pass" class="ui-hidden" d="M6.278 7.697L5.045 6.464a.296.296 0 0 0-.42-.002l-.613.614a.298.298 0 0 0 .002.42l1.91 1.909a.5.5 0 0 0 .703.005l.265-.265L9.997 6.04a.291.291 0 0 0-.009-.408l-.614-.614a.29.29 0 0 0-.408-.009L6.278 7.697z"></path><path id="test_result_running" class="ui-hidden" d="M7 3c2.2 0 4 1.8 4 4s-1.8 4-4 4c-1.3 0-2.5-.7-3.3-1.7L7 7V3"></path></g></svg>
</p> </p>
</div> </div>
<div class="ui-field-contain project_links"> <div class="ui-field-contain project_links">
......
...@@ -33,28 +33,42 @@ ...@@ -33,28 +33,42 @@
return view_list.filter(d => d.name === name)[0].href; return view_list.filter(d => d.name === name)[0].href;
} }
function setLastTestResult(gadget, project_title, span_element) { function setLastTestResult(gadget, project_title, span_element, svg_element) {
span_element.classList.remove("ui-disabled"); span_element.classList.remove("ui-disabled");
var query = createProjectQuery(project_title, var query = createProjectQuery(project_title,
[["portal_type", "Benchmark Result"]]); [["portal_type", "Benchmark Result"]]);
return gadget.jio_allDocs({ return gadget.jio_allDocs({
query: query, query: query,
limit: 2, //first result could be the running test limit: 1,
sort_on: [['creation_date', 'descending']], sort_on: [['creation_date', 'descending']],
select_list: ['simulation_state'] select_list: ['simulation_state']
}) })
.push(function (result_list) { .push(function (result_list) {
var i, state; var state;
result_list = result_list.data.rows; result_list = result_list.data.rows;
for (i = 0; i < result_list.length; i = i + 1) { if (result_list.length > 0) {
state = result_list[i].value.simulation_state; svg_element.classList.remove("ui-hidden");
if (state === "stopped" || state === "public_stopped") { state = result_list[0].value.simulation_state;
span_element.classList.add("pass"); switch (state) {
case 'started':
svg_element.classList.add("running");
document.getElementById("test_result_running").classList.remove("ui-hidden");
break; break;
} case 'failed':
if (state === "failed") { svg_element.classList.add("fail");
span_element.classList.add("fail"); document.getElementById("test_result_fail").classList.remove("ui-hidden");
break;
case 'cancelled':
svg_element.classList.add("cancelled");
document.getElementById("test_result_running").classList.remove("ui-hidden");
break; break;
case 'stopped':
case 'public_stopped':
svg_element.classList.add("pass");
document.getElementById("test_result_pass").classList.remove("ui-hidden");
break;
default:
svg_element.classList.add("ui-hidden");
} }
} }
}); });
...@@ -91,7 +105,8 @@ ...@@ -91,7 +105,8 @@
edit_view, edit_view,
redirector_ulr, redirector_ulr,
query, query,
query_list = []; query_list = [],
valid_state_list = ["shared_alive", "released_alive", "published_alive"];
query_list.push(new SimpleQuery({ query_list.push(new SimpleQuery({
key: "portal_type", key: "portal_type",
operator: "=", operator: "=",
...@@ -104,12 +119,6 @@ ...@@ -104,12 +119,6 @@
type: "simple", type: "simple",
value: project_reference + '-Home.Page' value: project_reference + '-Home.Page'
})); }));
query_list.push(new SimpleQuery({
key: "validation_state",
operator: "=",
type: "simple",
value: "published_alive"
}));
query = new ComplexQuery({ query = new ComplexQuery({
operator: "AND", operator: "AND",
query_list: query_list, query_list: query_list,
...@@ -121,13 +130,22 @@ ...@@ -121,13 +130,22 @@
return gadget.jio_allDocs({ return gadget.jio_allDocs({
query: Query.objectToSearchText(query), query: Query.objectToSearchText(query),
limit: 1, limit: 1,
select_list: ['text_content'] select_list: ['validation_state', 'text_content']
}); });
}) })
.push(function (result_list) { .push(function (result_list) {
if (result_list.data.rows[0]) { if (result_list.data.rows[0]) {
id = result_list.data.rows[0].id; var i, state, web_page;
content = parseHTMLLinks(result_list.data.rows[0].value.text_content, redirector_ulr); for (i = 0; i < result_list.data.rows.length; i = i + 1) {
state = result_list.data.rows[i].value.validation_state;
if (valid_state_list.includes(state)) {
web_page = result_list.data.rows[i];
break;
}
}
if (web_page) {
id = web_page.id;
content = parseHTMLLinks(web_page.value.text_content, redirector_ulr);
return gadget.jio_getAttachment(id, "links") return gadget.jio_getAttachment(id, "links")
.push(function (web_page_document) { .push(function (web_page_document) {
edit_view = getActionListByName( edit_view = getActionListByName(
...@@ -137,6 +155,7 @@ ...@@ -137,6 +155,7 @@
return {"id": id, "content": content, "edit_view": edit_view}; return {"id": id, "content": content, "edit_view": edit_view};
}); });
} }
}
return {"id": id, "content": content, "edit_view": edit_view}; return {"id": id, "content": content, "edit_view": edit_view};
}); });
} }
...@@ -206,8 +225,7 @@ ...@@ -206,8 +225,7 @@
[["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.project_title,
[["destination_project_title", modification_dict.project_title], [["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", "delivery.start_date"], ["title", "description", "delivery.start_date"],
createProjectQuery(modification_dict.project_title, createProjectQuery(modification_dict.project_title,
...@@ -256,7 +274,8 @@ ...@@ -256,7 +274,8 @@
} }
enableLink(document.getElementById("document_link"), url_list[11]); enableLink(document.getElementById("document_link"), url_list[11]);
setLastTestResult(gadget, modification_dict.project_title, setLastTestResult(gadget, modification_dict.project_title,
document.getElementById("test_result_span")); document.getElementById("test_result_span"),
document.getElementById("test_result_svg"));
}); });
}) })
......
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