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

[Lens] Show validation feedback on top values out of bounds number of values #110222

Merged
merged 5 commits into from
Aug 31, 2021

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Aug 26, 2021

Summary

Fixes #105133

This PR adds some validation feedback around the Number of values input field for the Top values operation, when the user inputs a value either too high or low.

The error message is contextual and an explanation of the fallback is included:

Screenshot 2021-08-26 at 14 25 58

Screenshot 2021-08-26 at 14 35 57

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@dej611 dej611 added release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 Feature:Lens auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Aug 26, 2021
@dej611 dej611 requested a review from a team August 26, 2021 12:43
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@dej611
Copy link
Contributor Author

dej611 commented Aug 30, 2021

@elasticmachine merge upstream

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I tested it locally and it works fine 😉
Just a comment here, I see that we have two cases of validations in Lens number inputs:

  • if the user adds a value outside the predefined thresholds, we display an error message (like in this PR)
  • If a user adds a value outside the predefined thresholds, we automatically change them to the accepted threshold. (for example in the legends popover number inputs)

Does it make sense to align the behaviors?
cc @MichaelMarcialis

@MichaelMarcialis
Copy link
Contributor

Does it make sense to align the behaviors?

Excellent question, @stratoula. We absolutely should be aligning behaviors such as this when it makes sense to do so. And I agree with you in believing that this is indeed one of those situations.

For a tool like Lens, where configuration changes are reflected immediately on the visualization, anything we can do to avoid hitting users with error messages and asking them to perform unnecessary additional actions is preferable in my opinion. As such, I like the idea of automatically changing an invalid Number of values to a valid entry on blur.

For example, in the case of a user entry of 5000, this should automatically change to 1000 on blur. Similarly, in the case of a user entry of -5, this should automatically change to 1 on blur.

@dej611
Copy link
Contributor Author

dej611 commented Aug 31, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.6MB 1.6MB +844.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested on Chrome, the behavior is aligned with the comments from the PR. code lgtm 🆗

@dej611 dej611 merged commit 3b81205 into elastic:master Aug 31, 2021
@dej611 dej611 deleted the fix/105133 branch August 31, 2021 13:23
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 31, 2021
… values (elastic#110222)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Aug 31, 2021
… values (#110222) (#110613)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] No indication given when "number of values" for Top Values is too high
7 participants