Skip to content

Commit

Permalink
Making the sort order for metrics pull from fd for time table viz
Browse files Browse the repository at this point in the history
  • Loading branch information
michellethomas committed Oct 12, 2017
1 parent 52a9f27 commit 7b670a3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions superset/assets/visualizations/time_table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 7b670a3

Please sign in to comment.