Skip to content

Commit

Permalink
Merge pull request #1351 from Gnafu/querypanel_reset
Browse files Browse the repository at this point in the history
Results panel is visible only if there are results
  • Loading branch information
Gnafu authored Dec 15, 2016
2 parents a8de3e5 + 66ee44a commit 58dcd28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const DockedFeatureGrid = React.createClass({

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

if (this.props.open || true) {
if (this.props.features && this.props.features.length > 0) {
return (
<Dock
position={"bottom" /* 'left', 'top', 'right', 'bottom' */}
Expand Down
6 changes: 4 additions & 2 deletions web/client/reducers/featuregrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
const assign = require("object-assign");
const {SELECT_FEATURES, SET_FEATURES} = require('../actions/featuregrid');

function featuregrid(state = {
const emptyResultsState = {
select: [],
features: []
}, action) {
};

function featuregrid(state = emptyResultsState, action) {
switch (action.type) {
case SELECT_FEATURES:
return assign({}, state, {select: action.features});
Expand Down
3 changes: 3 additions & 0 deletions web/client/reducers/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const {
RESET_QUERY
} = require('../actions/wfsquery');

const {QUERY_FORM_RESET} = require('../actions/queryform');

const assign = require('object-assign');

const types = {
Expand Down Expand Up @@ -110,6 +112,7 @@ function query(state = initialState, action) {
resultError: action.error
});
}
case QUERY_FORM_RESET:
case RESET_QUERY: {
return assign({}, state, {
result: '',
Expand Down

0 comments on commit 58dcd28

Please sign in to comment.