Commit 280f3445 authored by Roque's avatar Roque

Project management front page

See merge request !1050
parents 7bf59d6f 497c09d1
return [
context.Base_generateDomain(parent, 'open', 'Open', 'simulation_state', ['confirmed', 'ready']),
context.Base_generateDomain(parent, 'closed', 'Solved/Closed', 'simulation_state', ['delivered', 'stopped']),
context.Base_generateDomain(parent, 'open', 'Open', 'simulation_state', ['confirmed', 'ready', 'stopped']),
context.Base_generateDomain(parent, 'closed', 'Closed', 'simulation_state', ['delivered']),
context.Base_generateDomain(parent, 'not_started', 'Cancelled', 'simulation_state', ['cancelled'])
]
......@@ -2,6 +2,7 @@
<portal_type id="Project">
<item>File</item>
<item>Image</item>
<item>Link</item>
<item>Project Line</item>
<item>Project Milestone</item>
</portal_type>
......
<property_sheet_list>
<portal_type id="Project">
<item>Codification</item>
<item>Project</item>
</portal_type>
<portal_type id="Project Line">
<item>Amount</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Acquired Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>acquisition_sync_value</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>int</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>acquisition_depends</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>acquisition_accessor_id</string> </key>
<value> <string>getForumLinkUrlString</string> </value>
</item>
<item>
<key> <string>acquisition_base_category</string> </key>
<value>
<tuple>
<string>subordination</string>
</tuple>
</value>
</item>
<item>
<key> <string>acquisition_copy_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>acquisition_depends</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>acquisition_mask_value</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>acquisition_object_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>acquisition_portal_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>acquisition_sync_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>alt_accessor_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/content</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_acquired_property_id</string> </key>
<value>
<tuple>
<string>url_string</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_portal_type</string> </key>
<value> <string>python: (\'Link\',)</string> </value>
</item>
<item>
<key> <string>content_translation_acquired_property_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The current forum link of the project</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>forum_link_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Acquired Property</string> </value>
</item>
<item>
<key> <string>storage_id</string> </key>
<value> <string>forum_link</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
return [
context.Base_generateDomain(parent, 'confirmed', 'Confirmed', 'simulation_state', 'confirmed'),
context.Base_generateDomain(parent, 'not_confirmed', 'Not Confirmed', 'simulation_state', ['planned', 'ordered']),
context.Base_generateDomain(parent, 'opened', 'Opened', 'simulation_state', ['confirmed', 'planned', 'auto_planned', 'ordered']),
context.Base_generateDomain(parent, 'cancelled', 'Cancelled', 'simulation_state', ['cancelled', 'deleted'])
]
return [
context.Base_generateDomain(parent, 'confirmed', 'Confirmed', 'simulation_state', 'confirmed'),
context.Base_generateDomain(parent, 'closed', 'Closed', 'simulation_state', ['delivered', 'stopped'])
context.Base_generateDomain(parent, 'confirmed', 'Confirmed', 'simulation_state', ['confirmed', 'stopped', 'started']),
context.Base_generateDomain(parent, 'closed', 'Closed', 'simulation_state', ['delivered'])
]
......@@ -112,6 +112,7 @@
<string>my_source_title_list</string>
<string>my_requirement_title</string>
<string>my_translated_validation_state_title</string>
<string>my_forum_link_url_string</string>
</list>
</value>
</item>
......
......@@ -10,13 +10,13 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_delivery_stop_date</string> </value>
<value> <string>my_forum_link_url_string</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -71,22 +71,22 @@
<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>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Project_viewFieldLibrary</string> </value>
<value> <string>Base_viewFieldLibrary</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>Forum Link</string> </value>
</item>
</dictionary>
</value>
</item>
......
......@@ -7,6 +7,7 @@ Project Milestone | Image
Project Module | Project
Project | File
Project | Image
Project | Link
Project | Project Line
Project | Project Milestone
Requirement Document | Requirement
......
......@@ -4,6 +4,7 @@ Project Line | SortIndex
Project Milestone | OutcomeDescription
Project Milestone | SortIndex
Project | Codification
Project | Project
Requirement Document | Reference
Requirement | Comment
Requirement | Document
......
TaskOrder
ProjectPreference
Project
\ No newline at end of file
......@@ -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({
return this.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"'
'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;
}
/* PROJECT HOME PAGE */
body.cke_editable h1 {
margin-top: 1.5em;
font-family: "Roboto", Arial, sans-serif;
color: #19535F;
font-size: 2em;
margin: 0.67em 0;
}
body.cke_editable h2 {
font-family: "Roboto", Arial, sans-serif;
font-weight: normal;
font-size: 25px;
line-height: 33px;
color: #19535F;
}
body.cke_editable p, body.cke_editable li, body.cke_editable span {
font-family: 'Heuristica', 'Helvetica', Times, serif;
}
body.cke_editable ul li, body.cke_editable p {
font-size: 1.25em;
line-height: 1.58em;
letter-spacing: -.003em;
}
body.cke_editable a {
color: #267B87;
text-decoration: none;
}
\ 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.36779.34422.1348</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>1584457148.55</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 type="text/javascript" src="domsugar.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.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>1584629226.6</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, domsugar */
(function (window, rJS, RSVP, document, SimpleQuery, ComplexQuery, Query, parseInt, jIO, URL, domsugar) {
"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 renderMilestoneLineList(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 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_link = domsugar('a', {
href: project_url
}, [project_title]),
title_div = domsugar('div', { class: "project-title" },
[project_link]),
left_info_div = domsugar('div', { class: "project-left" }),
supervisor_field_label = domsugar('label', {}, [SUPERVISOR_FIELD_TITLE]),
supervisor_value_link = domsugar('a', {
href: supervisor_url
}, [supervisor]),
supervisor_field_div = domsugar('div', { class: "field project-line" },
[supervisor_field_label]),
supervisor_value_div = domsugar('div', { class: "field project-line value" },
[supervisor_value_link]),
forum_link = domsugar('a', {
id: getProjectHtlmElementId(project_id, FORUM_LINK_TYPE, FORUM_LINK_ID_SUFFIX),
class: "ui-hidden"
}),
right_line_div = domsugar('div', { class: "project-line" },
[forum_link]),
right_div = domsugar('div', { class: "project-right" }),
info_div = domsugar('div', { class: "project-info" },
[left_info_div, right_div]),
box_div = domsugar('div', { class: "project-box" },
[title_div, info_div]),
project_li = domsugar('li', {}, [box_div]);
if (supervisor) {
right_div.appendChild(supervisor_field_div);
right_div.appendChild(supervisor_value_div);
}
right_div.appendChild(right_line_div);
return [project_li, left_info_div];
}
function createProjectLineHtmlElement(project_id, portal_type, line_url, title,
total_count, out_count, status_color) {
var status_span = domsugar('span', {
id: getProjectHtlmElementId(project_id, portal_type, STATUS_SPAN),
class: [STATUS_SPAN, status_color, "margined"].join(" ")
}),
name_span = domsugar('span', {
id: getProjectHtlmElementId(project_id, portal_type, NAME_SPAN),
class: "name margined"
}, [title]),
outdated_span = domsugar('span', {
id: getProjectHtlmElementId(project_id, portal_type, OUTDATED_SPAN)
}, [String(out_count)]),
total_span = domsugar('span', {
id: getProjectHtlmElementId(project_id, portal_type, TOTAL_SPAN),
class: "margined"
}, [String(total_count)]),
open_bracket_span = domsugar('span', {}, ["("]),
close_bracket_span = domsugar('span', {}, [")"]),
outdated_label_span = domsugar('span', {}, [
(portal_type === TEST_RESULT_PORTAL_TYPE) ? FAILED_LABEL : OUTDATED_LABEL
]),
number_span = domsugar('span', {
id: getProjectHtlmElementId(project_id, portal_type, NUMBER_SPAN),
class: "ui-hidden"
}, [open_bracket_span, outdated_span, outdated_label_span, close_bracket_span]),
line_div = domsugar('div', { class: "project-line" },
[status_span, total_span, name_span, number_span]),
line_link = domsugar('a', {
href: line_url || ""
}, [line_div]);
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.hash({
url_parameter_list: gadget.getUrlForList(url_parameter_list),
milestone_url_list: gadget.getUrlForList(milestone_url_list),
task_url_list: gadget.getUrlForList(task_url_list),
task_report_url_list: gadget.getUrlForList(task_report_url_list),
bug_url_list: gadget.getUrlForList(bug_url_list),
test_result_url_list: gadget.getUrlForList(test_result_url_list),
supervisor_url_list: gadget.getUrlForList(supervisor_url_list)
});
})
.push(function (result_dict) {
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_dict.url_parameter_list[i],
project_list[i].value.source_decision_title,
result_dict.supervisor_url_list[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_dict.milestone_url_list[i];
case 'Task':
return result_dict.task_url_list[i];
case 'Task Report':
return result_dict.task_report_url_list[i];
case 'Bug':
return result_dict.bug_url_list[i];
case 'Test Result':
return result_dict.test_result_url_list[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.detachRenderMilestoneInfo();
gadget.detachRenderOutdatedMilestoneInfo();
gadget.detachRenderProjectDocumentInfo();
gadget.detachRenderOutdatedDocumentInfo();
gadget.detachRenderTestResultInfo();
gadget.detachRenderProjectForumLink();
});
})
.declareJob("detachRenderMilestoneInfo", function () {
return renderMilestoneLineList(this);
})
.declareJob("detachRenderOutdatedMilestoneInfo", function () {
return renderMilestoneLineList(this, MILESTONE_LIMIT_DATE);
})
.declareJob("detachRenderProjectDocumentInfo", function () {
return renderProjectDocumentLines(this);
})
.declareJob("detachRenderOutdatedDocumentInfo", function () {
return renderProjectDocumentLines(this, DOCUMENT_LIMIT_DATE);
})
.declareJob("detachRenderTestResultInfo", 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("detachRenderProjectForumLink", 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, domsugar));
\ No newline at end of file
<?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.41488.58477.39116</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>1584697605.84</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,9 @@
<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 type="text/javascript" src="domsugar.js"></script>
<script src="gadget_erp5_page_project_page.js"></script>
<link rel="stylesheet" type="text/css" href="gadget_erp5_page_project.css">
</head>
<body>
......
<?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.28062.10213.8174</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>1584629131.92</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, domsugar*/
(function (window, rJS, RSVP, document, ensureArray, DOMParser, XMLSerializer,
SimpleQuery, ComplexQuery, Query, domsugar) {
"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,16 @@
var parser = new DOMParser(), i,
oSerializer = new XMLSerializer(),
doc = parser.parseFromString(html, "text/html"),
link_list = doc.getElementsByTagName("a");
link_list = doc.querySelectorAll("a");
doc.querySelector("head").appendChild(domsugar('link', {
href: "gadget_erp5_page_project.css",
type: "text/css",
rel: "stylesheet"
}));
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,43 +45,21 @@
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"
});
}
......@@ -111,16 +101,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 +159,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 +171,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 +247,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 +270,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"],
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_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"],
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"],
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"]])
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 +327,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);
});
})
......@@ -297,4 +353,4 @@
return true;
});
}(window, rJS, RSVP, document, ensureArray, DOMParser, XMLSerializer, SimpleQuery, ComplexQuery, Query));
\ No newline at end of file
}(window, rJS, RSVP, document, ensureArray, DOMParser, XMLSerializer, SimpleQuery, ComplexQuery, Query, domsugar));
\ No newline at end of file
<?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.41335.49696.64290</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>1584629384.78</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>
......@@ -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 Forum link -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-right']//a[contains(@id, 'documented-project') and contains(@id, 'link-forum') and @href='test-forum-link' and text()='Project Forum']</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,204 @@ if home_page:
follow_up_value = project)
home_page.publishAlive()
if create_project_documents:
project.setForumLinkUrlString("test-forum-link")
# 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