superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Making the sort order for metrics pull from fd for time table viz (#3661)
Date Fri, 13 Oct 2017 00:51:28 GMT
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 <michelle.q.thomas@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" <commits@superset.apache.org>'].

Mime
View raw message