Commit 1d45e289 authored by Roque's avatar Roque

erp5_web_project_ui: big refactoring

- web page instead of gadget field
parent a755c0ba
...@@ -115,10 +115,11 @@ gadget_erp5_page_project_redirector.html\n ...@@ -115,10 +115,11 @@ gadget_erp5_page_project_redirector.html\n
gadget_erp5_page_project_redirector.js\n gadget_erp5_page_project_redirector.js\n
gadget_erp5_project_panel.html\n gadget_erp5_project_panel.html\n
gadget_erp5_project_panel.js\n gadget_erp5_project_panel.js\n
gadget_front_page_info.html\n gadget_erp5_page_project_front_page.html\n
gadget_front_page_info.js\n gadget_erp5_page_project_front_page.js\n
gadget_project_info.html\n gadget_project_info.html\n
gadget_project_info.js\n gadget_project_info.js\n
gadget_project_info.css\n
\n \n
favicon.ico\n favicon.ico\n
font-awesome/font-awesome-webfont.eot\n font-awesome/font-awesome-webfont.eot\n
...@@ -407,7 +408,7 @@ NETWORK:\n ...@@ -407,7 +408,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.52234.40735.41557</string> </value> <value> <string>981.52279.63159.55722</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -425,7 +426,7 @@ NETWORK:\n ...@@ -425,7 +426,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1581523847.97</float> <float>1582797345.19</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -9,31 +9,18 @@ ...@@ -9,31 +9,18 @@
// Acquired methods // Acquired methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getSetting", "getSetting")
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// declared methods // declared methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
var gadget = this; return this.redirect({
return gadget.getSetting("hateoas_url") 'command': 'display',
.push(function (hateoas_url) { 'options': {
return gadget.redirect({ 'page': 'project_front_page'
'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"'
}
});
});
}); });
}(document, window, rJS)); }(document, window, rJS));
\ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>980.38481.6518.61474</string> </value> <value> <string>982.6887.63919.52804</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1577471606.29</float> <float>1582796228.57</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<title>Project front page gadget</title> <title>Project front page gadget</title>
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="gadget_front_page_info.js"></script> <script src="gadget_erp5_page_project_front_page.js"></script>
<link rel="stylesheet" type="text/css" href="gadget_project_info.css"> <link rel="stylesheet" type="text/css" href="gadget_project_info.css">
</head> </head>
......
...@@ -21,9 +21,8 @@ ...@@ -21,9 +21,8 @@
"Test Result" : "Test Results", "Test Result" : "Test Results",
"Bug" : "Bugs", "Bug" : "Bugs",
"Project Milestone" : "Milestones", "Project Milestone" : "Milestones",
"Task Report": "Task Reports", "Task Report": "Task Reports"};
"Support Request" : "Support Requests"}; const PORTAL_TYPE_LIST = ["Task", "Bug", "Task Report"];
const PORTAL_TYPE_LIST = ["Task", "Bug", "Task Report", "Support Request"];
const VALID_STATE_LIST = ["planned", "auto_planned", "ordered", "confirmed", "ready", "stopped", "started", "submitted", "validated"]; const VALID_STATE_LIST = ["planned", "auto_planned", "ordered", "confirmed", "ready", "stopped", "started", "submitted", "validated"];
function getProjectId(id) { function getProjectId(id) {
...@@ -244,23 +243,34 @@ ...@@ -244,23 +243,34 @@
rJS(window) rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlForList", "getUrlForList") .declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs") .declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
return this.changeState(options);
})
.onStateChange(function () {
var gadget = this; var gadget = this;
return getProjectList(gadget) return getProjectList(gadget)
.push(function (project_list) { .push(function (project_list) {
return renderProjectList(gadget, project_list); options.project_list = project_list;
}) return gadget.changeState(options);
.push(function (project_list) { });
})
.onStateChange(function (modification_dict) {
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 //run the rest of queries and render async
gadget.renderMilestoneInfo(); gadget.renderMilestoneInfo();
gadget.renderProjectDocumentInfo(); gadget.renderProjectDocumentInfo();
......
<?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_front_page_info.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_front_page_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>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment