Commit 4703e930 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: Move development actions from panel to tab

parent f3320c75
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jio_raw</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>jump_to_portal_type</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit Portal Type</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: "%s?ignore_layout:int=1" % portal.portal_types.getTypeInfo(object).absolute_url_path()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: portal.portal_types.getTypeInfo(object) and portal.portal_types.getTypeInfo(object).Base_getSourceVisibility()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
view_list, view_list,
action_list, action_list,
jump_list, jump_list,
raw_list,
i; i;
if (visible === undefined) { if (visible === undefined) {
...@@ -91,7 +90,6 @@ ...@@ -91,7 +90,6 @@
.concat(ensureArray(erp5_document._links.action_object_jio_button)) .concat(ensureArray(erp5_document._links.action_object_jio_button))
.concat(ensureArray(erp5_document._links.action_object_jio_fast_input)); .concat(ensureArray(erp5_document._links.action_object_jio_fast_input));
jump_list = ensureArray(erp5_document._links.action_object_jio_jump); jump_list = ensureArray(erp5_document._links.action_object_jio_jump);
raw_list = ensureArray(erp5_document._links.action_object_jio_raw);
if (view === 'view') { if (view === 'view') {
for (i = 0; i < view_list.length; i += 1) { for (i = 0; i < view_list.length; i += 1) {
...@@ -117,8 +115,8 @@ ...@@ -117,8 +115,8 @@
view_list = JSON.stringify(view_list); view_list = JSON.stringify(view_list);
action_list = JSON.stringify(action_list); action_list = JSON.stringify(action_list);
jump_list = JSON.stringify(jump_list); jump_list = JSON.stringify(jump_list);
raw_list = JSON.stringify(raw_list);
} }
return context.getUrlParameter('editable') return context.getUrlParameter('editable')
.push(function (editable) { .push(function (editable) {
return context.changeState({ return context.changeState({
...@@ -128,7 +126,6 @@ ...@@ -128,7 +126,6 @@
view_list: view_list, view_list: view_list,
action_list: action_list, action_list: action_list,
jump_list: jump_list, jump_list: jump_list,
raw_list: raw_list,
global: true, global: true,
jio_key: jio_key, jio_key: jio_key,
view: view, view: view,
...@@ -254,7 +251,6 @@ ...@@ -254,7 +251,6 @@
modification_dict.hasOwnProperty("workflow_list") || modification_dict.hasOwnProperty("workflow_list") ||
modification_dict.hasOwnProperty("action_list") || modification_dict.hasOwnProperty("action_list") ||
modification_dict.hasOwnProperty("jump_list") || modification_dict.hasOwnProperty("jump_list") ||
modification_dict.hasOwnProperty("raw_list") ||
modification_dict.hasOwnProperty("jio_key") || modification_dict.hasOwnProperty("jio_key") ||
modification_dict.hasOwnProperty("view_list"))) { modification_dict.hasOwnProperty("view_list"))) {
if (this.state.view_list === undefined) { if (this.state.view_list === undefined) {
...@@ -266,8 +262,7 @@ ...@@ -266,8 +262,7 @@
parameter_list = [], parameter_list = [],
view_list = JSON.parse(gadget.state.view_list), view_list = JSON.parse(gadget.state.view_list),
action_list = JSON.parse(gadget.state.action_list), action_list = JSON.parse(gadget.state.action_list),
jump_list = JSON.parse(gadget.state.jump_list), jump_list = JSON.parse(gadget.state.jump_list);
raw_list = JSON.parse(gadget.state.raw_list);
workflow_list = JSON.parse(gadget.state.workflow_list); workflow_list = JSON.parse(gadget.state.workflow_list);
for (i = 0; i < view_list.length; i += 1) { for (i = 0; i < view_list.length; i += 1) {
...@@ -306,18 +301,10 @@ ...@@ -306,18 +301,10 @@
} }
}); });
} }
for (i = 0; i < raw_list.length; i += 1) {
parameter_list.push({
command: 'raw',
options: {
url: raw_list[i].href
}
});
}
return RSVP.all([ return RSVP.all([
gadget.getUrlForList(parameter_list), gadget.getUrlForList(parameter_list),
gadget.getTranslationList(['Views', 'Workflows', 'Actions', gadget.getTranslationList(['Views', 'Workflows', 'Actions',
'Jumps', 'Developer Mode']) 'Jumps'])
]); ]);
}) })
.push(function (result_list) { .push(function (result_list) {
...@@ -325,8 +312,7 @@ ...@@ -325,8 +312,7 @@
dl_fragment = document.createDocumentFragment(), dl_fragment = document.createDocumentFragment(),
view_list = JSON.parse(gadget.state.view_list), view_list = JSON.parse(gadget.state.view_list),
action_list = JSON.parse(gadget.state.action_list), action_list = JSON.parse(gadget.state.action_list),
jump_list = JSON.parse(gadget.state.jump_list), jump_list = JSON.parse(gadget.state.jump_list);
raw_list = JSON.parse(gadget.state.raw_list);
appendDt(dl_fragment, result_list[1][0], 'eye', appendDt(dl_fragment, result_list[1][0], 'eye',
view_list, result_list[0], 0); view_list, result_list[0], 0);
...@@ -342,12 +328,6 @@ ...@@ -342,12 +328,6 @@
jump_list, result_list[0], jump_list, result_list[0],
view_list.length + workflow_list.length + view_list.length + workflow_list.length +
action_list.length); action_list.length);
if (raw_list.length !== 0) {
appendDt(dl_fragment, result_list[1][4], 'plane',
raw_list, result_list[0],
view_list.length + workflow_list.length +
action_list.length);
}
dl_element = gadget.element.querySelector("dl"); dl_element = gadget.element.querySelector("dl");
while (dl_element.firstChild) { while (dl_element.firstChild) {
dl_element.removeChild(dl_element.firstChild); dl_element.removeChild(dl_element.firstChild);
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>988.3902.36248.12305</string> </value> <value> <string>988.9647.45049.61832</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>1605718582.87</float> <float>1606061825.63</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -96,9 +96,11 @@ ...@@ -96,9 +96,11 @@
view_list = [], view_list = [],
tab_list = [], tab_list = [],
jump_action_list = [], jump_action_list = [],
raw_action_list = [],
breadcrumb_action_list = [], breadcrumb_action_list = [],
erp5_document, erp5_document,
jump_list; jump_list,
raw_list;
return gadget.jio_getAttachment(gadget.state.jio_key, "links") return gadget.jio_getAttachment(gadget.state.jio_key, "links")
...@@ -108,6 +110,7 @@ ...@@ -108,6 +110,7 @@
erp5_document = result; erp5_document = result;
view_list = ensureArray(erp5_document._links.view); view_list = ensureArray(erp5_document._links.view);
jump_list = ensureArray(erp5_document._links.action_object_jio_jump); jump_list = ensureArray(erp5_document._links.action_object_jio_jump);
raw_list = ensureArray(erp5_document._links.action_object_jio_raw);
for (i = 0; i < view_list.length; i += 1) { for (i = 0; i < view_list.length; i += 1) {
url_for_kw_list.push({command: 'display_with_history', options: { url_for_kw_list.push({command: 'display_with_history', options: {
...@@ -123,6 +126,14 @@ ...@@ -123,6 +126,14 @@
view: jump_list[i].href view: jump_list[i].href
}}); }});
} }
for (i = 0; i < raw_list.length; i += 1) {
url_for_kw_list.push({
command: 'raw',
options: {
url: raw_list[i].href
}
});
}
url_for_kw_list.push({command: 'cancel_dialog_with_history'}); url_for_kw_list.push({command: 'cancel_dialog_with_history'});
...@@ -131,14 +142,15 @@ ...@@ -131,14 +142,15 @@
_: modifyBreadcrumbList(gadget, _: modifyBreadcrumbList(gadget,
erp5_document._links.parent || "#", erp5_document._links.parent || "#",
breadcrumb_action_list), breadcrumb_action_list),
translation_list: gadget.getTranslationList(['Views', 'Jumps', 'Breadcrumb']), translation_list: gadget.getTranslationList(['Views', 'Jumps', 'Breadcrumb', 'Developer mode']),
page_title: calculatePageTitle(gadget, erp5_document) page_title: calculatePageTitle(gadget, erp5_document)
}); });
}) })
.push(function (result_dict) { .push(function (result_dict) {
var i, var i,
j = 0; j = 0,
sub_element_list;
for (i = 0; i < view_list.length; i += 1) { for (i = 0; i < view_list.length; i += 1) {
tab_list.push({ tab_list.push({
...@@ -154,12 +166,22 @@ ...@@ -154,12 +166,22 @@
}); });
j += 1; j += 1;
} }
for (i = 0; i < raw_list.length; i += 1) {
domsugar(gadget.element, [ raw_action_list.push({
title: raw_list[i].title,
link: result_dict.url_list[j]
});
j += 1;
}
sub_element_list = [
generateSection(result_dict.translation_list[0], 'eye', tab_list), generateSection(result_dict.translation_list[0], 'eye', tab_list),
generateSection(result_dict.translation_list[1], 'plane', jump_action_list), generateSection(result_dict.translation_list[1], 'plane', jump_action_list),
generateSection(result_dict.translation_list[2], 'ellipsis-v', breadcrumb_action_list) generateSection(result_dict.translation_list[2], 'ellipsis-v', breadcrumb_action_list)
]); ];
if (raw_action_list.length > 0) {
sub_element_list.push(generateSection(result_dict.translation_list[3], 'plane', raw_action_list))
}
domsugar(gadget.element, sub_element_list);
return gadget.updateHeader({ return gadget.updateHeader({
back_url: result_dict.url_list[j], back_url: result_dict.url_list[j],
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.62315.62619.21640</string> </value> <value> <string>988.9648.23878.62139</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>1582128721.85</float> <float>1606132898.2</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -12,4 +12,3 @@ Web Style | version_view ...@@ -12,4 +12,3 @@ Web Style | version_view
Web Style | view Web Style | view
Web Style | view_editor Web Style | view_editor
Web Style | web_view Web Style | web_view
portal_actions | jump_to_portal_type
\ No newline at end of file
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