Skip to content
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

Results panel is visible only if there are results #1351

Merged
merged 1 commit into from
Dec 15, 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
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