Commit 01ff10a4 authored by Joshua's avatar Joshua

Updated web_chart_view to be compatible with plotly graphs.

parent 2e5eb321
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
Please register or sign in to reply
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
Please register or sign in to reply
</tuple>
</value>
</item>
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -25,6 +25,12 @@
if (configuration_dict.constructor === String) {
configuration_dict = JSON.parse(configuration_dict);
}
// To preserve ploly graph layout
if (configuration_dict.isPlotlyGraph !== undefined) {
graph_data_and_parameter.data_list = configuration_dict.data;
graph_data_and_parameter.layout = configuration_dict.layout;
Please register or sign in to reply
return graph_data_and_parameter;
}
given_data_list = configuration_dict.data;
console.log("getGraphDataAndParameterFromConfiguration 1 configuration_dict", configuration_dict);
......
......@@ -226,7 +226,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>superseb</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -240,7 +240,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.22061.49603.52480</string> </value>
<value> <string>977.17717.58600.17800</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,8 +258,8 @@
</tuple>
<state>
<tuple>
<float>1502453333.98</float>
<string>GMT+2</string>
<float>1563961341.87</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
{
"short_name": "Chart Editor",
"name": "OfficeJS Chart Editor",
"description": "Simple Chart Editor",
"icons": [{
Please register or sign in to reply
"src": "officejs_logo_chart_editor.png",
"sizes": "any",
"type": "image/png"
}],
"start_url": "../../",
"display": "standalone"
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>OfficeJS Router Gadget</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_officejs_router.js" type="text/javascript"></script>
</head>
<body>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Web Chart</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Chart</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Charts</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">web_page_module</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">n692ixxhyg9zhqs</script>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
</body>
</html>
\ No newline at end of file
......@@ -87,14 +87,13 @@
};
AppCacheStorage.prototype.repair = function () {
var storage = this, url = "";
var storage = this;
return new RSVP.Queue()
.push(function () {
url = new URL(storage._manifest, new URL(storage._version,
Please register or sign in to reply
storage._origin_url));
return jIO.util.ajax({
type: "GET",
url: url
url: new URL(storage._manifest, new URL(storage._version,
storage._origin_url))
});
})
.push(function (response) {
......@@ -124,7 +123,7 @@
})
.push(undefined, function (error) {
if (!error.message) {
error.message = "Can't get manifest. URL: " + url;
error.message = "Can't get manifest";
}
throw error;
});
......
......@@ -223,7 +223,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -237,7 +237,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.52707.23546.23773</string> </value>
<value> <string>964.50005.13436.62685</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -255,7 +255,7 @@
</tuple>
<state>
<tuple>
<float>1562079992.63</float>
<float>1515753347.5</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")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
Please register or sign in to reply
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc
});
})
.onEvent('submit', function () {
var gadget = this,
updated_url_string;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (content) {
updated_url_string = content.url_string;
return gadget.updateDocument(content);
})
.push(function () {
return gadget.notifySubmitted({message: 'Data Updated', status: 'success'});
})
.push(function () {
if (updated_url_string !== gadget.state.doc.url_string) {
gadget.state.doc.url_string = updated_url_string;
return gadget.changeState({update: true});
}
return;
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.onStateChange(function () {
var gadget = this,
text_content;
if (gadget.state.doc.text_content) {
text_content = JSON.parse(gadget.state.doc.text_content);
text_content.url = gadget.state.doc.url_string ? gadget.state.doc.url_string : undefined;
gadget.state.doc.text_content = JSON.stringify(text_content);
} else {
gadget.state.doc.text_content = gadget.state.doc.url_string ? JSON.stringify({url: gadget.state.doc.url_string}) : undefined;
}
gadget.state.update = false;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Title",
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1,
"key": "title",
"hidden": 0,
"type": "StringField"
},
"my_reference": {
"description": "",
"title": "Reference",
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1,
"key": "reference",
"hidden": 0,
"type": "StringField"
},
"my_version": {
"description": "",
"title": "Version",
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1,
"key": "version",
"hidden": 0,
"type": "StringField"
},
"my_url_string": {
"description": "",
"title": "URL",
"default": gadget.state.doc.url_string,
"css_class": "",
"required": 0,
"editable": 1,
"key": "url_string",
"hidden": 0,
"type": "StringField"
},
"my_language": {
"description": "",
"title": "Language",
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1,
"key": "language",
"hidden": 0,
"type": "StringField"
},
"my_description": {
"description": "",
"title": "Description",
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1,
"key": "description",
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": gadget.state.doc.text_content,
"css_class": "",
"required": 0,
"editable": 1,
"key": "text_content",
"hidden": 0,
"renderjs_extra": '{"editor": "chart_editor",' +
'"maximize": true}',
"type": "GadgetField",
"url": "gadget_editor.html",
"sandbox": "public"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"], ["my_url_string"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
]]
}
});
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
save_action: true,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2]
});
});
});
}(window, rJS, RSVP));
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Jio Web Page View</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_officejs_jio_web_chart_view.js"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
......@@ -23,6 +23,7 @@
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
......@@ -41,6 +42,8 @@
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
Please register or sign in to reply
......@@ -630,7 +633,7 @@ NETWORK:\n
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish</string> </value>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
......@@ -656,7 +659,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1486561449.89</float>
<float>1565178658.04</float>
<string>UTC</string>
</tuple>
</state>
......@@ -665,7 +668,7 @@ NETWORK:\n
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published</string> </value>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
......
......@@ -191,7 +191,7 @@
</tuple>
<state>
<tuple>
<float>1537948338.59</float>
<float>1565178665.09</float>
Please register or sign in to reply
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -55,6 +56,7 @@
<string>Associate</string>
Please register or sign in to reply
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
Please register or sign in to reply
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
Please register or sign in to reply
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
Please register or sign in to reply
</item>
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
Please register or sign in to reply
</tuple>
</value>
</item>
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
Please register or sign in to reply
</tuple>
</value>
</item>
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
Please register or sign in to reply
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
Please register or sign in to reply
</tuple>
</value>
</item>
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
Please register or sign in to reply
</tuple>
</value>
</item>
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
Please register or sign in to reply
</value>
</item>
......@@ -58,6 +59,7 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -411,7 +411,7 @@
</item>
<item>
<key> <string>skin_selection_name</string> </key>
<value> <string>RJS</string> </value>
<value> <string>Officejs</string> </value>
Please register or sign in to reply
</item>
<item>
<key> <string>static_language_selection</string> </key>
......
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