You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2017/10/13 00:51:28 UTC
[incubator-superset] branch master updated: Making the sort order
for metrics pull from fd for time table viz (#3661)
This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new f871634 Making the sort order for metrics pull from fd for time table viz (#3661)
f871634 is described below
commit f87163413bff72935fc6c95fa9d34468de99b86e
Author: michellethomas <mi...@gmail.com>
AuthorDate: Thu Oct 12 17:51:26 2017 -0700
Making the sort order for metrics pull from fd for time table viz (#3661)
---
superset/assets/visualizations/time_table.jsx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/superset/assets/visualizations/time_table.jsx b/superset/assets/visualizations/time_table.jsx
index 38f193b..4a6e179 100644
--- a/superset/assets/visualizations/time_table.jsx
+++ b/superset/assets/visualizations/time_table.jsx
@@ -44,8 +44,14 @@ function viz(slice, payload) {
metricMap[m.metric_name] = m;
});
- const metrics = payload.data.columns;
- const defaultSort = { column: fd.column_collection[0].key, direction: 'desc' };
+ let metrics;
+ let defaultSort = null;
+ if (payload.data.is_group_by) {
+ metrics = payload.data.columns;
+ defaultSort = { column: fd.column_collection[0].key, direction: 'desc' };
+ } else {
+ metrics = fd.metrics;
+ }
const tableData = metrics.map((metric) => {
let leftCell;
const context = Object.assign({}, fd, { metric });
--
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <co...@superset.apache.org>'].