diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/Base_generateStateBugDomain.py b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/Base_generateStateBugDomain.py index 9d4f8565f007e2c378bbf2f8cfa6f067671f3432..43ec6975f701f9351bffe98edb02bb806cca9564 100644 --- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/Base_generateStateBugDomain.py +++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/Base_generateStateBugDomain.py @@ -1,5 +1,5 @@ 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']) ] diff --git a/bt5/erp5_project/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/bt5/erp5_project/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml index c462cee98a67e10c2ef0332efc1b779629ce5f65..1799d56ac364751f1d668df786d9657c54ce794b 100644 --- a/bt5/erp5_project/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml +++ b/bt5/erp5_project/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml @@ -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> diff --git a/bt5/erp5_project/PortalTypePropertySheetTemplateItem/property_sheet_list.xml b/bt5/erp5_project/PortalTypePropertySheetTemplateItem/property_sheet_list.xml index ab484f28624544f6fab6e8e2f6e6c3511c9264f9..813b4c8e591cb7c437980186c49ffdec17e9908f 100644 --- a/bt5/erp5_project/PortalTypePropertySheetTemplateItem/property_sheet_list.xml +++ b/bt5/erp5_project/PortalTypePropertySheetTemplateItem/property_sheet_list.xml @@ -1,6 +1,7 @@ <property_sheet_list> <portal_type id="Project"> <item>Codification</item> + <item>Project</item> </portal_type> <portal_type id="Project Line"> <item>Amount</item> diff --git a/bt5/erp5_project/PropertySheetTemplateItem/portal_property_sheets/Project.xml b/bt5/erp5_project/PropertySheetTemplateItem/portal_property_sheets/Project.xml new file mode 100644 index 0000000000000000000000000000000000000000..a43cd09ece6fbfbcd67e6448c89e38c6a9df60a9 --- /dev/null +++ b/bt5/erp5_project/PropertySheetTemplateItem/portal_property_sheets/Project.xml @@ -0,0 +1,66 @@ +<?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> diff --git a/bt5/erp5_project/PropertySheetTemplateItem/portal_property_sheets/Project/forum_link_property.xml b/bt5/erp5_project/PropertySheetTemplateItem/portal_property_sheets/Project/forum_link_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..9fab5b8c7b1b5755b48d9d65c929c4efc5f8de53 --- /dev/null +++ b/bt5/erp5_project/PropertySheetTemplateItem/portal_property_sheets/Project/forum_link_property.xml @@ -0,0 +1,143 @@ +<?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> diff --git a/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Base_generateStateTaskDomain.py b/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Base_generateStateTaskDomain.py index f0da40e684fd13da54c5a2ee32b7eb305cec3243..29cae95b389b96aed04a1f7321be77d706c83356 100644 --- a/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Base_generateStateTaskDomain.py +++ b/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Base_generateStateTaskDomain.py @@ -1,5 +1,4 @@ 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']) ] diff --git a/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Base_generateStateTaskReportDomain.py b/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Base_generateStateTaskReportDomain.py index a609a11f799acb9fe7c4c3bcb1f050ef8fcb618a..7d1fa4d0e088833bb2b6dd12d584d7d5081faec5 100644 --- a/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Base_generateStateTaskReportDomain.py +++ b/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Base_generateStateTaskReportDomain.py @@ -1,4 +1,4 @@ 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']) ] diff --git a/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_view.xml b/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_view.xml index 4e8b889cab5e149fd005acc8d629e6526d78c98c..587e2c64010e5bf8d50539f59fc21e93a3991f74 100644 --- a/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_view.xml +++ b/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_view.xml @@ -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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/listbox_delivery_stop_date.xml b/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_view/my_forum_link_url_string.xml similarity index 88% rename from bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/listbox_delivery_stop_date.xml rename to bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_view/my_forum_link_url_string.xml index 7e6bdf7178f1f4f666ee375a8bc3093052c1bb79..8b00cff8e1856dd0a83191e6eb9caa75ca741192 100644 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/listbox_delivery_stop_date.xml +++ b/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_view/my_forum_link_url_string.xml @@ -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> diff --git a/bt5/erp5_project/bt/skip_coding_style_test b/bt5/erp5_project/bt/skip_coding_style_test deleted file mode 100644 index 56a6051ca2b02b04ef92d5150c9ef600403cb1de..0000000000000000000000000000000000000000 --- a/bt5/erp5_project/bt/skip_coding_style_test +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/bt5/erp5_project/bt/template_portal_type_allowed_content_type_list b/bt5/erp5_project/bt/template_portal_type_allowed_content_type_list index 5d48b3437bd5a67e9a50a3acd09eb872c908ab34..5eb1b5cf14057d007e22a91401184940c6bba376 100644 --- a/bt5/erp5_project/bt/template_portal_type_allowed_content_type_list +++ b/bt5/erp5_project/bt/template_portal_type_allowed_content_type_list @@ -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 diff --git a/bt5/erp5_project/bt/template_portal_type_property_sheet_list b/bt5/erp5_project/bt/template_portal_type_property_sheet_list index da21a3ba4dabd1aa1cae81215d88c5452977fc14..9ef3bf88d4770117ab7c3e868166c9ba62f2fb07 100644 --- a/bt5/erp5_project/bt/template_portal_type_property_sheet_list +++ b/bt5/erp5_project/bt/template_portal_type_property_sheet_list @@ -4,6 +4,7 @@ Project Line | SortIndex Project Milestone | OutcomeDescription Project Milestone | SortIndex Project | Codification +Project | Project Requirement Document | Reference Requirement | Comment Requirement | Document diff --git a/bt5/erp5_project/bt/template_property_sheet_id_list b/bt5/erp5_project/bt/template_property_sheet_id_list index 4ee6f3ecc92bdbe065b236d0684b17e14fa68135..dda1cd24a8b058a0832bae9cc5cf84b21641ac50 100644 --- a/bt5/erp5_project/bt/template_property_sheet_id_list +++ b/bt5/erp5_project/bt/template_property_sheet_id_list @@ -1,2 +1,3 @@ TaskOrder -ProjectPreference \ No newline at end of file +ProjectPreference +Project \ No newline at end of file diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_controller_js.js b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_controller_js.js index c50ff739f80e7ca54a3320c4d278961191bc4ab5..f24123787389226bd8d37562bc495757570b1097 100644 --- a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_controller_js.js +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_controller_js.js @@ -9,31 +9,19 @@ // Acquired methods ///////////////////////////////////////////////////////////////// .declareAcquiredMethod("redirect", "redirect") - .declareAcquiredMethod("getSetting", "getSetting") ///////////////////////////////////////////////////////////////// // declared methods ///////////////////////////////////////////////////////////////// .declareMethod("render", function (options) { - var gadget = this; - return gadget.getSetting("hateoas_url") - .push(function (hateoas_url) { - return gadget.redirect({ - 'command': 'display', - 'options': { - 'page': 'form', - 'jio_key': 'project_module', - 'view': hateoas_url + - '/ERP5Document_getHateoas?mode=traverse&relative_url=' + - 'project_module&view=ProjectModule_viewProjectManagementList', - 'field_listbox_sort_list:json': [["title", "ascending"]], - 'field_listbox_column_list:json': ["title", - "default_destination_section_title"], - 'extended_search': 'selection_domain_state_project_domain: "started"' - } - }); - }); + return this.redirect({ + 'command': 'display', + 'options': { + 'page': 'project_front_page', + 'editable': 'true' + } + }); }); }(document, window, rJS)); \ No newline at end of file diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_controller_js.xml b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_controller_js.xml index 3818ebd87bcfecc038cdeb40259a609cde7fb80e..208d5d2fb18cc41e0bbf0082fd9e0644e78db757 100644 --- a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_controller_js.xml +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_controller_js.xml @@ -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> diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_css.css b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_css.css new file mode 100644 index 0000000000000000000000000000000000000000..6df25989c000c68e89e3873bcf68623190cf0ebd --- /dev/null +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_css.css @@ -0,0 +1,253 @@ +/* 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 diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_css.xml b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_css.xml new file mode 100644 index 0000000000000000000000000000000000000000..5d5f8147c0e6e59a04bbf7d410facc278d42cd1e --- /dev/null +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_css.xml @@ -0,0 +1,338 @@ +<?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> diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_html.html b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_html.html new file mode 100644 index 0000000000000000000000000000000000000000..dc5bd169ce975f0aac9183773c86c5f517ed1e0a --- /dev/null +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_html.html @@ -0,0 +1,21 @@ +<!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> diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_html.xml b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_html.xml new file mode 100644 index 0000000000000000000000000000000000000000..10138a03a1bbc428978613985b1eb2c182adc080 --- /dev/null +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_html.xml @@ -0,0 +1,336 @@ +<?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> diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.js b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.js new file mode 100644 index 0000000000000000000000000000000000000000..a8a60f18881ba471492231bf52c16448147c39b6 --- /dev/null +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.js @@ -0,0 +1,607 @@ +/*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 diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.xml b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.xml new file mode 100644 index 0000000000000000000000000000000000000000..0ecc5afd90cb956f74e1476c431bd89d81c480cf --- /dev/null +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.xml @@ -0,0 +1,330 @@ +<?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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.html.html b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_html.html similarity index 92% rename from bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.html.html rename to bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_html.html index 83f4bf2d25bbbfcb8013a6a5afde3dc9bd50affa..91e9a461923aac2821992831047cf889e4be7079 100644 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.html.html +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_html.html @@ -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> @@ -31,4 +32,4 @@ <div data-gadget-url="gadget_editor.html" data-gadget-scope="editor"></div> </div> </body> -</html> +</html> \ No newline at end of file diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_html.xml b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_html.xml new file mode 100644 index 0000000000000000000000000000000000000000..5f5fb3829cdad153dfddb09db82e1a2e39e377f9 --- /dev/null +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_html.xml @@ -0,0 +1,334 @@ +<?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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.js b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.js similarity index 55% rename from bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.js rename to bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.js index 6e348a0db0d76d4be1d76d30aaaa6921a084735d..f127e7f5aa30f4fc9d93d8faa8a3440d6be9c917 100644 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.js +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.js @@ -1,8 +1,13 @@ /*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,44 +45,22 @@ return view_list.filter(d => d.name === name)[0].href; } - function setLatestTestResult(gadget, svg_element, project_jio_key) { - var query = createProjectQuery(project_jio_key, - [["portal_type", "Test Result"]]); - return gadget.jio_allDocs({ - query: query, - limit: 1, - sort_on: [['creation_date', 'descending']], - select_list: ['simulation_state'] - }) - .push(function (result_list) { - var state; - result_list = result_list.data.rows; - if (result_list.length > 0) { - svg_element.classList.remove("ui-hidden"); - state = result_list[0].value.simulation_state; - switch (state) { - case 'started': - svg_element.classList.add("running"); - document.getElementById("test_result_running").classList.remove("ui-hidden"); - break; - case 'failed': - svg_element.classList.add("fail"); - document.getElementById("test_result_fail").classList.remove("ui-hidden"); - break; - case 'cancelled': - svg_element.classList.add("cancelled"); - document.getElementById("test_result_running").classList.remove("ui-hidden"); - break; - case 'stopped': - case 'public_stopped': - svg_element.classList.add("pass"); - document.getElementById("test_result_pass").classList.remove("ui-hidden"); - break; - default: - svg_element.classList.add("ui-hidden"); - } - } - }); + function createMultipleSimpleOrQuery(key, value_list) { + var i, + query_list = []; + for (i = 0; i < value_list.length; i += 1) { + query_list.push(new SimpleQuery({ + key: key, + operator: "", + type: "simple", + value: value_list[i] + })); + } + return new ComplexQuery({ + operator: "OR", + query_list: query_list, + type: "complex" + }); } function createProjectQuery(project_jio_key, key_value_list) { @@ -111,16 +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"], - createProjectQuery(modification_dict.jio_key, - [["selection_domain_state_task_domain", "confirmed"]])), - getUrlParameterDict('support_request_module', "view", [["delivery.start_date", "descending"]], - null, createProjectQuery(modification_dict.jio_key, - [["selection_domain_state_support_domain", "validated"]])), - getUrlParameterDict('bug_module', "view", [["delivery.start_date", "descending"]], - ["title", "description", "source_person_title", "destination_person_title", "delivery.start_date"], - createProjectQuery(modification_dict.jio_key, - [["selection_domain_state_bug_domain", "open"]])), - getUrlParameterDict('task_report_module', 'view', [["delivery.start_date", "descending"]], - ["title", "delivery.start_date", "source_title"], - createProjectQuery(modification_dict.jio_key, - [["selection_domain_state_task_report_domain", "confirmed"]])), - getUrlParameterDict('test_result_module', 'view', [["delivery.start_date", "descending"]], - null, createProjectQuery(modification_dict.jio_key, [])), - getUrlParameterDict('test_suite_module', 'view', [["creation_date", "descending"]], - null, createProjectQuery(modification_dict.jio_key, [["translated_validation_state_title", "validated"]])), - getUrlParameterDict(modification_dict.jio_key, document_view, [["modification_date", "descending"]], - ["download", "title", "reference", "modification_date"], createProjectQuery(null, [["selection_domain_state_document_domain", "confirmed"]])), - getUrlParameterDict(modification_dict.jio_key, activity_view, [["modification_date", "descending"]]) + getUrlParameterDict('milestone_module', + milestone_view, + [["stop_date", "ascending"]], + null, + createProjectQuery(null, [["selection_domain_date_milestone_domain", "future"]])), + getUrlParameterDict('task_module', + "view", + [["delivery.start_date", "descending"]], + ["title", "delivery.start_date", "source_title, translated_simulation_state_title"], + createProjectQuery(modification_dict.jio_key, + [["selection_domain_state_task_domain", "opened"]])), + getUrlParameterDict('support_request_module', + "view", + [["delivery.start_date", "descending"]], + null, + createProjectQuery(modification_dict.jio_key, + [["selection_domain_state_support_domain", "validated"]])), + getUrlParameterDict('bug_module', + "view", + [["delivery.start_date", "descending"]], + ["title", "description", "source_person_title", "destination_person_title", + "delivery.start_date", "translated_simulation_state_title"], + createProjectQuery(modification_dict.jio_key, + [["selection_domain_state_bug_domain", "open"]])), + getUrlParameterDict('task_report_module', + 'view', + [["delivery.start_date", "descending"]], + ["title", "delivery.start_date", "source_title", + "translated_simulation_state_title"], + createProjectQuery(modification_dict.jio_key, + [["selection_domain_state_task_report_domain", "confirmed"]])), + getUrlParameterDict('test_result_module', + 'view', + [["delivery.start_date", "descending"]], + null, + createProjectQuery(modification_dict.jio_key, [])), + getUrlParameterDict('test_suite_module', + 'view', + [["creation_date", "descending"]], + null, + createProjectQuery(modification_dict.jio_key, + [["translated_validation_state_title", "validated"]])), + getUrlParameterDict(modification_dict.jio_key, + document_view, + [["modification_date", "descending"]], + ["download", "title", "reference", "modification_date"], + createProjectQuery(null, [["selection_domain_state_document_domain", "confirmed"]])), + getUrlParameterDict(modification_dict.jio_key, + activity_view, + [["modification_date", "descending"]]) ]; if (web_page_info) { url_parameter_list.push(getUrlParameterDict(web_page_info.id, web_page_info.edit_view)); @@ -273,19 +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 diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.xml b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.xml new file mode 100644 index 0000000000000000000000000000000000000000..1301bd76a687d96ad6056c23a5fd93842ba2d381 --- /dev/null +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.xml @@ -0,0 +1,338 @@ +<?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> diff --git a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_redirector_html.xml b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_redirector_html.xml index 92b6305bb894862a795e1b18b4e276336f46e7e7..5483df58a2de2d5becd41f03d24571f4cd8ebac0 100644 --- a/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_redirector_html.xml +++ b/bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_redirector_html.xml @@ -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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ERP5Site_getProjectTestStatusData.py b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ERP5Site_getProjectTestStatusData.py new file mode 100644 index 0000000000000000000000000000000000000000..b24e9c2c0f3a717667cf7ce067f2925450358a23 --- /dev/null +++ b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ERP5Site_getProjectTestStatusData.py @@ -0,0 +1,18 @@ +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) diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ERP5Site_getProjectTestStatusData.xml b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ERP5Site_getProjectTestStatusData.xml new file mode 100644 index 0000000000000000000000000000000000000000..616005a64eea385ec881f3d54c91746f58afda21 --- /dev/null +++ b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ERP5Site_getProjectTestStatusData.xml @@ -0,0 +1,62 @@ +<?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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList.xml b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList.xml deleted file mode 100644 index d6f3f4741f14e6e34a6384a5e810a4ef47ac4efb..0000000000000000000000000000000000000000 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList.xml +++ /dev/null @@ -1,120 +0,0 @@ -<?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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/listbox.xml b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/listbox.xml deleted file mode 100644 index 8455ce572703a830c0d9812049cabde5ad63e2f1..0000000000000000000000000000000000000000 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/listbox.xml +++ /dev/null @@ -1,259 +0,0 @@ -<?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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/listbox_delivery_start_date.xml b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/listbox_delivery_start_date.xml deleted file mode 100644 index 8a588d8ea089efb769e1cf71137a7af973143499..0000000000000000000000000000000000000000 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/listbox_delivery_start_date.xml +++ /dev/null @@ -1,96 +0,0 @@ -<?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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Project_viewQuickOverview/my_info_gadget_field.xml b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Project_viewQuickOverview/my_info_gadget_field.xml index f55b047e5f0a70cba1e7c67fe3d96754f5592538..3073c6382edc85e51ac94d5f9a0a940cecb90450 100644 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Project_viewQuickOverview/my_info_gadget_field.xml +++ b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Project_viewQuickOverview/my_info_gadget_field.xml @@ -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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.css.css b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.css.css deleted file mode 100644 index 90fd8cbb6b4877762f0b3ee5c47b9c2588ea368e..0000000000000000000000000000000000000000 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.css.css +++ /dev/null @@ -1,126 +0,0 @@ -#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 diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.css.xml b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.css.xml deleted file mode 100644 index 5e9e865ea6d49ecfcd86091047af257a2639eed6..0000000000000000000000000000000000000000 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.css.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.html.xml b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.html.xml deleted file mode 100644 index c8c3de8329b1bd5ef07b6861a29c140b1dd98683..0000000000000000000000000000000000000000 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.html.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?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> diff --git a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.xml b/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.xml deleted file mode 100644 index 1c75b388e44ccffc713d78ccb59625cc4ed591da..0000000000000000000000000000000000000000 --- a/bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?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> diff --git a/bt5/erp5_web_project_ui/bt/dependency_list b/bt5/erp5_web_project_ui/bt/dependency_list index 681ee151b2190de31bd4261b0db126a9ab38eff3..80d7221da1c2607a5ea9c5e78cf45d014524e03a 100644 --- a/bt5/erp5_web_project_ui/bt/dependency_list +++ b/bt5/erp5_web_project_ui/bt/dependency_list @@ -1,2 +1,3 @@ +erp5_forge erp5_project erp5_web_renderjs_ui \ No newline at end of file diff --git a/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsBasicNavigation.zpt b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsBasicNavigation.zpt index 594bee32503cfc4a21967b84bae5bd46557cdb4f..96c4e3888368e13711cacf716c89482ac03c81b2 100644 --- a/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsBasicNavigation.zpt +++ b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsBasicNavigation.zpt @@ -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> diff --git a/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsHomePage.xml b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsFrontPage.xml similarity index 96% rename from bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsHomePage.xml rename to bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsFrontPage.xml index 8c2035fab63829e2a65ee6c1730180d89ed7c9a1..39117fe01231a61322b0517b48e6e4ec6e0ef722 100644 --- a/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsHomePage.xml +++ b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsFrontPage.xml @@ -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> diff --git a/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsFrontPage.zpt b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsFrontPage.zpt new file mode 100644 index 0000000000000000000000000000000000000000..0fdd9bfeb0bf53c409280d104d1c3ed66490e56c --- /dev/null +++ b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsFrontPage.zpt @@ -0,0 +1,295 @@ +<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 diff --git a/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsProjectHomePage.xml b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsProjectHomePage.xml new file mode 100644 index 0000000000000000000000000000000000000000..035732ef1d05a2839e01e59ec9ff594ae9ce02ae --- /dev/null +++ b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsProjectHomePage.xml @@ -0,0 +1,58 @@ +<?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> diff --git a/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsHomePage.zpt b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsProjectHomePage.zpt similarity index 66% rename from bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsHomePage.zpt rename to bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsProjectHomePage.zpt index 8103e055bec402535b8fb940843436f48ac83d78..e462eba82f5a5f069edab2b6a5eb0cd08d2c194c 100644 --- a/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsHomePage.zpt +++ b/bt5/erp5_web_project_ui_test/PathTemplateItem/portal_tests/project_ui_zuite/testRenderjsProjectHomePage.zpt @@ -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> diff --git a/bt5/erp5_web_project_ui_test/SkinTemplateItem/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject.py b/bt5/erp5_web_project_ui_test/SkinTemplateItem/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject.py index 3be7745d1039dfc40ab17b8cdb12876a04feae02..6b2c218312fc4c16c2ac0e8aa4705e20ca0f1c3b 100644 --- a/bt5/erp5_web_project_ui_test/SkinTemplateItem/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject.py +++ b/bt5/erp5_web_project_ui_test/SkinTemplateItem/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject.py @@ -1,10 +1,16 @@ -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 diff --git a/bt5/erp5_web_project_ui_test/SkinTemplateItem/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject.xml b/bt5/erp5_web_project_ui_test/SkinTemplateItem/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject.xml index 11ae0b1d7cc45fbec7d138a2fee306a220e97df0..fb80b980229e72a70df8b2566c32df56eaea128c 100644 --- a/bt5/erp5_web_project_ui_test/SkinTemplateItem/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject.xml +++ b/bt5/erp5_web_project_ui_test/SkinTemplateItem/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject.xml @@ -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>