Commit 82ad02d6 authored by Roque's avatar Roque

erp5_officejs: more dev framework flexibility and fixes

- allow custom app configurator
- render listbox form field extra configuration
- fix date format rendering
- allow configuration form fields to have extra js code
- allow to customize listbox column styles
- allow to customize listbox jio_alldocs
- fix custom view handling
- fix gadget field rendering
- allow dev user to set custom header options
- truncate long string fields
- add custom submit gadget option
- improve renderjs_extra
- update graph gadget
parent d8119beb
......@@ -124,6 +124,39 @@
return graph_data_and_parameter;
};
var formatGraphDict = function (input_dict) {
var i, j, key, series = [], label_list = ['x'], point_list = [], serie_length, point;
for (i = 0; i < input_dict.data.length; i = i + 1) {
for (key of Object.keys(input_dict.data[i].value_dict)) {
serie_length = input_dict.data[i].value_dict[key].length;
if (key == 0) {
if (series.length === 0) {
series.push(input_dict.data[i].value_dict[key]); //x
}
} else {
series.push(input_dict.data[i].value_dict[key]); //yi
}
}
label_list.push(input_dict.data[i].title);
}
for (i = 0; i < serie_length; i = i + 1) {
point = [];
for (j = 0; j < series.length; j = j + 1) {
point.push(series[j][i]);
}
point_list.push(point);
}
var dygraph_dict = {
dygraph_data: point_list,
dygraph_parameter_dict: {
labels: label_list,
drawPoints : true,
pointSize : 1,
}
};
return dygraph_dict;
};
/////////////////////////////////////////////////////////////////
// some methods
/////////////////////////////////////////////////////////////////
......@@ -162,7 +195,7 @@
graph_data_and_parameter;
container = gadget.element.querySelector(".graph-content");
graph_data_and_parameter = getGraphDataAndParameterFromConfiguration(modification_dict.value);
graph_data_and_parameter = formatGraphDict(modification_dict.value);
gadget.property_dict.graph = new Dygraph(container,
graph_data_and_parameter.dygraph_data,
graph_data_and_parameter.dygraph_parameter_dict);
......
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>superseb</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.22065.145.58026</string> </value>
<value> <string>1016.32471.45294.12919</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -262,8 +262,8 @@
</tuple>
<state>
<tuple>
<float>1502453287.3</float>
<string>GMT+2</string>
<float>1715371703.99</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
......@@ -165,9 +165,7 @@
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_settings.page = "ojs_local_controller";
action_info_dict.view_list[action_settings.action] =
action_settings;
} else {
......
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -258,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>987.1958.49484.49100</string> </value>
<value> <string>1015.45953.43925.42052</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -278,7 +278,7 @@
</tuple>
<state>
<tuple>
<float>1601668696.35</float>
<float>1712334861.52</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -31,6 +31,7 @@
app_action_list,
form_definition,
current_version,
configurator,
index;
current_version = window.location.href.replace(window.location.hash, "");
index = current_version.indexOf(window.location.host) +
......@@ -40,18 +41,20 @@
"app_view_reference",
"parent_portal_type",
'default_view_reference',
'app_actions'])
'app_actions',
'app_configurator'])
.push(function (setting_list) {
app_view = options.action || setting_list[1];
parent_portal_type = setting_list[2];
default_view = setting_list[3];
app_action_list = setting_list[4];
configurator = setting_list[5] || 'ojs_configurator';
if (setting_list[0] !== current_version) {
//if app version has changed, force storage selection
return gadget.redirect({
'command': 'display',
'options': {
'page': 'ojs_configurator',
'page': configurator,
'auto_repair': true
}
});
......@@ -121,6 +124,7 @@
var fragment = document.createElement('div'),
gadget = this,
view_gadget_url = "gadget_officejs_form_view.html",
//TODO: this should be a list, not only one custom view
custom_gadget_url = gadget.state.form_definition.portal_type_dict
.custom_view_gadget;
while (this.element.firstChild) {
......
......@@ -222,7 +222,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1005.39859.38086.29457</string> </value>
<value> <string>1015.46091.52896.5922</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1673426666.06</float>
<float>1712343165.23</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -22,6 +22,7 @@
.getElementById("panel-template-body-desktop")
.innerHTML);
//TODO this is the same in action_officejs page, move to common
function getElementList(gadget, element_list) {
var i = 0,
element_info_list = [],
......
......@@ -219,7 +219,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1001.57742.17876.27579</string> </value>
<value> <string>1014.1943.59170.64648</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1658943108.94</float>
<float>1713536268.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -258,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>991.25773.59047.44168</string> </value>
<value> <string>1016.46538.50454.1467</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -278,7 +278,7 @@
</tuple>
<state>
<tuple>
<float>1672736671.72</float>
<float>1716222503.85</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -36,6 +36,7 @@
);
}
//TODO this is the same in ojs_panel, move to common
function getHTMLElementList(gadget, element_list) {
var i = 0,
element_info_list = [],
......
......@@ -222,7 +222,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>979.63524.32203.29269</string> </value>
<value> <string>1015.45957.31009.8925</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1574423701.42</float>
<float>1713536281.01</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