Commit b5b0d9d3 authored by Roque's avatar Roque

erp5_officejs: get rid of hardcoded post module rendering (WIP)

- hateoas urls for get and store post module form definition
parent b478d32f
...@@ -255,11 +255,13 @@ jio_appcachestorage.js\n ...@@ -255,11 +255,13 @@ jio_appcachestorage.js\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewAsJio&view=jio_view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewAsJio&view=jio_view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewReplyDialog&view=jio_view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewReplyDialog&view=jio_view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_post%2FPostModule_newHTMLPost&view=jio_view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_post%2FPostModule_newHTMLPost&view=jio_view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_post%2FPostModule_viewHTMLPostList&view=jio_view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F1&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F1&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F2&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F2&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F3&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F3&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F1&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F1&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F2&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F2&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F3&view=view&appcache=1\n
\n \n
gadget_erp5_field_listbox.html\n gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n gadget_erp5_field_listbox.js\n
...@@ -746,7 +748,7 @@ NETWORK:\n ...@@ -746,7 +748,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.23755.19438.47564</string> </value> <value> <string>975.33891.43185.16366</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -764,7 +766,7 @@ NETWORK:\n ...@@ -764,7 +766,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1556573144.76</float> <float>1557091528.6</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -119,11 +119,13 @@ CACHE:\n ...@@ -119,11 +119,13 @@ CACHE:\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewAsJio&view=jio_view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewAsJio&view=jio_view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewReplyDialog&view=jio_view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewReplyDialog&view=jio_view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_post%2FPostModule_newHTMLPost&view=jio_view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_post%2FPostModule_newHTMLPost&view=jio_view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_post%2FPostModule_viewHTMLPostList&view=jio_view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F1&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F1&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F2&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F2&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F3&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F3&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F1&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F1&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F2&view=view&appcache=1\n hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F2&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F3&view=view&appcache=1\n
\n \n
NETWORK:\n NETWORK:\n
* *
...@@ -269,7 +271,7 @@ NETWORK:\n ...@@ -269,7 +271,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.7922.20540.53998</string> </value> <value> <string>975.33891.3939.51882</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +289,7 @@ NETWORK:\n ...@@ -287,7 +289,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1555617928.96</float> <float>1557091674.33</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
"default_params": {}, "default_params": {},
"editable": 1, "editable": 1,
"editable_column_list": [], "editable_column_list": [],
//"key": "field_listbox",
"lines": 30, "lines": 30,
"list_method": "portal_catalog", "list_method": "portal_catalog",
// is this correct? the query should come from the form definition, right? // is this correct? the query should come from the form definition, right?
...@@ -57,7 +56,6 @@ ...@@ -57,7 +56,6 @@
"sort_column_list": [['title', 'Title'], ['modification_date', 'Modification Date']], "sort_column_list": [['title', 'Title'], ['modification_date', 'Modification Date']],
"sort": [['modification_date', 'descending']], "sort": [['modification_date', 'descending']],
"title": "Posts" "title": "Posts"
//"type": "ListBox"
}, },
"tales": {}, "tales": {},
"overrides": {}, "overrides": {},
...@@ -76,24 +74,30 @@ ...@@ -76,24 +74,30 @@
default_view = "jio_view", default_view = "jio_view",
common_utils_gadget_url = "gadget_officejs_common_utils.html", common_utils_gadget_url = "gadget_officejs_common_utils.html",
child_gadget_url = 'gadget_erp5_pt_form_list.html'; child_gadget_url = 'gadget_erp5_pt_form_list.html';
return gadget.declareGadget(common_utils_gadget_url) return RSVP.Queue()
.push(function (gadget_utils) { .push(function () {
return gadget.getFormDefinition(); return RSVP.all([
//return gadget_utils.getFormDefinition(jio_document.portal_type, default_view); gadget.getSetting('parent_portal_type'),
gadget.declareGadget("gadget_officejs_common_utils.html")
]);
}) })
.push(function (form_definition) { .push(function (result) {
return gadget.changeState({ return gadget.getFormDefinition();
jio_key: options.jio_key, //return result[1].getFormDefinition(result[0], default_view);
child_gadget_url: child_gadget_url, })
form_definition: form_definition, .push(function (form_definition) {
form_type: 'list', return gadget.changeState({
editable: false, jio_key: options.jio_key,
view: default_view, child_gadget_url: child_gadget_url,
front_page: true, form_definition: form_definition,
has_more_views: false, //this should come from form_def form_type: 'list',
has_more_actions: false //this should come from form_def editable: false,
view: default_view,
front_page: true,
has_more_views: false, //this should come from form_def
has_more_actions: false //this should come from form_def
});
}); });
});
}) })
.onStateChange(function () { .onStateChange(function () {
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.33670.15324.9233</string> </value> <value> <string>975.33902.30639.19097</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1557077120.63</float> <float>1557091447.99</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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