Skip to content

Commit

Permalink
Don't display integer array columns as sortable
Browse files Browse the repository at this point in the history
Also show the "num" attribute on the column tooltip

Fixes #190
  • Loading branch information
ihodes committed Jan 15, 2015
1 parent 7b4ee73 commit bfed82a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cycledash/static/js/examine/components/VCFTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ var ColumnHeader = React.createClass({
isSortable: function() {
var props = this.props,
hasValues = _.some(props.records, r =>
_.isFinite(r[props.column.columnName]));
return (hasValues && _.contains(['Integer', 'Float'], props.info.type));
_.isFinite(r[props.column.columnName])),
isSortableType = _.contains(['Integer', 'Float'], props.info.type),
isNotArray = props.info.number && props.info.number == 1;
return hasValues && isSortableType && isNotArray;
},
render: function() {
var tooltip;
Expand Down Expand Up @@ -207,12 +209,14 @@ var InfoColumnTooltip = React.createClass({
render: function() {
var infoText = this.props.info.description,
infoType = this.props.info.type,
number = this.props.info.number,
path = this.props.column.path.join(' → ');
return (
<div className='tooltip'>
<p className='description'>{infoText}</p>
<p className='description'>{path}</p>
<p className='type'>Type: <strong>{infoType}</strong></p>
<p className='number'>Num: <strong>{number}</strong></p>
</div>
);
}
Expand Down

0 comments on commit bfed82a

Please sign in to comment.