Commit a3c0e2f6 authored by Roque's avatar Roque

Upgrade Notebook OfficeJS app

See merge request nexedi/erp5!1275
parents 624b3d1d 40e1e6b4
Pipeline #12491 failed with stage
in 0 seconds
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_search</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>notebook_editor_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>notebook_editor_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </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>string:${object_url}/NotebookModule_viewNotebookListAsJioForNotebookEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>action_permission</string> </key>
<value>
<tuple>
<string>Add portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_js_script</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>notebook_upload</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>notebook_upload</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Upload</string> </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>string:${object_url}/Base_uploadDialogForNotebookEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>action_permission</string> </key>
<value>
<tuple>
<string>Add portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_js_script</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>notebook_download</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>notebook_download</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Download Notebook</string> </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>string:${object_url}/Base_downloadDialogForNotebookEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>action_permission</string> </key>
<value>
<tuple>
<string>Add portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_js_script</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>notebook_download_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>notebook_download_html</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Download HTML</string> </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>string:${object_url}/Base_downloadHtmlDialogForNotebookEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>action_permission</string> </key>
<value>
<tuple>
<string>Add portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_js_script</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>notebook_editor_clone</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>notebook_editor_clone</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Clone</string> </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>string:${object_url}/Base_cloneNotebookForNotebookEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>notebook_editor_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>notebook_editor_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </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>string:${object_url}/Notebook_viewAsJioForNotebookEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>action_permission</string> </key>
<value>
<tuple>
<string>Add portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_js_script</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>notebook_export</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>notebook_export</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Print</string> </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>string:${object_url}/Base_exportDialogForNotebookEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>action_permission</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>notebook_preview</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>notebook_preview</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Run</string> </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>string:${object_url}/Notebook_previewViewForNotebookEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -156,7 +156,7 @@
action_doc = action_document_list[action_key];
if (app_actions.includes(action_doc.reference)) {
action_settings = {
page: undefined,
page: "handle_action",
jio_key: jio_key,
title: action_doc.title,
action: action_doc.reference,
......@@ -165,11 +165,12 @@
parent_portal_type: portal_type
};
if (view_categorie_list.includes(action_settings.action_type)) {
if (app_view === action_settings.action) {
action_settings.page = "ojs_local_controller";
}
action_info_dict.view_list[action_settings.action] =
action_settings;
} else {
action_settings.page = "handle_action";
action_info_dict.action_list[action_settings.action] =
action_settings;
}
......
......@@ -275,7 +275,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.16928.56199.10649</string> </value>
<value> <string>987.1958.49484.49100</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -293,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>1575473624.38</float>
<float>1601668696.35</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateDocument", "updateDocument")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
......@@ -118,7 +119,7 @@
"type": "GadgetField",
"url": "gadget_editor.html",
"sandbox": "public",
"renderjs_extra": '{"editor": "notebook_editor", "maximize": true}'
"renderjs_extra": '{"editor": "jsmd_editor", "maximize": true}'
}
}},
"_links": {
......
......@@ -62,15 +62,13 @@
</value>
</item>
<item>
<key> <string>categories</string> </key>
<key> <string>content_md5</string> </key>
<value>
<tuple>
<string>classification/collaborative/team</string>
</tuple>
<none/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
......@@ -109,12 +107,6 @@
<key> <string>title</string> </key>
<value> <string>OfficeJS Jio Notebook View JS</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
......@@ -201,7 +193,7 @@
</tuple>
<state>
<tuple>
<float>1524555869.05</float>
<float>1600889170.54</float>
<string>UTC</string>
</tuple>
</state>
......@@ -250,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.42986.60138.7065</string> </value>
<value> <string>986.53108.46138.3464</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -268,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1538406432.04</float>
<float>1600891646.9</float>
<string>UTC</string>
</tuple>
</state>
......@@ -295,7 +287,9 @@
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
......@@ -311,7 +305,7 @@
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
......@@ -329,7 +323,7 @@
</tuple>
<state>
<tuple>
<float>1524555842.41</float>
<float>1600888776.74</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,12 +14,19 @@
</head>
<body>
<script data-renderjs-configuration="configuration_manifest" type="text/x-renderjs-configuration">gadget_officejs_notebook_editor.configuration</script>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Notebook</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Notebook</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Notebooks</script>
<script data-renderjs-configuration="parent_portal_type" type="text/x-renderjs-configuration">Notebook Module</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">notebook_module</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
<script data-renderjs-configuration="portal_skin_folder" type="text/x-renderjs-configuration">erp5_officejs_notebook</script>
<script data-renderjs-configuration="app_view_reference" type="text/x-renderjs-configuration">notebook_editor_view</script>
<script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Notebook | notebook_editor_view', 'Notebook | notebook_preview', 'Notebook | notebook_editor_clone', 'Notebook | notebook_download', 'Notebook | notebook_export', 'Notebook | notebook_download_html', 'Notebook Module | notebook_editor_view', 'Notebook Module | notebook_upload')</script>
<script data-renderjs-configuration="app_allowed_sub_types" type="text/x-renderjs-configuration">('Notebook Module | Notebook',)</script>
<script data-renderjs-configuration="notebook_module_dict" type="text/x-renderjs-configuration">{"front_page": 1, "editable": 0, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 1, "panel_action": 1, "previous_next_button": 0, "history_previous_link": 0, "title": "Notebooks", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
<script data-renderjs-configuration="notebook_dict" type="text/x-renderjs-configuration"> {"front_page": 0, "editable": 1, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 0, "panel_action": 1, "previous_next_button": 1, "history_previous_link": 1, "title": "Notebook", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
<script data-renderjs-configuration="upload_dict" type="text/x-renderjs-configuration">{"txt": "txt", "html": "html"}</script>
<script data-renderjs-configuration="file_extension" type="text/x-renderjs-configuration">txt</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
<script data-renderjs-configuration="dropbox_app_key" type="text/x-renderjs-configuration">82g9eir551nhovs</script>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
</body>
......
......@@ -284,7 +284,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.52955.27100.34065</string> </value>
<value> <string>987.50905.4909.48759</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -302,7 +302,7 @@
</tuple>
<state>
<tuple>
<float>1539094329.81</float>
<float>1606414066.38</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -26,7 +26,8 @@
},
"Notebook": {
"url": "officejs_notebook/",
"cache": "gadget_officejs_notebook.appcache"
"storage_type": "precache",
"cache": precache_manifest
},
"Illustration Editor": {
"url": "officejs_svg_editor/",
......
......@@ -258,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>985.28933.8790.47291</string> </value>
<value> <string>986.21093.7100.63419</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -276,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>1595583362.3</float>
<float>1600969351.28</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, document, rJS, RSVP */
/*global window, document, rJS, RSVP, console */
/*jslint nomen: true, indent: 2, maxerr: 10, maxlen: 80 */
(function (window, document, rJS, RSVP) {
(function (window, document, rJS, RSVP, console) {
"use strict";
function declareActionGadget(gadget, state_options) {
var fragment = document.createElement('div');
gadget.element.appendChild(fragment);
return gadget.declareGadget(state_options.action_gadget_url, {
scope: "action_field",
element: fragment
});
}
function submitAction(gadget, action_gadget, state_options, content_dict) {
var submit_dict;
//handleSubmit() may return dictionary entries with
//notification messages or redirect options
state_options.gadget = gadget;
return action_gadget.handleSubmit(content_dict, state_options)
.push(function (result) {
submit_dict = result;
if (submit_dict.notify) {
return gadget.notifySubmitted(submit_dict.notify);
}
})
.push(function () {
if (submit_dict.redirect) {
return gadget.redirect(submit_dict.redirect);
}
}, function (error) {
if (!(error instanceof RSVP.CancellationError)) {
console.log("Action error:", error);
return gadget.notifySubmitted({
message: "Action Failed",
status: "error"
});
}
throw error;
});
}
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
......@@ -12,6 +49,7 @@
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("updateHeader", "updateHeader")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -34,7 +72,11 @@
})
.declareMethod("render", function (options) {
var gadget = this, action_reference;
var gadget = this,
action_reference,
form_definition,
state_options,
action_gadget;
return RSVP.Queue()
.push(function () {
return RSVP.all([
......@@ -44,24 +86,33 @@
]);
})
.push(function (result) {
if (result[0] !== undefined) { options.portal_type = result[0]; }
if (result[0] !== undefined) {
options.portal_type = result[0];
}
if (result[1] !== undefined) {
options.parent_relative_url = result[1];
}
action_reference = result[2];
return gadget.getActionFormDefinition(action_reference);
})
.push(function (form_definition) {
var fragment = document.createElement('div'),
action_gadget_url,
form_type = form_definition.form_type,
.push(function (result) {
form_definition = result;
var form_type = form_definition.form_type,
child_gadget_url = form_definition.child_gadget_url,
//an action form must have a GadgetField called
//"gadget_field_new_action_js_script"
//this gadget will point the custom action gadget
valid_action = form_definition.action_type ===
"object_jio_js_script" && form_definition.fields_raw_properties
.hasOwnProperty("gadget_field_action_js_script"),
//action validity determined by gadget_field_action_js_script field
valid_action = form_definition.fields_raw_properties
.hasOwnProperty("gadget_field_action_js_script");
if (!valid_action) {
return gadget.notifySubmitted({
message: 'Could not perform this action: configuration error',
status: 'fail'
})
.push(function (result) {
return gadget.redirect({
'command': 'display'
});
});
}
state_options = {
doc: {},
action_options: options,
......@@ -69,37 +120,30 @@
form_type: form_type,
form_definition: form_definition,
view: action_reference,
valid_action: valid_action
valid_action: valid_action,
action_gadget_url: form_definition.fields_raw_properties
.gadget_field_action_js_script.values.gadget_url
};
if (valid_action) {
action_gadget_url = form_definition.fields_raw_properties
.gadget_field_action_js_script.values.gadget_url;
// as custom gadget render is being done here
// avoid to child gadget to render it
delete form_definition.fields_raw_properties
.gadget_field_action_js_script;
gadget.element.appendChild(fragment);
return gadget.declareGadget(action_gadget_url, {
scope: "action_field",
element: fragment
return declareActionGadget(gadget, state_options);
})
.push(function (action_gadget) {
.push(function (result) {
action_gadget = result;
options.form_definition = form_definition;
//preRenderDocument() may return a document dict with fields to be
//rendered in the action form, or configurations like skip_action_form
return action_gadget.preRenderDocument(options);
})
.push(function (doc) {
state_options.doc = doc;
state_options.action_gadget_url = action_gadget_url;
return gadget.changeState(state_options);
}, function (error) {
if (error.status === 404) {
return gadget.notifySubmitted({
message: "Error in action",
status: "error"
});
if (doc.header_dict) {
state_options.header_dict = doc.header_dict;
delete doc.header_dict;
}
throw error;
});
state_options.doc = doc;
if (doc.skip_action_form) {
delete state_options.doc.skip_action_form;
return submitAction(gadget, action_gadget, state_options, {});
}
return gadget.changeState(state_options);
});
......@@ -116,6 +160,11 @@
{element: fragment, scope: 'fg'})
.push(function (form_view_gadget) {
return form_view_gadget.render(gadget.state);
})
.push(function () {
if (gadget.state.header_dict) {
return gadget.updateHeader(gadget.state.header_dict);
}
});
})
......@@ -128,40 +177,15 @@
.allowPublicAcquisition('submitContent', function (options) {
var gadget = this,
//target_url = options[1],
content_dict = options[2],
fragment = document.createElement('div'),
submit_dict;
content_dict = options[2];
if (gadget.state.valid_action) {
return gadget.notifySubmitting()
.push(function () {
gadget.element.appendChild(fragment);
return gadget.declareGadget(gadget.state.action_gadget_url, {
scope: "action_field",
element: fragment
});
return declareActionGadget(gadget, gadget.state);
})
.push(function (action_gadget) {
return action_gadget.handleSubmit(content_dict, gadget.state);
})
.push(function (submit_result) {
submit_dict = submit_result;
//submit_dict must contain:
//notify: options_dict for notifySubmitted
//redirect: options_dict for redirect
return gadget.notifySubmitted(submit_dict.notify);
})
.push(function () {
return gadget.redirect(submit_dict.redirect);
}, function (error) {
if (!(error instanceof RSVP.CancellationError)) {
console.log("Action error:", error);
return gadget.notifySubmitted({
message: "Action Failed",
status: "error"
});
}
throw error;
return submitAction(gadget, action_gadget,
gadget.state, content_dict);
});
}
return gadget.notifySubmitted(
......@@ -169,4 +193,4 @@
status: 'fail'});
});
}(window, document, rJS, RSVP));
}(window, document, rJS, RSVP, console));
......@@ -275,7 +275,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>986.35897.25368.15923</string> </value>
<value> <string>987.1942.40980.22510</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -293,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>1599861051.55</float>
<float>1601668958.25</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Notebook Download Action</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="notebook_download_action.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, Blob */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Blob) {
"use strict";
function downloadFromTextContent(gadget, text_content, title) {
var element = gadget.element,
a = window.document.createElement("a"),
url = window.URL.createObjectURL(new Blob([text_content], {type: 'text/plain'})),
name_list = [title, "txt"];
element.appendChild(a);
a.style = "display: none";
a.href = url;
a.download = name_list.join('.');
a.click();
element.removeChild(a);
window.URL.revokeObjectURL(url);
}
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_get", "jio_get")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('preRenderDocument', function (parent_options) {
return { title: parent_options.form_definition.title,
skip_action_form: true };
})
.declareMethod('handleSubmit', function (content_dict, parent_options) {
var gadget = this,
return_submit_dict = {};
return gadget.jio_get(parent_options.action_options.jio_key)
.push(function (document) {
return downloadFromTextContent(gadget, document.text_content, document.title);
})
.push(function (jio_key) {
return_submit_dict.redirect = {
command: 'display',
options: {
jio_key: parent_options.action_options.jio_key,
editable: true
}
};
return return_submit_dict;
}, function (error) {
return_submit_dict.notify = {
message: "Failure downloading document",
status: "error"
};
return return_submit_dict;
});
});
}(window, rJS, RSVP, Blob));
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Notebook Download HTML Action</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="notebook_download_html_action.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*global window, document, rJS, RSVP, Blob, console */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, document, rJS, RSVP, Blob, console) {
"use strict";
function downloadHTML(gadget, html_content, title) {
var element = gadget.element,
a = window.document.createElement("a"),
url = window.URL.createObjectURL(new Blob([html_content], {type: 'text/plain'})),
name_list = [title, "html"];
element.appendChild(a);
a.style = "display: none";
a.href = url;
a.download = name_list.join('.');
a.click();
element.removeChild(a);
window.URL.revokeObjectURL(url);
}
function removeScripts(head_inner_html) {
var div = document.createElement('div'), script_list, i;
div.innerHTML = head_inner_html;
script_list = div.getElementsByTagName('script');
i = script_list.length;
while (i--) {
script_list[i].parentNode.removeChild(script_list[i]);
}
return div.innerHTML;
}
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_get", "jio_get")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('preRenderDocument', function (parent_options) {
return this.jio_get(parent_options.jio_key);
})
.declareMethod('handleSubmit', function (content_dict, parent_options) {
var gadget = this,
notebook_html,
return_submit_dict = {};
return_submit_dict.redirect = {
command: 'display',
options: {
jio_key: parent_options.action_options.jio_key,
editable: true
}
};
return parent_options.gadget.getDeclaredGadget("fg")
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (content_dict) {
if (Object.keys(content_dict).length === 0) {
return_submit_dict.notify = {
message: "Wait until the notebook is fully executed",
status: "error"
};
delete return_submit_dict.redirect;
return return_submit_dict;
}
notebook_html = removeScripts(content_dict.text_content);
return new RSVP.Queue()
.push(function () {
return downloadHTML(gadget, notebook_html,
parent_options.doc.title);
})
.push(function () {
return return_submit_dict;
})
.push(undefined, function (error) {
console.log("ERROR:", error);
return_submit_dict.notify = {
message: "Failure exporting document",
status: "error"
};
return_submit_dict.redirect = {
command: 'display',
options: {
jio_key: parent_options.action_options.jio_key,
editable: true
}
};
return return_submit_dict;
});
});
});
}(window, document, rJS, RSVP, Blob, console));
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Notebook Print Action</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="notebook_export_action.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*global window, document, rJS, RSVP, console */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, document, rJS, RSVP, console) {
"use strict";
function removeScripts(head_inner_html) {
var div = document.createElement('div'), script_list, i;
div.innerHTML = head_inner_html;
script_list = div.getElementsByTagName('script');
i = script_list.length;
while (i--) {
script_list[i].parentNode.removeChild(script_list[i]);
}
return div.innerHTML;
}
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_get", "jio_get")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('preRenderDocument', function (parent_options) {
return this.jio_get(parent_options.jio_key)
.push(function (doc) {
//add pagination cells at the end of the notebook
doc.text_content += '\n%% resource\n' +
'paged.polyfill.js\n' +
'interface.css';
return doc;
});
})
.declareMethod('handleSubmit', function (content_dict, parent_options) {
var gadget = this,
notebook_html,
print_preview_window,
return_submit_dict = {};
return_submit_dict.redirect = {
command: 'display',
options: {
jio_key: parent_options.action_options.jio_key,
editable: true
}
};
return parent_options.gadget.getDeclaredGadget("fg")
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (content_dict) {
if (Object.keys(content_dict).length === 0) {
return_submit_dict.notify = {
message: "Wait until the notebook is fully executed",
status: "error"
};
delete return_submit_dict.redirect;
return return_submit_dict;
}
notebook_html = removeScripts(content_dict.text_content);
return new RSVP.Queue()
.push(function () {
print_preview_window = window.open('', '', 'height=400,width=800');
print_preview_window.document.write(notebook_html);
print_preview_window.document.title = parent_options.doc.title;
print_preview_window.onafterprint = function () {
print_preview_window.close();
};
return print_preview_window.document.close();
})
.push(function () {
print_preview_window.print();
})
.push(function () {
return return_submit_dict;
})
.push(undefined, function (error) {
console.log("ERROR:", error);
return_submit_dict.notify = {
message: "Failure exporting document",
status: "error"
};
return return_submit_dict;
});
});
});
}(window, document, rJS, RSVP, console));
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Notebook Run Action</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="notebook_preview_view.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, Blob, jIO */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Blob, jIO) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('preRenderDocument', function (parent_options) {
var gadget = this, document;
return gadget.jio_get(parent_options.jio_key)
.push(function (doc) {
document = doc;
return gadget.getUrlFor({command: 'history_previous'});
})
.push(function (url) {
document.header_dict = { "page_title": document.title,
"selection_url": url
};
return document;
});
})
.declareMethod('handleSubmit', function (content_dict, parent_options) {
return {};
});
}(window, rJS, RSVP, Blob, jIO));
\ No newline at end of file
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Manifest" module="erp5.portal_type"/>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -61,15 +61,6 @@
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>contributor/person_module/1</string>
<string>classification/collaborative/team</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
......@@ -78,11 +69,13 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_notebook.appcache</string> </value>
<value> <string>notebook_preview_view.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -92,193 +85,25 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_notebook.appcache</string> </value>
<value> <string>officejs_notebook_preview_view_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Manifest</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>CACHE MANIFEST\n
# generated on Fri, 01 Feb 2019 11:45:33 +0000\n
# XXX + fonts\n
# images/ajax-loader.gif\n
CACHE:\n
\n
#notebook\n
gadget_officejs_notebook.json\n
nexedi_logo_officejs_iodide.svg\n
gadget_officejs_notebook_router.html\n
gadget_officejs_jio_notebook_view.html\n
gadget_officejs_jio_notebook_view.js\n
gadget_officejs_jio_notebook.js\n
gadget_erp5_page_ojs_upload.js\n
gadget_erp5_page_ojs_upload.html\n
gadget_erp5_page_ojs_download.js\n
gadget_erp5_page_ojs_download.html\n
gadget_erp5_page_ojs_notebook_list.js\n
gadget_erp5_page_ojs_notebook_list.html\n
gadget_notebook.html\n
iodide_master.js\n
iodide_master.css\n
pyodide.js\n
pyodide.asm.data.js\n
pyodide.asm.js\n
pyodide.asm.wasm\n
pyodide.asm.data\n
cycler.data\n
cycler.js\n
kiwisolver.data\n
kiwisolver.js\n
matplotlib.data\n
matplotlib.js\n
numpy.data\n
numpy.js\n
packages.json\n
pandas.data\n
pandas.js\n
pyodide.asm.html\n
pyodide.py\n
pyparsing.data\n
pyparsing.js\n
python-dateutil.data\n
python-dateutil.js\n
python.html\n
pytz.data\n
pytz.js\n
renderedhtml.css\n
xlrd.data\n
xlrd.js\n
\n
font-awesome/font-awesome.css\n
font-awesome/font-awesome-webfont.eot\n
font-awesome/font-awesome-webfont.woff\n
font-awesome/font-awesome-webfont.woff2\n
font-awesome/font-awesome-webfont.ttf\n
font-awesome/font-awesome-webfont.svg\n
gadget_erp5_nojqm.css\n
jio_ojs_storage.js\n
gadget_erp5_global.js\n
URI.js\n
handlebars.js\n
domsugar.js\n
jiodev.js\n
renderjs.js\n
rsvp.js\n
gadget_global.js\n
erp5_launcher_nojqm.js\n
gadget_officejs_router.js\n
gadget_erp5_router.html\n
gadget_erp5_router.js\n
gadget_jio.html\n
gadget_jio.js\n
gadget_translate.html\n
gadget_translate.js\n
gadget_translation.html\n
gadget_translation.js\n
gadget_translation_data.js\n
gadget_erp5_editor_panel.html\n
gadget_erp5_editor_panel.js\n
gadget_erp5_ojs_panel.html\n
gadget_erp5_ojs_panel.js\n
gadget_erp5_header.html\n
gadget_erp5_header.js\n
gadget_ojs_jio.html\n
gadget_ojs_jio.js\n
gadget_erp5_page_ojs_controller.html\n
gadget_erp5_page_ojs_controller.js\n
gadget_erp5_page_ojs_add_document.html\n
gadget_erp5_page_ojs_add_document.js\n
gadget_erp5_page_ojs_configurator.html\n
gadget_erp5_page_ojs_configurator.js\n
gadget_erp5_page_ojs_dav_configurator.html\n
gadget_erp5_page_ojs_dav_configurator.js\n
gadget_erp5_page_ojs_erp5_configurator.html\n
gadget_erp5_page_ojs_erp5_configurator.js\n
gadget_erp5_page_ojs_dropbox_configurator.html\n
gadget_erp5_page_ojs_dropbox_configurator.js\n
gadget_erp5_page_ojs_linshare_configurator.html\n
gadget_erp5_page_ojs_linshare_configurator.js\n
gadget_erp5_page_ojs_sync.html\n
gadget_erp5_page_ojs_sync.js\n
gadget_erp5_page_ojs_document_list.html\n
gadget_erp5_page_ojs_document_list.js\n
gadget_ojs_configurator_access.html\n
gadget_ojs_configurator_access.js\n
gadget_html5_input.html\n
gadget_html5_input.js\n
gadget_erp5_field_multicheckbox.html\n
gadget_erp5_field_multicheckbox.js\n
gadget_erp5_searchfield.html\n
gadget_erp5_searchfield.js\n
gadget_erp5_pt_form_list.html\n
gadget_erp5_pt_form_list.js\n
gadget_erp5_pt_form_dialog.html\n
gadget_erp5_pt_form_dialog.js\n
gadget_erp5_form.html\n
gadget_erp5_form.js\n
gadget_erp5_label_field.html\n
gadget_erp5_label_field.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_erp5_field_datetime.html\n
gadget_erp5_field_datetime.js\n
gadget_erp5_field_file.html\n
gadget_erp5_field_file.js\n
gadget_html5_element.html\n
gadget_html5_element.js\n
gadget_erp5_notification.html\n
gadget_erp5_notification.js\n
gadget_erp5_field_string.html\n
gadget_erp5_field_string.js\n
gadget_erp5_field_editor.html\n
gadget_erp5_field_editor.js\n
gadget_erp5_field_gadget.html\n
gadget_erp5_field_gadget.js\n
gadget_erp5_search_editor.html\n
gadget_erp5_search_editor.js\n
gadget_erp5_sort_editor.html\n
gadget_erp5_sort_editor.js\n
gadget_erp5_field_password.html\n
gadget_erp5_field_password.js\n
gadget_erp5_field_textarea.html\n
gadget_erp5_field_textarea.js\n
gadget_html5_textarea.html\n
gadget_html5_textarea.js\n
gadget_editor.html\n
gadget_editor.js\n
gadget_button_maximize.html\n
gadget_button_maximize.js\n
gadget_erp5_configure_editor.html\n
gadget_erp5_configure_editor.js\n
\n
#setting\n
gadget_officejs_setting.js\n
gadget_officejs_setting.html\n
\n
NETWORK:\n
*</string> </value>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>OfficeJS Notebook AppCache</string> </value>
<key> <string>short_title</string> </key>
<value> <string>Notebook Preview View JS</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
<key> <string>title</string> </key>
<value> <string>OfficeJS Notebook Preview View JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -366,7 +191,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1524736431.91</float>
<float>1601659529.75</float>
<string>UTC</string>
</tuple>
</state>
......@@ -415,7 +240,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.38881.34981.23125</string> </value>
<value> <string>987.39350.58944.42461</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -433,7 +258,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1582043027.48</float>
<float>1604954142.0</float>
<string>UTC</string>
</tuple>
</state>
......@@ -494,7 +319,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1524736408.49</float>
<float>1601659386.62</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Notebook Upload Action</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="notebook_upload_action.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, jIO, DOMParser */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, jIO, DOMParser) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getSettingList", "getSettingList")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('preRenderDocument', function (parent_options) {
return this.getSetting('upload_dict')
.push(function (upload_dict) {
var upload = window.JSON.parse(upload_dict),
doc = { title: parent_options.form_definition.title,
action: true,
format: window.Object.keys(upload).join(', ') };
return doc;
});
})
.declareMethod('handleSubmit', function (content_dict, parent_options) {
var gadget = this,
return_submit_dict = {},
document = parent_options.doc,
all_attachments,
promise_list = [],
parent_jio_key = parent_options.action_options.jio_key,
property,
jio_key;
delete content_dict.dialog_method;
for (property in content_dict) {
if (content_dict.hasOwnProperty(property)) {
document[property] = content_dict[property];
}
}
return gadget.getSettingList(['portal_type',
'content_type',
'upload_dict',
'parent_relative_url'])
.push(function (result_list) {
var file_name_list, data, filename, queue, filetype;
if (document.file !== undefined) {
file_name_list = document.file.file_name.split('.');
filetype = file_name_list.pop();
if (filetype in window.JSON.parse(result_list[2])) {
filename = file_name_list.join('.');
data = jIO.util.dataURItoBlob(document.file.url);
return new RSVP.Queue()
.push(function () {
return jIO.util.readBlobAsText(data);
})
.push(function (evt) {
return evt.target.result;
})
.push(function (data_content) {
if (filetype === 'html') {
// In case the filetype is html, try looking for an elemnt
// with id `jsmd`, because iodide notebook saves the jsmd
// data in it.
var parser, htmlDoc;
parser = new DOMParser();
htmlDoc = parser.parseFromString(data_content, "text/html");
data_content = htmlDoc.getElementById('jsmd').textContent;
}
return gadget.jio_post({
title: filename,
portal_type: result_list[0],
content_type: result_list[1],
parent_relative_url: result_list[3],
text_content: data_content
});
})
.push(function (jio_key) {
return_submit_dict.redirect = {
command: 'display',
options: {
jio_key: jio_key,
editable: true
}
};
return return_submit_dict;
}, function (error) {
if (error instanceof jIO.util.jIOError) {
return_submit_dict.notify = {
message: "Failure uploading document",
status: "error"
};
return return_submit_dict;
}
throw error;
});
}
return_submit_dict.notify.message = "Wrong format, use format : " +
window.Object.keys(window.JSON.parse(result_list[2])).join(', ');
return_submit_dict.notify.status = "error";
return return_submit_dict;
}
return_submit_dict.notify.message = "File is required";
return_submit_dict.notify.status = "error";
return return_submit_dict;
});
});
}(window, rJS, RSVP, jIO, DOMParser));
\ No newline at end of file
......@@ -393,7 +393,7 @@
</item>
<item>
<key> <string>configuration_cache_file</string> </key>
<value> <string>gadget_officejs_notebook.appcache</string> </value>
<value> <string>WebSection_getPrecacheManifest</string> </value>
</item>
<item>
<key> <string>configuration_content_security_policy</string> </key>
......@@ -463,7 +463,9 @@
</item>
<item>
<key> <string>configuration_webapp_manifest_url</string> </key>
<value> <string>gadget_officejs_notebook.json</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>configuration_x_frame_options</string> </key>
......@@ -710,7 +712,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>973.33482.4166.8669</string> </value>
<value> <string>986.55673.4976.21401</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -728,7 +730,7 @@
</tuple>
<state>
<tuple>
<float>1549887982.52</float>
<float>1601046041.86</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -290,6 +290,16 @@
<value> <string>string</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_precache_manifest_script_list</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>text</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
......@@ -330,7 +340,7 @@
</item>
<item>
<key> <string>configuration_default_jio_document_page_gadget_url</string> </key>
<value> <string>ojs_controller</string> </value>
<value> <string>ojs_local_controller</string> </value>
</item>
<item>
<key> <string>configuration_default_view_action_reference</string> </key>
......@@ -338,11 +348,13 @@
</item>
<item>
<key> <string>configuration_frontpage_gadget_url</string> </key>
<value> <string>ojs_notebook_list</string> </value>
<value> <string>ojs_local_controller</string> </value>
</item>
<item>
<key> <string>configuration_hateoas_url</string> </key>
<value> <string>../hateoas/</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>configuration_header_gadget_url</string> </key>
......@@ -350,16 +362,24 @@
</item>
<item>
<key> <string>configuration_jio_gadget_url</string> </key>
<value> <string>gadget_ojs_jio.html</string> </value>
<value> <string>gadget_ojs_local_jio.html</string> </value>
</item>
<item>
<key> <string>configuration_manifest_url</string> </key>
<value> <string>gadget_officejs_notebook.appcache</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>configuration_panel_gadget_url</string> </key>
<value> <string>gadget_erp5_ojs_panel.html</string> </value>
</item>
<item>
<key> <string>configuration_precache_manifest_script_list</string> </key>
<value> <string>WebSection_getOfficeJsPrecacheManifestList\n
WebSection_getCodeMirrorPrecacheManifestList\n
WebSection_getNotebookEditorPrecacheManifestList</string> </value>
</item>
<item>
<key> <string>configuration_router_gadget_url</string> </key>
<value> <string>gadget_officejs_notebook_router.html</string> </value>
......@@ -384,7 +404,9 @@
</item>
<item>
<key> <string>configuration_webapp_manifest_url</string> </key>
<value> <string>gadget_officejs_notebook.json</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>configuration_x_frame_options</string> </key>
......@@ -464,7 +486,7 @@
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
......@@ -653,7 +675,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>973.33482.4166.8669</string> </value>
<value> <string>987.46563.1005.57053</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -671,7 +693,7 @@
</tuple>
<state>
<tuple>
<float>1549887971.4</float>
<float>1604344587.21</float>
<string>UTC</string>
</tuple>
</state>
......
<?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>interface.css</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/css</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>
......@@ -3,3 +3,4 @@ erp5_code_mirror
erp5_multimedia
erp5_smart_assistant
erp5_run_my_doc
erp5_notebook
\ No newline at end of file
This diff is collapsed.
......@@ -3,6 +3,7 @@ erp5_officejs_codemirror
erp5_officejs_common
erp5_officejs_drive
erp5_officejs_media_player
erp5_officejs_notebook
erp5_officejs_pdf_viewer
erp5_officejs_slideshow_editor
erp5_officejs_smart_assistant
......
  • @rporchetto please note that the testUpgradeInstanceWithOldDataFs has been broken by the dependency change.

  • Yes, both tests were impacted by Notebook changes.

    For erp5_officejs_support_request_ui_test:testSupportRequest, I checked with Gabriel and confirmed that there is no relation between Notebook portal type and Support Request, so it must be excluded from this test. I fixed here, I'm checking the test results.

    Regarding testUpgradeInstanceWithOldDataFs, I used on my instances the promise_check_upgrade alarm with this new dependency and it works fine even without specifying erp5_notebook bt in Base_getUpgradeBusinessTemplateList, so I'm fixing this test by adding erp5_notebook to its getBusinessTemplateList here.

  • The failures we have in CodingStyleTest, like

    ======================================================================
    FAIL: test_duplicatingSelectionNameInListbox (CodingStyleTest.CodingStyleTest erp5_corporate_identity)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/srv/slapgrid/slappart4/srv/testnode/ata/soft/71a5f20c58027433a84962be3a35cd1a/parts/erp5/product/ERP5/tests/testXHTML.py", line 219, in test_duplicatingSelectionNameInListbox
        portal_skins.SkinsTool_checkDuplicateSelectionName())
    AssertionError: Repeated listbox selection names:
    'notebook_module_selection' 
    	'NotebookModule_viewNotebookListAsJioForNotebookEditor/listbox': set(['erp5_officejs_notebook'])
    	'NotebookModule_viewNotebookList/listbox': set(['erp5_notebook'])
    

    also seem to be a consequence of this, because we now install erp5_notebook. There have always been a problem with the two duplicate selections in https://lab.nexedi.com/nexedi/erp5/blob/ab420147fb724eef6f177c4a2610b94abbf9f3ba/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/NotebookModule_viewNotebookListAsJioForNotebookEditor/listbox.xml#L227 and https://lab.nexedi.com/nexedi/erp5-bin/blob/e0dd805ee9648b716617caf3c6c8a56e8e692127/bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/NotebookModule_viewNotebookList/listbox.xml#L129 but until now we did not see because we were only installing one BT.

    I don't know if it still make sense to have both NotebookModule_viewNotebookListAsJioForNotebookEditor/listbox and NotebookModule_viewNotebookList/listbox, but how about changing one of the two selection names so that we no longer have this conflict ?

  • Thank you Jérome, I'm on it.

  • Thanks @rporchetto ! coding style is now passing again on master https://nexedijs.erp5.net/#/test_result_module/20201202-15BEC792

  • Regarding testUpgradeInstanceWithOldDataFs, I used on my instances the promise_check_upgrade alarm with this new dependency and it works fine even without specifying erp5_notebook bt in Base_getUpgradeBusinessTemplateList, so I'm fixing this test by adding erp5_notebook to its getBusinessTemplateList here.

    The error was:

      Module Products.ERP5.Tool.TemplateTool, line 842, in getDependencyList
        raise BusinessTemplateMissingDependency, 'While analysing %s the following dependency could not be satisfied: %s (%s)\nReason: Business Template could not be found in the repositories'%(bt[1], dependency, version_restriction or '')
    BusinessTemplateMissingDependency: While analysing erp5_officejs the following dependency could not be satisfied: erp5_notebook ()
    Reason: Business Template could not be found in the repositories

    this means the business template is not found in repositories defined here:

    image

    I believe that what we need to do is to is adjust the part from the test where this is set, it was only looking for ~/software_release/parts/erp5/bt5 and ~/software_release/parts/erp5/product/ERP5/bootstrap . I did 39d735e4 , directly on master because tests are already broken, I hope it was OK.

    Edit: I hope it was OK ... with you guys, I ran tests before ;)

    Edited by Jérome Perrin
  • This is good news, as I couldn't fix this test yet. Thank you :)

  • mentioned in commit 31e3a7e5

    Toggle commit list
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