-
Notifications
You must be signed in to change notification settings - Fork 416
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
Fix #1398 Improve query panel behaviour #1413
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,8 +54,11 @@ const DockedFeatureGrid = React.createClass({ | |
selectAllToggle: React.PropTypes.func, | ||
zoomToFeatureAction: React.PropTypes.func, | ||
onClose: React.PropTypes.func, | ||
onToggleDrawer: React.PropTypes.func, | ||
openDrawer: React.PropTypes.func, | ||
enableDrawer: React.PropTypes.func, | ||
dockSize: React.PropTypes.number, | ||
minDockSize: React.PropTypes.number, | ||
maxDockSize: React.PropTypes.number, | ||
setDockSize: React.PropTypes.func | ||
}, | ||
contextTypes: { | ||
|
@@ -93,8 +96,11 @@ const DockedFeatureGrid = React.createClass({ | |
onQuery: () => {}, | ||
cleanError: () => {}, | ||
selectAllToggle: () => {}, | ||
onToggleDrawer: () => {}, | ||
openDrawer: () => {}, | ||
enableDrawer: () => {}, | ||
dockSize: 0.35, | ||
minDockSize: 0.1, | ||
maxDockSize: 1.0, | ||
setDockSize: () => {} | ||
}; | ||
}, | ||
|
@@ -299,16 +305,15 @@ const DockedFeatureGrid = React.createClass({ | |
this.props.selectFeatures(features); | ||
}, | ||
backToSearch() { | ||
this.props.onToggleDrawer(); | ||
this.props.openDrawer(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this.onBackToSearch() |
||
this.props.enableDrawer(); | ||
this.props.onClose(); | ||
}, | ||
limitDockHeight(size) { | ||
const minSize = 0.25; | ||
const maxSize = 0.85; | ||
if (size >= maxSize) { | ||
this.props.setDockSize(maxSize); | ||
} else if (size <= minSize) { | ||
this.props.setDockSize(minSize); | ||
if (size >= this.props.maxDockSize) { | ||
this.props.setDockSize(this.props.maxDockSize); | ||
} else if (size <= this.props.minDockSize) { | ||
this.props.setDockSize(this.props.minDockSize); | ||
} else { | ||
this.props.setDockSize(size); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,8 @@ const QueryBuilder = React.createClass({ | |
onQuery: () => {}, | ||
onReset: () => {}, | ||
onChangeDrawingStatus: () => {}, | ||
onToggleDrawer: () => {} | ||
closeDrawer: () => {}, | ||
disableDrawer: () => {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This functions be called into the onQuery action, if needed (using thunk) |
||
} | ||
}; | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,8 @@ const QueryToolbar = React.createClass({ | |
onQuery: () => {}, | ||
onReset: () => {}, | ||
onChangeDrawingStatus: () => {}, | ||
onToggleDrawer: () => {} | ||
closeDrawer: () => {}, | ||
disableDrawer: () => {} | ||
} | ||
}; | ||
}, | ||
|
@@ -104,7 +105,8 @@ const QueryToolbar = React.createClass({ | |
sortOptions: this.props.sortOptions, | ||
hits: this.props.hits | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here, there should be an thunk that opens the bottom table and closes the left menu. |
||
this.props.actions.onToggleDrawer(); | ||
this.props.actions.closeDrawer(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. closeDrawer and disableDrawer should be handled in onQuery. QueryToolbar does not know it's included in a drawer |
||
this.props.actions.disableDrawer(); | ||
this.props.actions.onQuery(this.props.searchUrl, filterObj, this.props.params); | ||
}, | ||
reset() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ const {changeLayerProperties, changeGroupProperties, toggleNode, | |
sortNode, showSettings, hideSettings, updateSettings, updateNode, removeNode} = require('../actions/layers'); | ||
const {getLayerCapabilities} = require('../actions/layerCapabilities'); | ||
const {zoomToExtent} = require('../actions/map'); | ||
const {toggleControl} = require('../actions/controls'); | ||
const {setControlProperty} = require('../actions/controls'); | ||
const {groupsSelector} = require('../selectors/layers'); | ||
|
||
const LayersUtils = require('../utils/LayersUtils'); | ||
|
@@ -117,7 +117,8 @@ const SmartQueryForm = connect((state) => { | |
onQuery: createQuery, | ||
onReset: reset, | ||
onChangeDrawingStatus: changeDrawingStatus, | ||
onToggleDrawer: toggleControl.bind(null, 'drawer', null) | ||
closeDrawer: setControlProperty.bind(null, 'drawer', 'enabled', false), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the reasons explained above of course these functions should not be passed here. |
||
disableDrawer: setControlProperty.bind(null, 'drawer', 'disabled', true) | ||
}, dispatch) | ||
}; | ||
})(QueryBuilder); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onBackToSearch, to replace both openDrawer and enableDrawer: the featuregrid is not aware of drawer existance, and should not be. Each component is independent. We can glue things together in the plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include also onClose in onBackToSearch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it's better