Commit c3621f67 authored by Romain Courteaud's avatar Romain Courteaud

erp5_officejs: WIP try to show multiple view actions

parent 2910a940
......@@ -13,6 +13,7 @@
// this is for scenarios were the portal type has several "View"
// (like view, jio_view, custom_view)
// priority: app_view ; default_view ; other
return views_dict;
var only_view, key,
view_list = Object.keys(views_dict).map(function (key) {
if (views_dict[key].title === "View") { return key; }
......@@ -40,6 +41,7 @@
.replace(/,\]/g, ']')
.replace(/\'/g, '"');
configuration_list = JSON.parse(configuration_list_string);
console.log('configuration_list', configuration_list)
for (i = 0; i < configuration_list.length; i += 1) {
pair = configuration_list[i].split(" | ");
if (pair.length !== 2) {
......@@ -59,6 +61,7 @@
throw e;
}
}
console.log('formatted_list', formatted_list);
return formatted_list;
}
......@@ -130,14 +133,18 @@
.declareMethod("getViewAndActionDict", function (portal_type, app_view,
default_view, app_actions_string, jio_key) {
// console.log('app_actions_string', app_actions_string);
var gadget = this,
action_info_dict = {view_list: {}, action_list: {}},
query = buildSearchQuery(portal_type),
app_actions,
app_actions_result = formatSettingList(app_actions_string, portal_type);
console.log('app_actions_string', app_actions_result);
app_actions = app_actions_result.map(function (pair) {
return pair[1];
});
console.log('app_actions', app_actions);
return gadget.jio_allDocs({query: query})
.push(function (action_list) {
var path_for_jio_get_list = [], row;
......@@ -150,6 +157,9 @@
return RSVP.all(path_for_jio_get_list);
})
.push(function (action_document_list) {
// console.log(JSON.stringify(action_document_list));
console.log('app_actions', app_actions);
var action_key, action_doc, action_settings;
for (action_key in action_document_list) {
if (action_document_list.hasOwnProperty(action_key)) {
......@@ -177,8 +187,11 @@
}
}
}
console.log('couscous', JSON.stringify(action_info_dict));
action_info_dict.view_list =
filterViewList(action_info_dict.view_list, app_view, default_view);
console.log('taboulet', JSON.stringify(action_info_dict));
return action_info_dict;
});
})
......
......@@ -275,7 +275,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>987.1958.49484.49100</string> </value>
<value> <string>988.10966.984.65433</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -293,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>1601668696.35</float>
<float>1606140846.1</float>
<string>UTC</string>
</tuple>
</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