-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Maps] create NOT EXISTS filter for tooltip property with no value #62849
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
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.
x-pack/plugins/maps/public/layers/tooltips/es_tooltip_property.test.ts
Outdated
Show resolved
Hide resolved
const indexPatternField = this._getIndexPatternField(); | ||
if (!indexPatternField) { | ||
return []; | ||
} | ||
|
||
return [esFilters.buildPhraseFilter(indexPatternField, this.getRawValue(), this._indexPattern)]; | ||
const value = this.getRawValue(); | ||
if (value == null) { |
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.
==
relies on type coercion. maybe value === null || typeof value == 'undefined'
instead.
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.
I would like to leave the check as == null
. This is a pretty standard way to check for null, for example, from https://medium.com/javascript-in-plain-english/how-to-check-for-null-in-javascript-dffab64d8ed5 "That means checking for null is one of the few times in JavaScript that using == is recommended, while otherwise === is generally recommended." Additionally, this null check is used all over the Kibana code base. Just search for == null
to see its usage.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…lastic#62849) * [Maps] create NOT EXISTS filter for tooltip property with no value * review feedback
…chore/put-all-xjson-together * 'master' of github.com:elastic/kibana: [EPM] Update UI copy to use `integration` (elastic#63077) [NP] Inline buildPointSeriesData and buildHierarchicalData dependencies (elastic#61575) [Maps] create NOT EXISTS filter for tooltip property with no value (elastic#62849) [Endpoint] Add link to Logs UI to the Host Details view (elastic#62852) [UI COPY] Fixes typo in max_shingle_size for search_as_you_type (elastic#63071) [APM] docs: add alerting examples for APM (elastic#62864) [EPM] Change PACKAGES_SAVED_OBJECT_TYPE id (elastic#62818) docs: fix rendering of bulleted list (elastic#62855) Exposed AddMessageVariables as separate component (elastic#63007) Add Data - Adding cloud reset password link to cloud instructions (elastic#62835) [ML] DF Analytics: update memory estimate after adding exclude fields (elastic#62850) [Table Vis] Fix visualization overflow (elastic#62630) [Endpoint][EPM] Endpoint depending on ingest manager to initialize (elastic#62871) [Remote clusters] Fix flaky jest tests (elastic#58768) [Discover] Hide time picker when an indexpattern without timefield is selected (elastic#62134) Move search source parsing and serializing to data (elastic#59919) [ML] Functional tests - stabilize typing in mml input (elastic#63091) [data.search.aggs]: Clean up TimeBuckets implementation (elastic#62123) [ML] Functional transform tests - stabilize source selection (elastic#63087) add embed flag to saved object url as well (elastic#62926) # Conflicts: # x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index.tsx
There is an existing bug when users create a filter in a tooltip for a value that does not exist. The filter creates a match_phrase on null which results in a bad request
This PR updates the
getESFilters
logic to create a negated exists filter when the value does not exist