Commit f3320c75 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: Add developer mode section with links from raw_list

parent dd8bd84a
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
view_list, view_list,
action_list, action_list,
jump_list, jump_list,
raw_list,
i; i;
if (visible === undefined) { if (visible === undefined) {
...@@ -90,6 +91,7 @@ ...@@ -90,6 +91,7 @@
.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) {
...@@ -115,6 +117,7 @@ ...@@ -115,6 +117,7 @@
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) {
...@@ -125,6 +128,7 @@ ...@@ -125,6 +128,7 @@
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,
...@@ -250,6 +254,7 @@ ...@@ -250,6 +254,7 @@
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) {
...@@ -261,7 +266,8 @@ ...@@ -261,7 +266,8 @@
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) {
...@@ -292,7 +298,6 @@ ...@@ -292,7 +298,6 @@
}); });
} }
for (i = 0; i < jump_list.length; i += 1) { for (i = 0; i < jump_list.length; i += 1) {
if (jump_list[i].href.indexOf("http") !== -1) {
parameter_list.push({ parameter_list.push({
command: 'display_dialog_with_history', command: 'display_dialog_with_history',
options: { options: {
...@@ -300,22 +305,19 @@ ...@@ -300,22 +305,19 @@
view: jump_list[i].href view: jump_list[i].href
} }
}); });
} else { }
// support action that redirect developers to the backend for (i = 0; i < raw_list.length; i += 1) {
// For example, link to access a document portal type
parameter_list.push({ parameter_list.push({
command: 'raw', command: 'raw',
options: { options: {
url: jump_list[i].href 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']) 'Jumps', 'Developer Mode'])
]); ]);
}) })
.push(function (result_list) { .push(function (result_list) {
...@@ -323,7 +325,8 @@ ...@@ -323,7 +325,8 @@
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);
...@@ -339,7 +342,12 @@ ...@@ -339,7 +342,12 @@
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.2148.10611.64955</string> </value> <value> <string>988.3902.36248.12305</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>1605623076.71</float> <float>1605718582.87</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