Commit 5d2a6b37 authored by Romain Courteaud's avatar Romain Courteaud

erp5_officejs_support_request_ui: render the 2 graphs in parallel

parent a4994f47
...@@ -181,9 +181,9 @@ ...@@ -181,9 +181,9 @@
graph_gadget_1 = result_list[1], graph_gadget_1 = result_list[1],
graph_gadget_2 = result_list[2], graph_gadget_2 = result_list[2],
count_by_state_and_date_range = sp_data.count_by_state_and_date_range; count_by_state_and_date_range = sp_data.count_by_state_and_date_range;
gadget.property_dict.graph_widget = graph_gadget_1; return RSVP.all([
return RSVP.all([graph_gadget_1.render( // render first graph
{ graph_gadget_1.render({
value: { value: {
data: [ data: [
{ {
...@@ -222,48 +222,44 @@ ...@@ -222,48 +222,44 @@
title: "Support Request Pipe" title: "Support Request Pipe"
} }
} }
} }),
),
sp_data, // render second graph
graph_gadget_2 graph_gadget_2.render({
]); value:
}) {
.push(function (result_list) { data: [
var sp_data = result_list[1], graph_gadget = result_list[2]; {
gadget.property_dict.graph_widget = graph_gadget; value_dict: {
return graph_gadget.render({ 0: [
value: sp_data.state_title_by_state_id.validated,
{ sp_data.state_title_by_state_id.submitted,
data: [ sp_data.state_title_by_state_id.suspended,
{ sp_data.state_title_by_state_id.invalidated
value_dict: { ],
0: [ 1: [
sp_data.state_title_by_state_id.validated, sp_data.count_by_state.validated || 0,
sp_data.state_title_by_state_id.submitted, sp_data.count_by_state.submitted || 0,
sp_data.state_title_by_state_id.suspended, sp_data.count_by_state.suspended || 0,
sp_data.state_title_by_state_id.invalidated sp_data.count_by_state.invalidated || 0
], ]
1: [ },
sp_data.count_by_state.validated || 0, colors: ['#d48265', '#61a0a8', '#c23531', '#2f4554'],
sp_data.count_by_state.submitted || 0, type: "pie",
sp_data.count_by_state.suspended || 0, title: "Support Request"
sp_data.count_by_state.invalidated || 0 }
], ],
layout: {
axis_dict : {
0: {"title": "date"},
1: {"title": "value", "value_type": "number"}
}, },
colors: ['#d48265', '#61a0a8', '#c23531', '#2f4554'], title: "Last Month Activity"
type: "pie",
title: "Support Request"
} }
],
layout: {
axis_dict : {
0: {"title": "date"},
1: {"title": "value", "value_type": "number"}
},
title: "Last Month Activity"
} }
} })
});
]);
}); });
}) })
.declareService(function () { .declareService(function () {
......
...@@ -75,7 +75,9 @@ ...@@ -75,7 +75,9 @@
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
...@@ -158,171 +160,183 @@ ...@@ -158,171 +160,183 @@
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>publish_alive</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>publish_alive</string> </value>
<key> <string>actor</string> </key> </item>
<value> <string>zope</string> </value> <item>
</item> <key> <string>actor</string> </key>
<item> <value> <string>zope</string> </value>
<key> <string>comment</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>comment</string> </key>
<item> <value> <string></string> </value>
<key> <string>error_message</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>error_message</string> </key>
<item> <value> <string></string> </value>
<key> <string>time</string> </key> </item>
<value> <item>
<object> <key> <string>time</string> </key>
<klass> <value>
<global name="DateTime" module="DateTime.DateTime"/> <object>
</klass> <klass>
<tuple> <global name="DateTime" module="DateTime.DateTime"/>
<none/> </klass>
</tuple> <tuple>
<state> <none/>
<tuple> </tuple>
<float>1489423030.53</float> <state>
<string>UTC</string> <tuple>
</tuple> <float>1489423030.53</float>
</state> <string>UTC</string>
</object> </tuple>
</value> </state>
</item> </object>
<item> </value>
<key> <string>validation_state</string> </key> </item>
<value> <string>published_alive</string> </value> <item>
</item> <key> <string>validation_state</string> </key>
</dictionary> <value> <string>published_alive</string> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>edit</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>edit</string> </value>
<key> <string>actor</string> </key> </item>
<value> <string>zope</string> </value> <item>
</item> <key> <string>actor</string> </key>
<item> <value> <string>zope</string> </value>
<key> <string>comment</string> </key> </item>
<value> <item>
<none/> <key> <string>comment</string> </key>
</value> <value>
</item> <none/>
<item> </value>
<key> <string>error_message</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>error_message</string> </key>
<item> <value> <string></string> </value>
<key> <string>serial</string> </key> </item>
<value> <string>962.25743.31377.26094</string> </value> <item>
</item> <key> <string>serial</string> </key>
<item> <value> <string>983.46010.49549.22528</string> </value>
<key> <string>state</string> </key> </item>
<value> <string>current</string> </value> <item>
</item> <key> <string>state</string> </key>
<item> <value> <string>current</string> </value>
<key> <string>time</string> </key> </item>
<value> <item>
<object> <key> <string>time</string> </key>
<klass> <value>
<global name="DateTime" module="DateTime.DateTime"/> <object>
</klass> <klass>
<tuple> <global name="DateTime" module="DateTime.DateTime"/>
<none/> </klass>
</tuple> <tuple>
<state> <none/>
<tuple> </tuple>
<float>1542008780.46</float> <state>
<string>GMT+9</string> <tuple>
</tuple> <float>1588755553.56</float>
</state> <string>UTC</string>
</object> </tuple>
</value> </state>
</item> </object>
</dictionary> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="5" aka="AAAAAAAAAAU="> <record id="5" aka="AAAAAAAAAAU=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>detect_converted_file</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>detect_converted_file</string> </value>
<key> <string>actor</string> </key> </item>
<value> <string>zope</string> </value> <item>
</item> <key> <string>actor</string> </key>
<item> <value> <string>zope</string> </value>
<key> <string>comment</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>comment</string> </key>
<item> <value> <string></string> </value>
<key> <string>error_message</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>error_message</string> </key>
<item> <value> <string></string> </value>
<key> <string>external_processing_state</string> </key> </item>
<value> <string>converted</string> </value> <item>
</item> <key> <string>external_processing_state</string> </key>
<item> <value> <string>converted</string> </value>
<key> <string>serial</string> </key> </item>
<value> <string>0.0.0.0</string> </value> <item>
</item> <key> <string>serial</string> </key>
<item> <value> <string>0.0.0.0</string> </value>
<key> <string>time</string> </key> </item>
<value> <item>
<object> <key> <string>time</string> </key>
<klass> <value>
<global name="DateTime" module="DateTime.DateTime"/> <object>
</klass> <klass>
<tuple> <global name="DateTime" module="DateTime.DateTime"/>
<none/> </klass>
</tuple> <tuple>
<state> <none/>
<tuple> </tuple>
<float>1489422556.63</float> <state>
<string>UTC</string> <tuple>
</tuple> <float>1489422556.63</float>
</state> <string>UTC</string>
</object> </tuple>
</value> </state>
</item> </object>
</dictionary> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
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