Skip to content

Commit

Permalink
Fix infinite loop when query panel is closed. (#1377)
Browse files Browse the repository at this point in the history
* Fix infinite loop when query panel is closed.

* Fix default map
  • Loading branch information
offtherailz authored and mbarto committed Jan 10, 2017
1 parent c95bab9 commit 6d2d8fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions web/client/components/data/featuregrid/DockedFeatureGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ const DockedFeatureGrid = React.createClass({
);
}

let cols = this.props.columnsDef.map((column) => {
let cols = this.props.columnsDef && this.props.columnsDef.map((column) => {
if (!column.profiles || (column.profiles && column.profiles.indexOf(this.props.profile) !== -1)) {
return assign({}, column, {field: "properties." + column.field});
}
}).filter((c) => c);

if (this.sortModel && this.sortModel.length > 0) {
if (cols && this.sortModel && this.sortModel.length > 0) {
cols = cols.map((c) => {
let model = head(this.sortModel.filter((m) => m.colId === c.field));
if ( model ) {
Expand All @@ -235,7 +235,7 @@ const DockedFeatureGrid = React.createClass({

let gridConf = this.props.pagination ? {dataSource: this.getDataSource(this.props.dataSourceOptions), features: []} : {features: this.props.features};

if (this.props.filterObj) {
if (this.props.filterObj && cols) {
return (
<Dock
position={"bottom" /* 'left', 'top', 'right', 'bottom' */}
Expand Down
4 changes: 2 additions & 2 deletions web/client/plugins/TOC.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const LayerTree = React.createClass({
<DefaultLayer
settingsOptions={this.props.settingsOptions}
onToggle={this.props.onToggleLayer}
onToggleQuerypanel={this.props.onToggleQuery}
onToggleQuerypanel={this.props.onToggleQuery }
onZoom={this.props.onZoomToExtent}
onSettings={this.props.onSettings}
propertiesChangeHandler={this.props.layerPropertiesChangeHandler}
Expand Down Expand Up @@ -237,7 +237,7 @@ const LayerTree = React.createClass({
},
renderQueryPanel() {
return (<div>
<Button id="query-close-button" bsStyle="primary" key="menu-button" className="square-button" onClick={this.props.onToggleQuery}><Glyphicon glyph="arrow-left"/></Button>
<Button id="query-close-button" bsStyle="primary" key="menu-button" className="square-button" onClick={this.props.onToggleQuery.bind(this, null, null)}><Glyphicon glyph="arrow-left"/></Button>
<SmartQueryForm/>
</div>);
},
Expand Down

0 comments on commit 6d2d8fd

Please sign in to comment.