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
gadget_erp5_page_project_redirector.js\n
gadget_erp5_project_panel.html\n
gadget_erp5_project_panel.js\n
gadget_front_page_info.html\n
gadget_front_page_info.js\n
gadget_erp5_page_project_front_page.html\n
gadget_erp5_page_project_front_page.js\n
gadget_project_info.html\n
gadget_project_info.js\n
gadget_project_info.css\n
\n
favicon.ico\n
font-awesome/font-awesome-webfont.eot\n
......@@ -407,7 +408,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>981.52234.40735.41557</string> </value>
<value> <string>981.52279.63159.55722</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -425,7 +426,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1581523847.97</float>
<float>1582797345.19</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -9,31 +9,18 @@
// 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'
}
});
});
}(document, window, rJS));
\ No newline at end of file
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.38481.6518.61474</string> </value>
<value> <string>982.6887.63919.52804</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1577471606.29</float>
<float>1582796228.57</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -6,7 +6,7 @@
<title>Project front page gadget</title>
<script src="rsvp.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">
</head>
......
......@@ -21,9 +21,8 @@
"Test Result" : "Test Results",
"Bug" : "Bugs",
"Project Milestone" : "Milestones",
"Task Report": "Task Reports",
"Support Request" : "Support Requests"};
const PORTAL_TYPE_LIST = ["Task", "Bug", "Task Report", "Support Request"];
"Task Report": "Task Reports"};
const PORTAL_TYPE_LIST = ["Task", "Bug", "Task Report"];
const VALID_STATE_LIST = ["planned", "auto_planned", "ordered", "confirmed", "ready", "stopped", "started", "submitted", "validated"];
function getProjectId(id) {
......@@ -244,23 +243,34 @@
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("getSetting", "getSetting")
.declareMethod('render', function (options) {
return this.changeState(options);
})
.onStateChange(function () {
var gadget = this;
return getProjectList(gadget)
.push(function (project_list) {
return renderProjectList(gadget, project_list);
})
.push(function (project_list) {
options.project_list = project_list;
return gadget.changeState(options);
});
})
.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
gadget.renderMilestoneInfo();
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