Skip to content

Commit

Permalink
Merge pull request #48 from campudus/fix-exception-on-nav-to-bad-tabl…
Browse files Browse the repository at this point in the history
…e-ids

Fix navigation to bad table ids
  • Loading branch information
alexvetter committed Nov 15, 2017
2 parents 57b7ddc + 11b879b commit 392e823
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/main/js/components/tableView/TableView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,8 @@ class TableView extends Component {
};

applyColumnVisibility = (projection = this.props.projection) => {
// TODO fix an issue where this.getCurrentTable can be null
if (f.isNil(this.getCurrentTable())) {
return;
}

const DEFAULT_VISIBLE_COLUMNS = 10;
const columns = this.getCurrentTable().columns.models;
const columns = f.getOr([], ["columns", "models"], this.getCurrentTable());
const colIds = columns.map(f.get("id"));
if (f.isEmpty(colIds)) {
return; // don't try to sanitise visible columns when column data not yet loaded
Expand Down Expand Up @@ -372,7 +367,7 @@ class TableView extends Component {

applyFilters = (projection = this.props.projection) => {
const rowFilter = f.get("rows", projection);
const tableRows = this.getCurrentTable().rows;
const tableRows = f.getOr([], "rows", this.getCurrentTable());

if (f.isEmpty(rowFilter) || (f.isEmpty(rowFilter.filters) && f.isNil(rowFilter.sortColumnId))) {
this.setState({rowsCollection: tableRows});
Expand Down

0 comments on commit 392e823

Please sign in to comment.