[Lens] fix do not submit invalid query in filtered metric#107542
[Lens] fix do not submit invalid query in filtered metric#107542alexwizp merged 10 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
dej611
left a comment
There was a problem hiding this comment.
Overall it seems ok.
Would it be possible to leave the last "valid" state on the filter entry if available?
In this case I'm passing from a valid query to (empty) while the popup is still open.
I think it's ok to clear the filter out if the user closes the popup/dimension panel.
BTW it's a minor enhancement here, not super important if too hard.
x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/filtering.tsx
Outdated
Show resolved
Hide resolved
@dej611 np, done |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
VladLasitsa
left a comment
There was a problem hiding this comment.
LGTM, tested locally!
|
@mbondyra good idea, thank you. I didn't know about that validation Screen.Recording.2021-08-10.at.12.00.27.PM.mov |
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @alexwizp |
mbondyra
left a comment
There was a problem hiding this comment.
Works great, thanks a lot for the improvement with passing the invalid state from saved object 💯
…7542) * [Lens] Do not submit invalid query in filtered metric Closes: elastic#95611 * fix CI * fix PR comments * fix PR comments * fix PR comment * move closePopover to useCallback * add filter validation to utils/isColumnInvalid Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…108144) * [Lens] Do not submit invalid query in filtered metric Closes: #95611 * fix CI * fix PR comments * fix PR comments * fix PR comment * move closePopover to useCallback * add filter validation to utils/isColumnInvalid Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…-png-pdf-report-type * 'master' of github.com:elastic/kibana: (101 commits) [ML] APM Latency Correlations: Field/value candidates prioritization (elastic#107370) [Reporting] Add lenience to a test on the order of asserted logs (elastic#108135) [Lens] fix do not submit invalid query in filtered metric (elastic#107542) skip flaky test (elastic#108043) fix newly introduced type error (elastic#107593) [Reporting] server side code clean up (elastic#106940) [build_ts_refs] improve caches, allow building a subset of projects (elastic#107981) [APM] Add new ftr_e2e to kibana CI and remove current e2e tests. (elastic#107593) add manage rules link to alerts dropdown (elastic#107950) [ML] Enable Index data visualizer document count chart to update time range query (elastic#106438) [Security Solutions][Detection Engine] Fixes "undefined" crash for author field by adding a migration for it (elastic#107230) [Actions UI] Fixed Jira Api token label. (elastic#107776) [Alerting UI] Fixed display permissions for edit/delete buttons when user has read only access. (elastic#107996) [Maps] fix code owners (elastic#108106) Update EMS landing page url (elastic#108102) Do not render page header for loading domains (elastic#108078) Update dependency @elastic/charts to v33.2.2 (elastic#107939) [APM] Display throughput as tps (instead of tpm) when bucket size < 60 seconds (elastic#107850) [Fleet] Fix all category count (elastic#108089) [Security Solution][Bug] - Disable alert table RBAC until fields sorted (elastic#108034) ... # Conflicts: # x-pack/plugins/reporting/server/export_types/common/generate_png.ts # x-pack/plugins/reporting/server/lib/screenshots/index.ts # x-pack/plugins/reporting/server/lib/screenshots/observable.test.ts # x-pack/plugins/reporting/server/lib/screenshots/observable.ts



Closes: #95611
Summary
Issue description
If the query of a filtered metric is invalid, it's still attempting to render the chart which is causing a runtime error:

This should be improved. In case of the filters function an invalid query is implicitly turned into a
*query matching all documents - we could do the same thing here, but maybe we should do something more sensible in both cases like not submitting the query as long as the input is open and on close failing the validation and highlighting the problematic dimension.Implementation notes
*query matching all documentsScreens
Screen.Recording.2021-08-04.at.2.47.15.PM.mov