From 2ad092b5e54fa39a906b38d9240e08b9800ea0da Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 22 Aug 2014 17:51:20 +0200 Subject: [ADD] doc: new documentation, with training tutorials, and new scaffolding --- addons/web_graph/static/src/js/graph_view.js | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'addons/web_graph/static/src/js/graph_view.js') diff --git a/addons/web_graph/static/src/js/graph_view.js b/addons/web_graph/static/src/js/graph_view.js index 4a81ceaa98c..953de133ef9 100644 --- a/addons/web_graph/static/src/js/graph_view.js +++ b/addons/web_graph/static/src/js/graph_view.js @@ -52,24 +52,21 @@ instance.web_graph.GraphView = instance.web.View.extend({ if (_.has(field.attrs, 'interval')) { field_name = field.attrs.name + ':' + field.attrs.interval; } - if (_.has(field.attrs, 'type')) { - switch (field.attrs.type) { - case 'row': - self.widget_config.row_groupby.push(field_name); - break; - case 'col': - self.widget_config.col_groupby.push(field_name); - break; - case 'measure': - self.widget_config.measures.push(field_name); - break; - } - } else { // old style, kept for backward compatibility + //noinspection FallThroughInSwitchStatementJS + switch (field.attrs.type) { + case 'measure': + self.widget_config.measures.push(field_name); + break; + case 'col': + self.widget_config.col_groupby.push(field_name); + break; + default: if ('operator' in field.attrs) { self.widget_config.measures.push(field_name); - } else { - self.widget_config.row_groupby.push(field_name); + break; } + case 'row': + self.widget_config.row_groupby.push(field_name); } }); if (self.widget_config.measures.length === 0) { -- cgit v1.2.3