Commit 2400141b authored by Roque's avatar Roque

erp5_web_project_ui: new front page

parent bdddbca1
......@@ -116,12 +116,15 @@ CACHE:\n
\n
gadget_erp5_page_project_controller.html\n
gadget_erp5_page_project_controller.js\n
gadget_project_info.html\n
gadget_project_info.js\n
gadget_erp5_page_project_redirector.html\n
gadget_erp5_page_project_redirector.js\n
gadget_erp5_project_panel.html\n
gadget_erp5_project_panel.js\n
gadget_erp5_page_project_front_page.html\n
gadget_erp5_page_project_front_page.js\n
gadget_erp5_page_project_page.html\n
gadget_erp5_page_project_page.js\n
gadget_erp5_page_project.css\n
\n
favicon.ico\n
font-awesome/font-awesome-webfont.eot\n
......@@ -411,7 +414,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>981.59441.37027.22988</string> </value>
<value> <string>982.7925.11380.19746</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -429,7 +432,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1582043312.81</float>
<float>1582883697.21</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -9,31 +9,19 @@
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getSetting", "getSetting")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
var gadget = this;
return gadget.getSetting("hateoas_url")
.push(function (hateoas_url) {
return gadget.redirect({
'command': 'display',
'options': {
'page': 'form',
'jio_key': 'project_module',
'view': hateoas_url +
'/ERP5Document_getHateoas?mode=traverse&relative_url=' +
'project_module&view=ProjectModule_viewProjectManagementList',
'field_listbox_sort_list:json': [["title", "ascending"]],
'field_listbox_column_list:json': ["title",
"default_destination_section_title"],
'extended_search': 'selection_domain_state_project_domain: "started"'
}
});
});
return this.redirect({
'command': 'display',
'options': {
'page': 'project_front_page',
'editable': 'true'
}
});
});
}(document, window, rJS));
\ No newline at end of file
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.38481.6518.61474</string> </value>
<value> <string>982.19509.52683.10666</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1577471606.29</float>
<float>1583320436.98</float>
<string>UTC</string>
</tuple>
</state>
......
/* FRONT PAGE */
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] ul {
display: flex;
align-items: flex-start;
flex-wrap: wrap;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] ul li {
flex-shrink: 1;
vertical-align: top;
padding: 3pt;
border: 1px solid rgba(0, 0, 0, 0.3);
border-radius: 0.325em;
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
background-color: #FFFFFF;
}
@media only screen and (max-width: 85em) and (min-width: 45em), not screen and (max-width: 85em) {
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] ul li {
margin-right: 18pt;
margin-bottom: 18pt;
flex-basis: 28em;
}
}
@media not screen and (min-width: 45em) {
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] ul li {
flex-basis: 100%;
margin-bottom: 6pt;
}
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list {
margin-top: 10px;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box {
padding: 5px;
padding-left: 15px;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] a {
color: #267B87;
text-decoration: none;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .project-left a {
color: #111;
text-decoration: none;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .project-right .value a {
color: #111;
text-decoration: none;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .project-info {
display: inline-flex;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .project-info .project-left {
width: 100%;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .project-info .project-right {
min-width: 92px;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .project-line {
margin-bottom: 5px;
font-family: "Roboto", Arial, sans-serif;
font-size: 11pt;
line-height: 1.58em;
letter-spacing: -.003em;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .project-line.field {
display: flex;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .project-line.field label {
color: #767676;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .project-title {
color: #19535F;
font-weight: normal;
font-size: 20px;
line-height: 33px;
font-weight: bold;
margin-bottom: 8px;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box span.margined {
margin-right: 5px;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .status {
padding-left: 21px;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .status.none {
background: #adadad !important;
border-radius: 5px;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .status.none.orange {
background: #f0ad4e !important;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .status.none.red {
background: #de1e00 !important;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .front-project-list .project-box .status.none.green {
background: #00b80c !important;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .loader {
position: fixed;
left: 50%;
top: 50%;
font-size: 300%;
animation-name: fadein;
animation-duration: 0.2s;
animation-delay: 0.3s;
animation-fill-mode: both;
animation-timing-function: ease-in;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .ui-icon-spinner {
opacity: 1;
}
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .ui-icon-spinner::before {
content: "\f110";
animation: spin 0.5s infinite linear;
}
div[data-gadget-url$="gadget_erp5_page_project_page.html"] .ui-hidden,
div[data-gadget-url$="gadget_erp5_page_project_front_page.html"] .ui-hidden {
visibility: hidden;
}
/* PROJECT PAGE */
.gadget-content .ui-field-contain .bottom .first-line-buttons {
-webkit-appearance: none;
margin-top: 0;
margin-bottom: 20px;
}
.gadget-content div.project_links {
margin-top: 12px;
}
button:disabled{
background-color:#FFC9A4;
}
input[type="submit"] {
-webkit-appearance: none;
}
.gadget-content a.first-line-buttons {
padding: 6pt;
margin-top: 12px;
margin-right: 6pt;
background-color: #FFF;
color: #111;
border-radius: 0.325em;
border-width: 1px;
border-style: solid;
text-align: center;
display: inline-block;
}
.gadget-content span.test-result {
padding: 6pt;
margin-top: 30pt;
margin-right: 10px;
background-color: #FFF;
color: #111;
border-radius: 0.325em;
border-width: 1px;
border-style: solid;
min-width: 8em;
}
.gadget-content svg.test-result {
margin-right: 7px;
}
.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 {
color: #111;
}
.worklist-title {
color: #777777;
margin-top: 10px;
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_project.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>project_gadget_page_project_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Project CSS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1582883169.25</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.36777.28263.51165</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1584355891.48</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1582883041.5</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Project front page gadget</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_project_front_page.js"></script>
<link rel="stylesheet" type="text/css" href="gadget_erp5_page_project.css">
</head>
<body>
<div id="js-spinner" class="ui-icon-spinner ui-btn-icon-notext loader"></div>
<div class="front-project-list">
<ul id="js-project-list">
</ul>
</div>
</body>
</html>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_project_front_page.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>project_gadget_page_project_front_page_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Project Front Page</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1582734852.83</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.9625.31554.51268</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1582900646.3</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1582734474.56</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*jslint nomen: true, indent: 2 */
/*global window, rJS, RSVP, document, SimpleQuery, ComplexQuery, Query, parseInt, jIO, URL */
(function (window, rJS, RSVP, document, SimpleQuery, ComplexQuery, Query, parseInt, jIO, URL) {
"use strict";
var STATUS_OK = "green",
STATUS_NOT_OK = "red",
NONE_STATUS = "none",
RADIX = 10,
STATUS_SPAN = "status",
TOTAL_SPAN = "total",
OUTDATED_SPAN = "outdated",
NUMBER_SPAN = "number",
NAME_SPAN = "name",
FORUM_LINK_ID_SUFFIX = "forum",
FORUM_LINK_TYPE = "link",
OUTDATED_LABEL = " out of date",
FAILED_LABEL = " failed",
TEST_RESULT_PORTAL_TYPE = "Test Result",
QUERY_LIMIT = 100000,
SUPERVISOR_FIELD_TITLE = "Supervisor",
//XXX hardcoded limit dates (3 months for milestones, 3 weeks for documents)
//define dates in System Preference Project tab?
//date ISO string format: "yyyy-mm-ddThh:mm:ss.mmmm"
//JIO query date format: "yyyy-mm-dd hh:mm:ss"
MILESTONE_LIMIT_DATE = new Date(new Date().setDate(new Date().getDate() - 90))
.toISOString().substring(0, new Date().toISOString().length - 5).replace("T", " "),
DOCUMENT_LIMIT_DATE = new Date(new Date().setDate(new Date().getDate() - 21))
.toISOString().substring(0, new Date().toISOString().length - 5).replace("T", " "),
PORTAL_TITLE_DICT = {"Task": "Tasks",
"Test Result" : "Test Results",
"Bug" : "Bugs",
"Project Milestone" : "Milestones",
"Task Report": "Task Reports"},
PORTAL_TYPE_LIST = ["Task", "Bug", "Task Report"],
VALID_STATE_LIST = ["planned", "auto_planned", "ordered", "confirmed",
"ready", "stopped", "started", "submitted", "validated"];
function createMultipleSimpleOrQuery(key, value_list) {
var i,
query_list = [];
for (i = 0; i < value_list.length; i += 1) {
query_list.push(new SimpleQuery({
key: key,
operator: "",
type: "simple",
value: value_list[i]
}));
}
return new ComplexQuery({
operator: "OR",
query_list: query_list,
type: "complex"
});
}
function getProjectId(id) {
var segments = id.split("/");
if (segments.length === 2) {
return id;
}
return segments.slice(0, 2).join("/");
}
function getProjectHtlmElementId(project_id, type, suffix, hash_selector) {
hash_selector = hash_selector ? '#' : '';
//remove not allowed html id chars (spaces, slashes)
return hash_selector + [project_id, type, suffix].join("-")
.replace(/\//g, "-").replace(/\s/g, "-");
}
function getComplexQuery(query_dict, operator, extra_query) {
var key,
query_list = [];
for (key in query_dict) {
if (query_dict.hasOwnProperty(key)) {
query_list.push(new SimpleQuery({
key: key,
operator: "",
type: "simple",
value: query_dict[key]
}));
}
}
if (extra_query) {
query_list.push(extra_query);
}
return new ComplexQuery({
operator: operator,
query_list: query_list,
type: "complex"
});
}
function renderProjectLine(project_id, portal_type, total_count, outdated_count) {
var total_span = document.querySelector(
getProjectHtlmElementId(project_id, portal_type, TOTAL_SPAN, true)
),
outdated_span = document.querySelector(
getProjectHtlmElementId(project_id, portal_type, OUTDATED_SPAN, true)
),
status_span = document.querySelector(
getProjectHtlmElementId(project_id, portal_type, STATUS_SPAN, true)
),
number_span = document.querySelector(
getProjectHtlmElementId(project_id, portal_type, NUMBER_SPAN, true)
);
if (total_count > 0 && total_span) {
total_span.textContent = parseInt(total_span.textContent, RADIX) + total_count;
}
if (outdated_span) {
outdated_span.textContent = parseInt(outdated_span.textContent, RADIX) +
outdated_count;
}
if (status_span) {
if (outdated_count > 0) {
status_span.classList.remove(STATUS_OK);
status_span.classList.add(STATUS_NOT_OK);
} else if (!status_span.classList.value.includes(STATUS_NOT_OK)) {
status_span.classList.add(STATUS_OK);
}
}
if (number_span) {
if (outdated_count > 0) {
number_span.classList.remove("ui-hidden");
number_span.classList.add("ui-visible");
}
}
}
function renderProjectDocumentLines(gadget, limit_date) {
var i,
query_list = [],
document_list = [],
document_query;
query_list.push(new SimpleQuery({
key: "source_project__validation_state",
operator: "=",
type: "simple",
value: "validated"
}));
query_list.push(createMultipleSimpleOrQuery('portal_type', PORTAL_TYPE_LIST));
query_list.push(createMultipleSimpleOrQuery('simulation_state', VALID_STATE_LIST));
if (limit_date) {
query_list.push(new SimpleQuery({
key: "modification_date",
operator: "<",
type: "simple",
value: limit_date
}));
}
document_query = new ComplexQuery({
operator: "AND",
query_list: query_list,
type: "complex"
});
return gadget.jio_allDocs({
query: Query.objectToSearchText(document_query),
limit: QUERY_LIMIT,
select_list: ['source_project__relative_url', 'portal_type', 'count(*)'],
group_by: ['portal_type', 'source_project__relative_url'],
sort_on: [["modification_date", "descending"]]
})
.push(function (result) {
document_list = result.data.rows;
for (i = 0; i < document_list.length; i += 1) {
renderProjectLine(getProjectId(document_list[i].value
.source_project__relative_url),
document_list[i].value.portal_type,
limit_date ? 0 : document_list[i].value["count(*)"],
limit_date ? document_list[i].value["count(*)"] : 0);
}
});
}
function renderMilestoneLines(gadget, limit_date) {
var i,
query_list = [],
milestone_list,
milestone_query = getComplexQuery({"portal_type" : "Project Milestone",
"validation_state" : "validated"},
"AND");
if (limit_date) {
query_list.push(milestone_query);
query_list.push(new SimpleQuery({
key: "modification_date",
operator: "<",
type: "simple",
value: limit_date
}));
milestone_query = new ComplexQuery({
operator: "AND",
query_list: query_list,
type: "complex"
});
}
return new RSVP.Queue()
.push(function () {
return gadget.jio_allDocs({
query: Query.objectToSearchText(milestone_query),
limit: QUERY_LIMIT,
select_list: ['title', 'portal_type', 'count(*)'],
group_by: ['parent_uid'],
sort_on: [["modification_date", "descending"]]
});
})
.push(function (result) {
milestone_list = result.data.rows;
for (i = 0; i < milestone_list.length; i += 1) {
renderProjectLine(getProjectId(milestone_list[i].id),
milestone_list[i].value.portal_type,
limit_date ? 0 : milestone_list[i].value["count(*)"],
limit_date ? milestone_list[i].value["count(*)"] : 0);
}
});
}
function getProjectList(gadget) {
var project_query = Query.objectToSearchText(
getComplexQuery({"portal_type" : "Project",
"validation_state" : "validated"},
"AND")
);
return gadget.jio_allDocs({
query: project_query,
limit: QUERY_LIMIT,
select_list: ['title', 'source_decision_title', 'source_decision_relative_url'],
sort_on: [["title", "ascending"]]
})
.push(function (result) {
return result.data.rows;
});
}
function getUrlParameterDict(jio_key, view, sort_list, column_list, extended_search) {
return {
command: 'push_history',
options: {
'jio_key': jio_key,
'page': 'form',
'view': view,
'field_listbox_sort_list:json': sort_list,
'field_listbox_column_list:json': column_list,
'extended_search': extended_search
}
};
}
function createProjectQuery(project_jio_key, key_value_list) {
var i, query_list = [], id_query_list = [], id_complex_query;
if (project_jio_key) {
//relation to project or child project lines
id_query_list.push(new SimpleQuery({
key: "source_project__relative_url",
operator: "",
type: "simple",
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) {
query_list.push(new SimpleQuery({
key: key_value_list[i][0],
operator: "",
type: "simple",
value: key_value_list[i][1]
}));
}
return Query.objectToSearchText(new ComplexQuery({
operator: "AND",
query_list: query_list,
type: "complex"
}));
}
function renderProjectList(gadget, project_list) {
var i,
project_html,
left_div_html,
project_html_element_list,
left_line_html,
ul_list = document.querySelector("#js-project-list"),
spinner = document.querySelector("#js-spinner"),
url_parameter_list = [],
milestone_url_list = [],
task_url_list = [],
task_report_url_list = [],
bug_url_list = [],
test_result_url_list = [],
supervisor_url_list = [],
milestone_view,
project_view;
function createProjectHtmlElement(project_id, project_title,
project_url, supervisor, supervisor_url) {
var project_li = document.createElement('li'),
box_div = document.createElement('div'),
title_div = document.createElement('div'),
info_div = document.createElement('div'),
left_info_div = document.createElement('div'),
right_div = document.createElement('div'),
right_line_div = document.createElement('div'),
supervisor_field_div = document.createElement('div'),
supervisor_value_div = document.createElement('div'),
project_link = document.createElement('a'),
forum_link = document.createElement('a'),
supervisor_field_label = document.createElement('label'),
supervisor_value_link = document.createElement('a');
if (supervisor) {
supervisor_field_div.classList.add("field", "project-line");
supervisor_value_div.classList.add("field", "project-line", "value");
supervisor_field_label.innerHTML = SUPERVISOR_FIELD_TITLE;
supervisor_value_link.innerHTML = supervisor;
supervisor_value_link.href = supervisor_url;
supervisor_field_div.appendChild(supervisor_field_label);
supervisor_value_div.appendChild(supervisor_value_link);
right_div.appendChild(supervisor_field_div);
right_div.appendChild(supervisor_value_div);
}
box_div.classList.add("project-box");
title_div.classList.add("project-title");
project_link.href = project_url;
project_link.innerHTML = project_title;
title_div.appendChild(project_link);
info_div.classList.add("project-info");
left_info_div.classList.add("project-left");
right_div.classList.add("project-right");
right_line_div.classList.add("project-line");
forum_link.setAttribute("id", getProjectHtlmElementId(project_id, FORUM_LINK_TYPE,
FORUM_LINK_ID_SUFFIX));
forum_link.classList.add("ui-hidden");
right_line_div.appendChild(forum_link);
right_div.appendChild(right_line_div);
info_div.appendChild(left_info_div);
info_div.appendChild(right_div);
box_div.appendChild(title_div);
box_div.appendChild(info_div);
project_li.appendChild(box_div);
return [project_li, left_info_div];
}
function createProjectLineHtmlElement(project_id, portal_type, line_url, title,
total_count, out_count, status_color) {
var line_div = document.createElement('div'),
status_span = document.createElement('span'),
name_span = document.createElement('span'),
number_span = document.createElement('span'),
outdated_span = document.createElement('span'),
total_span = document.createElement('span'),
open_bracket_span = document.createElement('span'),
close_bracket_span = document.createElement('span'),
outdated_label_span = document.createElement('span'),
line_link = document.createElement('a');
line_div.classList.add("project-line");
status_span.classList.add(STATUS_SPAN);
status_span.classList.add(status_color);
status_span.classList.add("margined");
status_span.setAttribute("id", getProjectHtlmElementId(project_id,
portal_type, STATUS_SPAN));
total_span.classList.add("margined");
total_span.innerHTML = total_count;
total_span.setAttribute("id", getProjectHtlmElementId(project_id,
portal_type, TOTAL_SPAN));
name_span.classList.add("name");
name_span.classList.add("margined");
name_span.innerHTML = title;
name_span.setAttribute("id", getProjectHtlmElementId(project_id,
portal_type, NAME_SPAN));
outdated_span.innerHTML = out_count;
outdated_span.setAttribute("id", getProjectHtlmElementId(project_id,
portal_type, OUTDATED_SPAN));
open_bracket_span.innerHTML = "(";
outdated_label_span.innerHTML = (portal_type === TEST_RESULT_PORTAL_TYPE) ? FAILED_LABEL : OUTDATED_LABEL;
close_bracket_span.innerHTML = ")";
number_span.appendChild(open_bracket_span);
number_span.appendChild(outdated_span);
number_span.appendChild(outdated_label_span);
number_span.appendChild(close_bracket_span);
number_span.setAttribute("id", getProjectHtlmElementId(project_id,
portal_type, NUMBER_SPAN));
number_span.classList.add("ui-hidden");
line_div.appendChild(status_span);
line_div.appendChild(total_span);
line_div.appendChild(name_span);
line_div.appendChild(number_span);
line_link.appendChild(line_div);
if (line_url) {
line_link.href = line_url;
}
return line_link;
}
return gadget.getSetting("hateoas_url")
.push(function (hateoas_url) {
for (i = 0; i < project_list.length; i += 1) {
milestone_view = hateoas_url +
'/ERP5Document_getHateoas?mode=traverse&relative_url=' +
project_list[i].id + '&view=Project_viewMilestoneList';
project_view = hateoas_url +
'/ERP5Document_getHateoas?mode=traverse&relative_url=' +
project_list[i].id +
'&view=Project_viewQuickOverview';
url_parameter_list.push(
getUrlParameterDict(project_list[i].id,
project_view)
);
milestone_url_list.push(
getUrlParameterDict('milestone_module',
milestone_view,
[["stop_date", "ascending"]],
null,
createProjectQuery(null,
[["selection_domain_date_milestone_domain", "future"]]))
);
task_url_list.push(
getUrlParameterDict('task_module',
"view",
[["delivery.start_date", "descending"]],
["title", "delivery.start_date", "source_title", "translated_simulation_state_title"],
createProjectQuery(project_list[i].id,
[["selection_domain_state_task_domain", "opened"]]))
);
task_report_url_list.push(
getUrlParameterDict('task_report_module',
'view',
[["delivery.start_date", "descending"]],
["title", "delivery.start_date", "source_title", "translated_simulation_state_title"],
createProjectQuery(project_list[i].id,
[["selection_domain_state_task_report_domain", "confirmed"]]))
);
bug_url_list.push(
getUrlParameterDict('bug_module',
"view",
[["delivery.start_date", "descending"]],
["title", "description", "source_person_title", "destination_person_title",
"delivery.start_date", "translated_simulation_state_title"],
createProjectQuery(project_list[i].id,
[["selection_domain_state_bug_domain", "open"]]))
);
test_result_url_list.push(
getUrlParameterDict('test_result_module',
'view',
[["delivery.start_date", "descending"]],
null,
createProjectQuery(project_list[i].id, []))
);
supervisor_url_list.push(
getUrlParameterDict(project_list[i].value.source_decision_relative_url,
'view')
);
}
return RSVP.all([gadget.getUrlForList(url_parameter_list),
gadget.getUrlForList(milestone_url_list),
gadget.getUrlForList(task_url_list),
gadget.getUrlForList(task_report_url_list),
gadget.getUrlForList(bug_url_list),
gadget.getUrlForList(test_result_url_list),
gadget.getUrlForList(supervisor_url_list)]);
})
.push(function (result_list) {
var type,
line_url;
spinner.classList.add("ui-hidden");
for (i = 0; i < project_list.length; i += 1) {
project_html_element_list =
createProjectHtmlElement(project_list[i].id,
project_list[i].value.title,
result_list[0][i],
project_list[i].value.source_decision_title,
result_list[6][i]);
project_html = project_html_element_list[0];
left_div_html = project_html_element_list[1];
for (type in PORTAL_TITLE_DICT) {
if (PORTAL_TITLE_DICT.hasOwnProperty(type)) {
line_url = (function (portal_type) {
switch (portal_type) {
case 'Project Milestone':
return result_list[1][i];
case 'Task':
return result_list[2][i];
case 'Task Report':
return result_list[3][i];
case 'Bug':
return result_list[4][i];
case 'Test Result':
return result_list[5][i];
}
})(type);
left_line_html = createProjectLineHtmlElement(project_list[i].id, type,
line_url,
((PORTAL_TITLE_DICT
.hasOwnProperty(type)) ?
PORTAL_TITLE_DICT[type] :
type),
0, 0, NONE_STATUS);
left_div_html.appendChild(left_line_html);
}
}
ul_list.appendChild(project_html);
}
});
}
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("getSetting", "getSetting")
.declareMethod('render', function (options) {
var gadget = this;
return getProjectList(gadget)
.push(function (project_list) {
options.project_list = project_list;
return gadget.changeState(options);
});
})
.onStateChange(function () {
var gadget = this;
return gadget.updateHeader({
page_title: 'Project Management'
});
})
.declareService(function () {
var gadget = this;
return renderProjectList(gadget, gadget.state.project_list)
.push(function () {
//run the rest of queries and render async
gadget.renderMilestoneInfo();
gadget.renderOutdatedMilestoneInfo();
gadget.renderProjectDocumentInfo();
gadget.renderOutdatedDocumentInfo();
gadget.renderTestResultInfo();
gadget.renderProjectForumLink();
});
})
.declareJob("renderMilestoneInfo", function () {
return renderMilestoneLines(this);
})
.declareJob("renderOutdatedMilestoneInfo", function () {
return renderMilestoneLines(this, MILESTONE_LIMIT_DATE);
})
.declareJob("renderProjectDocumentInfo", function () {
return renderProjectDocumentLines(this);
})
.declareJob("renderOutdatedDocumentInfo", function () {
return renderProjectDocumentLines(this, DOCUMENT_LIMIT_DATE);
})
.declareJob("renderTestResultInfo", function () {
return new RSVP.Queue()
.push(function () {
return jIO.util.ajax({
type: "GET",
url: new URL('./ERP5Site_getProjectTestStatusData', window.location.href)
});
})
.push(function (result) {
var project_id,
project_test_status_dict;
project_test_status_dict = JSON.parse(result.target.response);
for (project_id in project_test_status_dict) {
if (project_test_status_dict.hasOwnProperty(project_id)) {
renderProjectLine(project_id,
TEST_RESULT_PORTAL_TYPE,
parseInt(project_test_status_dict[project_id].all_tests, RADIX),
parseInt(project_test_status_dict[project_id].failures, RADIX));
}
}
});
})
.declareJob("renderProjectForumLink", function () {
var gadget = this,
i,
forum_link_html,
forum_link_list,
link_query = getComplexQuery({"portal_type" : "Link",
"validation_state" : "reachable",
"relative_url" : "project_module/%/forum_link"},
"AND");
return new RSVP.Queue()
.push(function () {
return gadget.jio_allDocs({
query: Query.objectToSearchText(link_query),
limit: QUERY_LIMIT,
select_list: ['url_string'],
sort_on: [["modification_date", "descending"]]
});
})
.push(function (result) {
forum_link_list = result.data.rows;
for (i = 0; i < forum_link_list.length; i += 1) {
forum_link_html = document.querySelector(
getProjectHtlmElementId(getProjectId(forum_link_list[i].id),
FORUM_LINK_TYPE,
FORUM_LINK_ID_SUFFIX, true)
);
if (forum_link_html) {
forum_link_html.href = forum_link_list[i].value.url_string;
forum_link_html.innerHTML = "Project Forum";
forum_link_html.classList.remove("ui-hidden");
}
}
});
})
.declareMethod('getContent', function () {
return {};
})
.declareMethod('checkValidity', function () {
return true;
});
}(window, rJS, RSVP, document, SimpleQuery, ComplexQuery, Query, parseInt, jIO, URL));
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_project_front_page.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>project_gadget_page_project_front_page_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Project Front Page JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1582735328.68</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.38309.20229.23722</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1584447692.07</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1582735282.78</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -6,8 +6,8 @@
<title>Project info gadget</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_project_info.js"></script>
<link rel="stylesheet" type="text/css" href="gadget_project_info.css">
<script src="gadget_erp5_page_project_page.js"></script>
<link rel="stylesheet" type="text/css" href="gadget_erp5_page_project.css">
</head>
<body>
......@@ -31,4 +31,4 @@
<div data-gadget-url="gadget_editor.html" data-gadget-scope="editor"></div>
</div>
</body>
</html>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_project_page.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>project_gadget_page_project_page_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Project Page</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1582882486.7</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.22394.11217.38775</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1583832849.31</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1582882444.5</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*jslint nomen: true, indent: 2 */
/*global window, rJS, RSVP, document, ensureArray, DOMParser, XMLSerializer, SimpleQuery, ComplexQuery, Query*/
(function (window, rJS, RSVP, document, ensureArray, DOMParser, XMLSerializer, SimpleQuery, ComplexQuery, Query) {
/*global window, rJS, RSVP, document, ensureArray, DOMParser, XMLSerializer,
SimpleQuery, ComplexQuery, Query*/
(function (window, rJS, RSVP, document, ensureArray, DOMParser, XMLSerializer,
SimpleQuery, ComplexQuery, Query) {
"use strict";
var VALID_STATE_LIST = ["shared", "released", "published",
"shared_alive", "released_alive", "published_alive"];
function addRedirectionToReference(href, url) {
if (!href.startsWith("https") && !href.startsWith("http") &&
!href.startsWith("ftp") && !href.includes("/")
......@@ -16,9 +21,11 @@
var parser = new DOMParser(), i,
oSerializer = new XMLSerializer(),
doc = parser.parseFromString(html, "text/html"),
link_list = doc.getElementsByTagName("a");
link_list = doc.querySelectorAll("a");
for (i = 0; i < link_list.length; i += 1) {
link_list[i].setAttribute('href', addRedirectionToReference(link_list[i].getAttribute('href'), url));
link_list[i].setAttribute('href',
addRedirectionToReference(link_list[i]
.getAttribute('href'), url));
}
return oSerializer.serializeToString(doc);
}
......@@ -33,44 +40,22 @@
return view_list.filter(d => d.name === name)[0].href;
}
function setLatestTestResult(gadget, svg_element, project_jio_key) {
var query = createProjectQuery(project_jio_key,
[["portal_type", "Test Result"]]);
return gadget.jio_allDocs({
query: query,
limit: 1,
sort_on: [['creation_date', 'descending']],
select_list: ['simulation_state']
})
.push(function (result_list) {
var state;
result_list = result_list.data.rows;
if (result_list.length > 0) {
svg_element.classList.remove("ui-hidden");
state = result_list[0].value.simulation_state;
switch (state) {
case 'started':
svg_element.classList.add("running");
document.getElementById("test_result_running").classList.remove("ui-hidden");
break;
case 'failed':
svg_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;
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");
}
}
});
function createMultipleSimpleOrQuery(key, value_list) {
var i,
query_list = [];
for (i = 0; i < value_list.length; i += 1) {
query_list.push(new SimpleQuery({
key: key,
operator: "",
type: "simple",
value: value_list[i]
}));
}
return new ComplexQuery({
operator: "OR",
query_list: query_list,
type: "complex"
});
}
function createProjectQuery(project_jio_key, key_value_list) {
......@@ -111,16 +96,57 @@
}));
}
function setLatestTestResult(gadget, svg_element, project_jio_key) {
var query = createProjectQuery(project_jio_key,
[["portal_type", "Test Result"]]);
return gadget.jio_allDocs({
query: query,
limit: 1,
sort_on: [['creation_date', 'descending']],
select_list: ['simulation_state']
})
.push(function (result_list) {
var state;
result_list = result_list.data.rows;
if (result_list.length > 0) {
svg_element.classList.remove("ui-hidden");
state = result_list[0].value.simulation_state;
switch (state) {
case 'started':
svg_element.classList.add("running");
document.querySelector("#test_result_running")
.classList.remove("ui-hidden");
break;
case 'failed':
svg_element.classList.add("fail");
document.querySelector("#test_result_fail")
.classList.remove("ui-hidden");
break;
case 'cancelled':
svg_element.classList.add("cancelled");
document.querySelector("#test_result_running")
.classList.remove("ui-hidden");
break;
case 'stopped':
case 'public_stopped':
svg_element.classList.add("pass");
document.querySelector("#test_result_pass")
.classList.remove("ui-hidden");
break;
default:
svg_element.classList.add("ui-hidden");
}
}
});
}
function getWebPageInfo(gadget, project_jio_key, publication_section) {
var id,
content,
edit_view,
redirector_ulr,
i,
query,
query_list = [],
id_query_list = [],
validation_state_query_list = [],
web_page;
query_list.push(new SimpleQuery({
key: "portal_type",
......@@ -128,13 +154,6 @@
type: "simple",
value: "Web Page"
}));
query_list.push(new SimpleQuery({
key: "validation_state",
operator: "=",
type: "simple",
value: ("shared", "released", "published", "shared_alive",
"released_alive", "published_alive")
}));
query_list.push(new SimpleQuery({
key: "follow_up__relative_url",
operator: "=",
......@@ -147,17 +166,20 @@
type: "simple",
value: "publication_section/" + publication_section
}));
query = Query.objectToSearchText(new ComplexQuery({
query_list.push(createMultipleSimpleOrQuery('validation_state', VALID_STATE_LIST));
query = new ComplexQuery({
operator: "AND",
query_list: query_list,
type: "complex"
}));
return gadget.getUrlFor({command: 'push_history', options: {page: "project_redirector"}})
});
return gadget.getUrlFor({command: 'push_history',
options: {page: "project_redirector"}})
.push(function (url) {
redirector_ulr = url;
return gadget.jio_allDocs({
query: query,
select_list: ['text_content']
query: Query.objectToSearchText(query),
select_list: ['text_content'],
limit: 2
});
})
.push(function (result_list) {
......@@ -220,8 +242,9 @@
gadget.getSetting("hateoas_url")
];
if (modification_dict.publication_section) {
promise_list.push(gadget.getDeclaredGadget("editor")),
promise_list.push(getWebPageInfo(gadget, modification_dict.jio_key, modification_dict.publication_section));
promise_list.push(gadget.getDeclaredGadget("editor"));
promise_list.push(getWebPageInfo(gadget, modification_dict.jio_key,
modification_dict.publication_section));
}
return RSVP.all(promise_list);
})
......@@ -242,30 +265,56 @@
"value": web_page_info.content});
}
url_parameter_list = [
getUrlParameterDict('milestone_module', milestone_view, [["stop_date", "ascending"]],
null, createProjectQuery(null, [["selection_domain_date_milestone_domain", "future"]])),
getUrlParameterDict('task_module', "view", [["delivery.start_date", "descending"]],
["title", "delivery.start_date", "source_title"],
createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_task_domain", "confirmed"]])),
getUrlParameterDict('support_request_module', "view", [["delivery.start_date", "descending"]],
null, createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_support_domain", "validated"]])),
getUrlParameterDict('bug_module', "view", [["delivery.start_date", "descending"]],
["title", "description", "source_person_title", "destination_person_title", "delivery.start_date"],
createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_bug_domain", "open"]])),
getUrlParameterDict('task_report_module', 'view', [["delivery.start_date", "descending"]],
["title", "delivery.start_date", "source_title"],
createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_task_report_domain", "confirmed"]])),
getUrlParameterDict('test_result_module', 'view', [["delivery.start_date", "descending"]],
null, createProjectQuery(modification_dict.jio_key, [])),
getUrlParameterDict('test_suite_module', 'view', [["creation_date", "descending"]],
null, createProjectQuery(modification_dict.jio_key, [["translated_validation_state_title", "validated"]])),
getUrlParameterDict(modification_dict.jio_key, document_view, [["modification_date", "descending"]],
["download", "title", "reference", "modification_date"], createProjectQuery(null, [["selection_domain_state_document_domain", "confirmed"]])),
getUrlParameterDict(modification_dict.jio_key, activity_view, [["modification_date", "descending"]])
getUrlParameterDict('milestone_module',
milestone_view,
[["stop_date", "ascending"]],
null,
createProjectQuery(null, [["selection_domain_date_milestone_domain", "future"]])),
getUrlParameterDict('task_module',
"view",
[["delivery.start_date", "descending"]],
["title", "delivery.start_date", "source_title, translated_simulation_state_title"],
createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_task_domain", "opened"]])),
getUrlParameterDict('support_request_module',
"view",
[["delivery.start_date", "descending"]],
null,
createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_support_domain", "validated"]])),
getUrlParameterDict('bug_module',
"view",
[["delivery.start_date", "descending"]],
["title", "description", "source_person_title", "destination_person_title",
"delivery.start_date", "translated_simulation_state_title"],
createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_bug_domain", "open"]])),
getUrlParameterDict('task_report_module',
'view',
[["delivery.start_date", "descending"]],
["title", "delivery.start_date", "source_title",
"translated_simulation_state_title"],
createProjectQuery(modification_dict.jio_key,
[["selection_domain_state_task_report_domain", "confirmed"]])),
getUrlParameterDict('test_result_module',
'view',
[["delivery.start_date", "descending"]],
null,
createProjectQuery(modification_dict.jio_key, [])),
getUrlParameterDict('test_suite_module',
'view',
[["creation_date", "descending"]],
null,
createProjectQuery(modification_dict.jio_key,
[["translated_validation_state_title", "validated"]])),
getUrlParameterDict(modification_dict.jio_key,
document_view,
[["modification_date", "descending"]],
["download", "title", "reference", "modification_date"],
createProjectQuery(null, [["selection_domain_state_document_domain", "confirmed"]])),
getUrlParameterDict(modification_dict.jio_key,
activity_view,
[["modification_date", "descending"]])
];
if (web_page_info) {
url_parameter_list.push(getUrlParameterDict(web_page_info.id, web_page_info.edit_view));
......@@ -273,19 +322,21 @@
return gadget.getUrlForList(url_parameter_list);
})
.push(function (url_list) {
enableLink(document.getElementById("milestone_link"), url_list[0]);
enableLink(document.getElementById("task_link"), url_list[1]);
enableLink(document.getElementById("support_request_link"), url_list[2]);
enableLink(document.getElementById("bug_link"), url_list[3]);
enableLink(document.getElementById("report_link"), url_list[4]);
enableLink(document.getElementById("test_result_link"), url_list[5]);
enableLink(document.getElementById("test_suite_link"), url_list[6]);
enableLink(document.getElementById("document_link"), url_list[7]);
enableLink(document.getElementById("activity_link"), url_list[8]);
enableLink(document.querySelector("#milestone_link"), url_list[0]);
enableLink(document.querySelector("#task_link"), url_list[1]);
enableLink(document.querySelector("#support_request_link"), url_list[2]);
enableLink(document.querySelector("#bug_link"), url_list[3]);
enableLink(document.querySelector("#report_link"), url_list[4]);
enableLink(document.querySelector("#test_result_link"), url_list[5]);
enableLink(document.querySelector("#test_suite_link"), url_list[6]);
enableLink(document.querySelector("#document_link"), url_list[7]);
enableLink(document.querySelector("#activity_link"), url_list[8]);
if (web_page_info) {
enableLink(document.getElementById("web_page_link"), url_list[9]);
enableLink(document.querySelector("#web_page_link"), url_list[9]);
}
setLatestTestResult(gadget, document.getElementById("test_result_svg"), modification_dict.jio_key);
//XXX move into a job to call it async
setLatestTestResult(gadget, document.querySelector("#test_result_svg"),
modification_dict.jio_key);
});
})
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_project_page.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>project_gadget_page_project_page_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Project Page JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1583923139.12</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.36846.48545.18193</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1584360005.19</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1583923069.49</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>979.47685.23740.12236</string> </value>
<value> <string>982.9627.1029.47206</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1573472973.73</float>
<float>1582900659.95</float>
<string>UTC</string>
</tuple>
</state>
......
import json
from DateTime import DateTime
result_dict = {}
catalog_kw = {'portal_type' : 'Test Result',
'simulation_state': ('stopped', 'failed'),
'source_project__validation_state': 'validated',
'delivery.start_date': ">= " + (DateTime()-365).strftime("%Y/%m/%d"),
}
sort_on = [('modification_date', 'descending')]
select_list = ['source_project__relative_url']
for test_result in context.portal_catalog(sort_on=sort_on, select_list=select_list, **catalog_kw):
# get the first test result (most recent) for each project
if not test_result.source_project__relative_url in result_dict:
result_dict[test_result.source_project__relative_url] = {'all_tests': test_result.all_tests,
'failures': test_result.failures}
return json.dumps(result_dict, indent=2)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getProjectTestStatusData</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_doSelect</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_delivery_start_date</string>
<string>listbox_delivery_stop_date</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ProjectModule_viewProjectManagementList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>ProjectModule_viewProjectList</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Projects</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>all_columns</string>
<string>columns</string>
<string>domain_root_list</string>
<string>domain_tree</string>
<string>editable_columns</string>
<string>portal_types</string>
<string>search_columns</string>
<string>selection_name</string>
<string>title</string>
<string>url_columns</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>Base_viewSearchResultList</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>all_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>all_editable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>columns</string> </key>
<value>
<list>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>default_destination_section_title</string>
<string>Billable Client</string>
</tuple>
<tuple>
<string>source_decision_title</string>
<string>Supervisor</string>
</tuple>
<tuple>
<string>delivery.start_date</string>
<string>Begin Date</string>
</tuple>
<tuple>
<string>delivery.stop_date</string>
<string>End Date</string>
</tuple>
<tuple>
<string>default_destination_title</string>
<string>Location</string>
</tuple>
<tuple>
<string>translated_validation_state_title</string>
<string>State</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>state_project_domain</string>
<string>Project Status</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value>
<list>
<tuple>
<string>delivery.start_date</string>
<string>Begin Date</string>
</tuple>
<tuple>
<string>delivery.stop_date</string>
<string>End Date</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_mode_listbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
<list>
<tuple>
<string>Project</string>
<string>Project</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>search_columns</string> </key>
<value>
<list>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>default_destination_section_title</string>
<string>Billable Client</string>
</tuple>
<tuple>
<string>source_decision_title</string>
<string>Supervisor</string>
</tuple>
<tuple>
<string>delivery.start_date</string>
<string>Begin Date</string>
</tuple>
<tuple>
<string>delivery.stop_date</string>
<string>End Date</string>
</tuple>
<tuple>
<string>default_destination_title</string>
<string>Location</string>
</tuple>
<tuple>
<string>translated_validation_state_title</string>
<string>State</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>project_module_project_management_selection</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Projects</string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>title</string>
<string>Project_getQuickViewUrl</string>
</tuple>
<tuple>
<string>default_destination_section_title</string>
<string>Project_getQuickViewUrl</string>
</tuple>
</list>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_delivery_start_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_start_date</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Project_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_delivery_stop_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_stop_date</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Project_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -211,7 +211,7 @@
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string>gadget_project_info.html</string> </value>
<value> <string>gadget_erp5_page_project_page.html</string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
......
#generate-rss {
padding: 5.5pt;
margin-right: 12pt;
background-color: #FF6600;
border-color: #FF6600;
color: #FFFFFF;
border-radius: 0.325em;
border-width: 0.5px;
border-style: solid;
min-width: 6em;
line-height: 1.5;
display: none;
text-align: center;
width: fit-content;
}
.restore-button {
padding: 6pt;
margin-right: 12pt;
background-color: #FF6600;
color: #FFFFFF;
border-radius: 0.325em;
border-width: 0.5px;
border-style: solid;
min-width: 8em;
line-height: 1.5;
}
#wrap1 iframe {
height: 100%;
}
#wrap2 iframe {
height: 100%;
}
.gadget-content .ui-field-contain .graph-spinner {
position: relative;
top: 100px;
width: 120px;
}
.gadget-content .ui-field-contain .count-spinner {
top: 20px;
width: 120px;
}
.gadget-content .ui-field-contain .bottom .first-line-buttons {
-webkit-appearance: none;
margin-top: 0;
margin-bottom: 20px;
}
.gadget-content div.project_links {
margin-top: 12px;
}
button:disabled{
background-color:#FFC9A4;
}
input[type="submit"] {
-webkit-appearance: none;
}
.gadget-content a.first-line-buttons {
padding: 6pt;
margin-top: 12px;
margin-right: 6pt;
background-color: #FFF;
color: #111;
border-radius: 0.325em;
border-width: 1px;
border-style: solid;
text-align: center;
display: inline-block;
}
.gadget-content span.test-result {
padding: 6pt;
margin-top: 30pt;
margin-right: 10px;
background-color: #FFF;
color: #111;
border-radius: 0.325em;
border-width: 1px;
border-style: solid;
min-width: 8em;
}
.gadget-content svg.test-result.ui-hidden {
visibility: hidden;
}
.gadget-content svg.test-result path.ui-hidden {
visibility: hidden;
}
.gadget-content svg.test-result {
margin-right: 7px;
}
.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 {
color: #111;
}
.worklist-title {
color: #777777;
margin-top: 10px;
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_project_info.css</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/css</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_project_info.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_project_info.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_forge
erp5_project
erp5_web_renderjs_ui
\ No newline at end of file
......@@ -41,16 +41,16 @@
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<!--<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />-->
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_field_listbox.html']</td>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_page_project_front_page.html']</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Projects</td>
<td>waitForElementPresent</td>
<td>//div[@class='front-project-list']</td>
<td></td>
</tr>
<!-- Check panel -->
......@@ -89,130 +89,68 @@
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_project_panel.html']//a[text()='Logout' and contains(@href, '#!display') and contains(@href, 'n.page=logout')]</td>
<td></td>
</tr>
<!-- Check filter -->
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_searchfield.html']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_searchfield.html']//button[text()="started"]</td>
<td></td>
</tr>
<!-- Check sort -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='document_table']//th[@class='ui-icon ui-icon-sort-amount-asc']//a[text()="Title"]</td>
<td></td>
</tr>
<!-- Check columns -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='document_table']//th//a[text()="Billable Client"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@class='document_table']//th//a[text()="Status"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@class='document_table']//th//a[text()="Reference"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@class='document_table']//th//a[text()="Supervisor"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@class='document_table']//th//a[text()="Begin Date"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@class='document_table']//th//a[text()="End Date"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@class='document_table']//th//a[text()="Location"]</td>
<td></td>
</tr>
<!-- Check project present -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='document_table']//table//tbody//tr//a[text()="test-project"]</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='test-project']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class='document_table']//table//tbody//tr//a[text()="test-project"]</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='test-project']</td>
<td></td>
</tr>
<!-- check project quick view page elements -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[@id='milestone_link' and @class='first-line-buttons']</td>
<td>//a[@id='milestone_link' and @class='first-line-buttons']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Milestones' and contains(@href, '#!push_history') and contains(@href, 'n.jio_key=milestone_module')]</td>
<td>//a[text()='Milestones' and contains(@href, '#!push_history') and contains(@href, 'n.jio_key=milestone_module')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Support Requests']</td>
<td>//a[text()='Support Requests']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Documents']</td>
<td>//a[text()='Documents']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Activities']</td>
<td>//a[text()='Activities']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Opened Bugs']</td>
<td>//a[text()='Opened Bugs']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Ongoing Tasks']</td>
<td>//a[text()='Ongoing Tasks']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Opened Task Reports']</td>
<td>//a[text()='Opened Task Reports']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Latest Test Result']</td>
<td>//a[text()='Latest Test Result']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Test Suite']</td>
<td>//a[text()='Test Suite']</td>
<td></td>
</tr>
<!-- wait a bit for the editor -->
<tr>
<td>pause</td>
......@@ -221,7 +159,7 @@
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Edit Project Page' and @class='first-line-buttons ui-disabled']</td>
<td>//a[text()='Edit Project Page' and @class='first-line-buttons ui-disabled']</td>
<td></td>
</tr>
<tr>
......
......@@ -42,7 +42,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testRenderjsHomePage</string> </value>
<value> <string>testRenderjsFrontPage</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
......
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test RenderJS UI</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Initialize -->
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject?create_project_documents=true</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Project Created</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Project Created</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/project_management/</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_page_project_front_page.html']</td>
<td></td>
</tr>
<!-- Check project list elements -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='front-project-list']</td>
<td></td>
</tr>
<!-- Check draft project -->
<tr>
<td>assertElementNotPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='draft-project']</td>
<td></td>
</tr>
<!-- Check empty project -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='empty-project']</td>
<td></td>
</tr>
<!-- Check empty Task line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Task') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Tasks']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Task') and contains(@id, '-number')]</td>
<td></td>
</tr>
<!-- Check empty Bug line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Bug') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Bugs']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Bug') and contains(@id, '-number')]</td>
<td></td>
</tr>
<!-- Check empty Test Result line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Test-Result') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Test Results']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Test-Result') and contains(@id, '-number')]</td>
<td></td>
</tr>
<!-- Check empty Milestone line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Milestone') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Milestones']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Milestone') and contains(@id, '-number')]</td>
<td></td>
</tr>
<!-- Check empty Task Report line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Task-Report') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Task Reports']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Task-Report') and contains(@id, '-number')]</td>
<td></td>
</tr>
<!-- Check documented project -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='documented-project']</td>
<td></td>
</tr>
<!-- Check Task line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-project') and contains(@id, 'Task') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'documented-project') and contains(@id, 'Task') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Task') and contains(@id, '-total') and text()='3']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Task') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
<!-- Check Bug line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-project') and contains(@id, 'Bug') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'documented-project') and contains(@id, 'Bug') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Bug') and contains(@id, '-total') and text()='3']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Bug') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
<!-- Check Test Result line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-project') and contains(@id, 'Test-Result') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'documented-project') and contains(@id, 'Test-Result') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Test-Result') and contains(@id, '-total') and text()='20']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Test-Result') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
<!-- Check Milestone line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-project') and contains(@id, 'Milestone') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'documented-project') and contains(@id, 'Milestone') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Milestone') and contains(@id, '-total') and text()='1']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Milestone') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
<!-- Check Task Report line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-project') and contains(@id, 'Task-Report') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'documented-project') and contains(@id, 'Task-Report') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Task-Report') and contains(@id, '-total') and text()='3']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Task-Report') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
<!-- Check failed project -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='failed-project']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'failed-project') and contains(@id, 'Test-Result') and contains(@id, '-total') and text()='15']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'failed-project') and contains(@id, 'Test-Result') and contains(@id, '-outdated') and text()='10']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined red' and contains(@id, 'failed-project') and contains(@id, 'Test-Result') and contains(@id, '-status')]</td>
<td></td>
</tr>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testRenderjsProjectHomePage</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -41,33 +41,32 @@
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_field_listbox.html']</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_page_project_front_page.html']</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Projects</td>
<td>waitForElementPresent</td>
<td>//div[@class='front-project-list']</td>
<td></td>
</tr>
<!-- Check project present -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='document_table']//table//tbody//tr//a[text()="test-project-home"]</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='test-project-home']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class='document_table']//table//tbody//tr//a[text()="test-project-home"]</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='test-project-home']</td>
<td></td>
</tr>
<!-- check project quick view page elements -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[@id='milestone_link' and @class='first-line-buttons']</td>
<td>//a[@id='milestone_link' and @class='first-line-buttons']</td>
<td></td>
</tr>
<tr>
......@@ -77,12 +76,12 @@
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Edit Project Page' and @class='first-line-buttons ui-disabled']</td>
<td>//a[text()='Edit Project Page' and @class='first-line-buttons ui-disabled']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_project_info.html']//a[text()='Edit Project Page']</td>
<td>//a[text()='Edit Project Page']</td>
<td></td>
</tr>
</tbody></table>
......
portal = context.getPortalObject()
import time
from datetime import datetime
portal = context.getPortalObject()
now = datetime.now()
date_time = now.strftime("%m-%d-%Y-%H-%M-%S")
test_id = "test-project-" + date_time
project_reference = 'test-project-home' if home_page else 'test-project'
old_date_time = (DateTime()-366).strftime("%Y/%m/%d")
test_id = "documented-project-" if create_project_documents else "test-project-"
test_id += date_time
project_reference = 'test-project-home' if home_page else 'documented-project' if create_project_documents else 'test-project'
page_reference = 'test-home-page-' + date_time
failed_project = "failed-project"
empty_project = "empty-project"
draft_project = "draft-project"
module = portal.getDefaultModule('Project')
project = module.newContent(id = test_id,
......@@ -24,5 +30,203 @@ if home_page:
follow_up_value = project)
home_page.publishAlive()
if create_project_documents:
# MILESTONES
project.newContent(id = test_id + "-1",
portal_type = 'Project Milestone',
reference = 'test-project-milestone')
# TASKS
module = portal.getDefaultModule('Task')
task = module.newContent(id = test_id + "-1",
portal_type = 'Task',
reference = 'lonely-task')
task.plan()
task = module.newContent(id = test_id + "-2",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task = module.newContent(id = test_id + "-3",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.order()
task = module.newContent(id = test_id + "-4",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.confirm()
task = module.newContent(id = test_id + "-5",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.cancel()
task = module.newContent(id = test_id + "-6",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.delete()
task = module.newContent(id = test_id + "-7",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.plan()
# BUGS
module = portal.getDefaultModule('Bug')
bug = module.newContent(id = test_id + "-1",
portal_type = 'Bug',
reference = 'lonely-bug')
bug.confirm()
bug = module.newContent(id = test_id + "-2",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug = module.newContent(id = test_id + "-3",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug = module.newContent(id = test_id + "-4",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug.stop()
bug = module.newContent(id = test_id + "-5",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug.setReady()
bug = module.newContent(id = test_id + "-6",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug.cancel()
bug = module.newContent(id = test_id + "-7",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.delete()
bug = module.newContent(id = test_id + "-8",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug.stop()
bug.deliver()
# TASK REPORTS
module = portal.getDefaultModule('Task Report')
task_report = module.newContent(id = test_id + "-1",
portal_type = 'Task Report',
reference = 'lonely-task-report')
task_report.confirm()
task_report = module.newContent(id = test_id + "-2",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report = module.newContent(id = test_id + "-3",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.confirm()
task_report = module.newContent(id = test_id + "-4",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.stop()
task_report = module.newContent(id = test_id + "-5",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.confirm()
task_report.start()
task_report = module.newContent(id = test_id + "-6",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.stop()
task_report.deliver()
task_report = module.newContent(id = test_id + "-7",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.delete()
task_report = module.newContent(id = test_id + "-8",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.cancel()
# TEST RESULTS
module = context.portal_catalog.getDefaultModule('Test Result')
test_result = module.newContent(id = test_id + "-1",
portal_type = 'Test Result',
source_project_value = project)
test_result.newContent(id = "1",
portal_type = 'Test Result Line',
reference = "test-result-line")
test_result = module.newContent(id = test_id + "-2",
portal_type = 'Test Result',
source_project_value = project)
test_result.newContent(id = "1",
portal_type = 'Test Result Line',
reference = "test-result-line")
test_result.start()
test_result = module.newContent(id = test_id + "-3",
portal_type = 'Test Result',
source_project_value = project)
test_result.newContent(id = "1",
portal_type = 'Test Result Line',
reference = "test-result-line")
test_result.start()
test_result.fail()
test_result = module.newContent(id = test_id + "-4",
portal_type = 'Test Result',
source_project_value = project)
test_result_line = test_result.newContent(id = "1",
portal_type = 'Test Result Line',
reference = "test-result-line")
test_result_line.start()
test_result_line.stop(test_count=20)
time.sleep(5)
test_result.start()
test_result.stop()
# FAILED PROJECT
module = portal.getDefaultModule('Project')
failed_project = module.newContent(id = failed_project + "-" + date_time,
portal_type = 'Project',
reference = failed_project)
failed_project.validate()
module = context.portal_catalog.getDefaultModule('Test Result')
test_result = module.newContent(id = test_id + "-failed",
portal_type = 'Test Result',
source_project_value = failed_project)
test_result_line = test_result.newContent(id = "1",
portal_type = 'Test Result Line',
reference = "test-result-line")
test_result_line.start()
test_result_line.stop(test_count=15, error_count=10, failure_count=10)
import time
time.sleep(5)
test_result.start()
test_result.fail()
# EMPTY PROJECT
module = portal.getDefaultModule('Project')
empty_project = module.newContent(id = empty_project + "-" + date_time,
portal_type = 'Project',
reference = empty_project)
empty_project.validate()
# DRAFT PROJECT
module = portal.getDefaultModule('Project')
empty_project = module.newContent(id = draft_project + "-" + date_time,
portal_type = 'Project',
reference = draft_project)
print "Project Created"
return printed
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>home_page=False</string> </value>
<value> <string>home_page=False, create_project_documents=False</string> </value>
</item>
<item>
<key> <string>id</string> </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