[Maps] layer specific filtering#33209
Conversation
|
Pinging @elastic/kibana-gis |
|
I had to deviate from the design a little bit. The Also, talked to @thomasneirynck, and we decided to skip showing a table of results because it did not make sense for Grid sources since Grid sources do not show individual documents. |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
|
I prefer the pop-over as opposed to the modal. It looks clean, and users can continue see the data in the background, so it preserves some context. |
💔 Build Failed |
💚 Build Succeeded |
thomasneirynck
left a comment
There was a problem hiding this comment.
lgtm, but some minor suggestions.
| private renderUpdateButton() { | ||
| const button = ( | ||
| const button = this.props.customSubmitButton ? ( | ||
| React.cloneElement(this.props.customSubmitButton, { onClick: this.onClickSubmitButton }) |
There was a problem hiding this comment.
Why do we need the React.cloneElement?
There was a problem hiding this comment.
That allows for the adding the onClick property while preserving all of the other props passed in with the button
| refreshInterval?: number; | ||
| showAutoRefreshOnly?: boolean; | ||
| onRefreshChange?: (options: { isPaused: boolean; refreshInterval: number }) => void; | ||
| customSubmitButton?: any; |
There was a problem hiding this comment.
consider PropTypes.element
There was a problem hiding this comment.
Typescript does recognize PropTypes. I had React.ReactNode but then there were TS lint errors
There was a problem hiding this comment.
didn't know this, thanks
x-pack/plugins/maps/public/components/layer_panel/filter_editor/_filter_editor.scss
Show resolved
Hide resolved
|
|
||
| _renderOpenButton() { | ||
| const query = this.props.layer.getQuery(); | ||
| const openButtonLabel = query && query.query |
There was a problem hiding this comment.
would it make sense to not have this "Edit filter" button, and just have the previwer, that's either empty or has the preview of the string. I kind of like how the join-editor is editable like that. just click the preview, no need for extra button.
There was a problem hiding this comment.
| return [this._descriptor.indexPatternId]; | ||
| } | ||
|
|
||
| supportsElasticsearchFilters() { |
There was a problem hiding this comment.
I'd make this a static function or static property on Source, and not a method on the prototype. The return true/false is independent of instance-state, but only depends on the type instead.
There was a problem hiding this comment.
If the method is a static method then it has to be called on the Class instead of the instance. The method is executed from within a layer instance where I have easy access to the source instance, but not the source Class. It would be cumbersome to get the Class of the source instance and then call the static method on the class.
There was a problem hiding this comment.
this._source.constructor.supportsElasticsearchFilters
but yeah, that looks somewhat funny. your call.
There was a problem hiding this comment.
I will just leave it on prototype since that is consistent with isFieldAware, isRefreshTimerAware, and others
💚 Build Succeeded |
💚 Build Succeeded |
thomasneirynck
left a comment
There was a problem hiding this comment.
Thanks, really cool
💚 Build Succeeded |
* render filters section in layer details * add popover with QueryBar * show index pattern type ahead * scss * add custom button to QueryBar * add setQuery action creator * wire together layer query to search source * remove old comment * update heatmap layer to consider layerQuery during resync logic * update getBounds to apply layer query * fix QueryBar typescript problems * add functional test for layer query * more typescript nonsense * fix jest test * use EuiPopover instead of EuiModal * close popover on button click * fix functional test with popover change * add empty state help text and use small padding on EuiCodeBlock * query_bar renderUpdateButton return early if not this.props.showDatePicker
* render filters section in layer details * add popover with QueryBar * show index pattern type ahead * scss * add custom button to QueryBar * add setQuery action creator * wire together layer query to search source * remove old comment * update heatmap layer to consider layerQuery during resync logic * update getBounds to apply layer query * fix QueryBar typescript problems * add functional test for layer query * more typescript nonsense * fix jest test * use EuiPopover instead of EuiModal * close popover on button click * fix functional test with popover change * add empty state help text and use small padding on EuiCodeBlock * query_bar renderUpdateButton return early if not this.props.showDatePicker
* render filters section in layer details * add popover with QueryBar * show index pattern type ahead * scss * add custom button to QueryBar * add setQuery action creator * wire together layer query to search source * remove old comment * update heatmap layer to consider layerQuery during resync logic * update getBounds to apply layer query * fix QueryBar typescript problems * add functional test for layer query * more typescript nonsense * fix jest test * use EuiPopover instead of EuiModal * close popover on button click * fix functional test with popover change * add empty state help text and use small padding on EuiCodeBlock * query_bar renderUpdateButton return early if not this.props.showDatePicker
* render filters section in layer details * add popover with QueryBar * show index pattern type ahead * scss * add custom button to QueryBar * add setQuery action creator * wire together layer query to search source * remove old comment * update heatmap layer to consider layerQuery during resync logic * update getBounds to apply layer query * fix QueryBar typescript problems * add functional test for layer query * more typescript nonsense * fix jest test * use EuiPopover instead of EuiModal * close popover on button click * fix functional test with popover change * add empty state help text and use small padding on EuiCodeBlock * query_bar renderUpdateButton return early if not this.props.showDatePicker
* [Maps] layer specific filtering (#33209) * render filters section in layer details * add popover with QueryBar * show index pattern type ahead * scss * add custom button to QueryBar * add setQuery action creator * wire together layer query to search source * remove old comment * update heatmap layer to consider layerQuery during resync logic * update getBounds to apply layer query * fix QueryBar typescript problems * add functional test for layer query * more typescript nonsense * fix jest test * use EuiPopover instead of EuiModal * close popover on button click * fix functional test with popover change * add empty state help text and use small padding on EuiCodeBlock * query_bar renderUpdateButton return early if not this.props.showDatePicker * skip fitToBounds tests until fix is merged


This PR adds ability to add filter to layer