Skip to content

DM-7280: display wrong data when 'hidden' columns are in front of visible ones #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/firefly/html/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
cursor: pointer;
}

.clickable:hover {
cursor: pointer;
}

.ff-href {
color: #005da4; /*highlightColor*/
Expand Down
6 changes: 3 additions & 3 deletions src/firefly/js/tables/ui/BasicTableView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class BasicTableView extends React.Component {
columnWidths, filterInfo, sortInfo, showUnits, showFilters,
onSort, onFilter, onRowSelect, onSelectAll, onFilterSelected};

const headerHeight = 22 + (showUnits && 12) + (showFilters && 20);
const headerHeight = 22 + (showUnits && 8) + (showFilters && 22);

return (
<Resizable id='table-resizer' tabIndex='-1' onKeyDown={this.onKeyDown} className='TablePanel__frame' onResize={this.onResize}>
Expand Down Expand Up @@ -264,7 +264,7 @@ function makeColumns ({columns, columnWidths, data, selectable, showUnits, showF
return (
<Column
key={col.name}
columnKey={col.name}
columnKey={idx}
header={<HeadRenderer {...{col, showUnits, showFilters, filterInfo, sortInfo, onSort, onFilter}} />}
cell={<CellRenderer style={style} data={data} colIdx={idx} />}
fixed={fixed}
Expand All @@ -287,7 +287,7 @@ function makeColumns ({columns, columnWidths, data, selectable, showUnits, showF
/>);
colsEl.splice(0, 0, cbox);
}
return colsEl;
return colsEl.filter((c) => c);
}


Expand Down
15 changes: 9 additions & 6 deletions src/firefly/js/tables/ui/FilterEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ FilterEditor.defaultProps = {
function prepareOptionData(columns, sortInfo, filterInfo, selectable) {

var cols = [
{name: 'Column', visibility: 'show', fixed: true},
{name: 'Filter', visibility: 'show'},
{name: 'Units', visibility: 'show'},
{name: 'Column', fixed: true},
{name: 'Filter'},
{name: 'Units'},
{name: '', visibility: 'hidden'},
{name: 'Selected', visibility: 'hidden'}
];
Expand Down Expand Up @@ -120,9 +120,12 @@ function prepareOptionData(columns, sortInfo, filterInfo, selectable) {

function makeCallbacks(onChange, columns, data, orgFilterInfo='') {
var onSelectAll = (checked) => {
const nColumns = cloneDeep(columns).filter((c) => c.visibility !== 'hidden');
nColumns.forEach((v) => {
v.visibility = checked ? 'show' : 'hide';
const nColumns = columns.map((c) => {
var col = cloneDeep(c);
if (col.visibility !== 'hidden') {
col.visibility = checked ? 'show' : 'hide';
}
return col;
});
onChange && onChange({columns: nColumns});
};
Expand Down
6 changes: 3 additions & 3 deletions src/firefly/js/tables/ui/TablePanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@

.TablePanel__header {
white-space: nowrap;
height: calc(100% - 3px);
height: calc(100% - 1px);
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
margin: 2px;
}
padding: 2px;
box-sizing: border-box;}

button.paging_bar {
height: 16px;
Expand Down
10 changes: 5 additions & 5 deletions src/firefly/js/tables/ui/TableRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import React from 'react';
import FixedDataTable from 'fixed-data-table';
import sCompare from 'react-addons-shallow-compare';
import {set, get, isEqual, pick, isString} from 'lodash';
import {set, get, isEqual, pick} from 'lodash';

import {FilterInfo, FILTER_CONDITION_TTIPS} from '../FilterInfo.js';
import {SortInfo} from '../SortInfo.js';
Expand Down Expand Up @@ -108,13 +108,13 @@ export class SelectableHeader extends React.Component {
render() {
const {checked, onSelectAll, showUnits, showFilters, onFilterSelected, style} = this.props;
return (
<div style={style} className='TablePanel__header'>
<div style={{padding: 0, ...style}} className='TablePanel__header'>
<input type='checkbox'
tabIndex={-1}
checked={checked}
onChange={(e) => onSelectAll(e.target.checked)}/>
{showUnits && <div/>}
{showFilters && <img className='button'
{showFilters && <img className='clickable'
src={FILTER_SELECTED_ICO}
onClick={onFilterSelected}
title='Filter on selected rows'/>}
Expand Down Expand Up @@ -155,8 +155,8 @@ export class SelectableCell extends React.Component {
/*---------------------------- CELL RENDERERS ----------------------------*/

function getValue(props) {
const {rowIndex, data, colIdx} = props;
return get(data, [rowIndex, colIdx], 'undef');
const {rowIndex, data, columnKey} = props;
return get(data, [rowIndex, columnKey], 'undef');
}

export class TextCell extends React.Component {
Expand Down
4 changes: 1 addition & 3 deletions src/firefly/js/ui/panel/TabPanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@
outline: none;
color:black; /*CVAL-BLACK*/
cursor:pointer;
height: 18px;
margin-left:6px;
padding:2px 6px;
font-weight: normal;
text-align:center;
\-moz-border-radius-topleft: 5px;
\-webkit-border-top-left-radius: 5px;
border-top-left-radius: 5px;
white-space: nowrap;
overflow: hidden;
}

.TabPanel__Tab--selected {
width: auto;
height: auto;
cursor:default;
font-weight:bold;
background: #c8c8c8;
Expand Down
20 changes: 11 additions & 9 deletions src/firefly/js/ui/panel/TabPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,20 @@ export class Tab extends Component {
}

// removable width: 14px
const textStyle = maxTitleWidth ? {width: maxTitleWidth-(removable?14:0)} : {};
const textStyle = maxTitleWidth ? {float: 'left', width: maxTitleWidth-(removable?14:0)} : {};

return (
<li className={tabClassName}>
<div style={textStyle} className='text-ellipsis' title={name} onClick={() => onSelect(id,name)}>
{name}
<li className={tabClassName} onClick={() => onSelect(id,name)}>
<div>
<div style={textStyle} className='text-ellipsis' title={name}>
{name}
</div>
{removable &&
<div style={{right: -4, top: -2}} className='btn-close'
title='Remove Tab'
onClick={() => onTabRemove && onTabRemove(name)}/>
}
</div>
{removable &&
<div style={{right: -4, top: -2}} className='btn-close'
title='Remove Tab'
onClick={() => onTabRemove && onTabRemove(name)}/>
}
</li>);
}
}
Expand Down