-
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
De-angularize and EUI-ficate Discover Context control elements #44474
De-angularize and EUI-ficate Discover Context control elements #44474
Conversation
💚 Build Succeeded |
… kertal-pr-convert-context-size-picker-to-react
…-context-size-picker-to-react
…-context-size-picker-to-react
💚 Build Succeeded |
…-context-size-picker-to-react
Pinging @elastic/kibana-app |
💚 Build Succeeded |
no, let's debounce it, I've committed a suggestion. however, in the old version, the value was submitted, via |
💔 Build Failed |
The debouncing input approach would ease the problem of unwanted requests , but it would not solve it. this is especially a problem for the input at the bottom of the page, you start to type, pause a little, it just came to you mind that you don't need 10.000 records, to late, they were already requested. In the original version, the request was submitted on enter key or by leaving the input. I'd suggest to go with that pattern, and improve it a little by adding a button to submit the change (that's only displayed when the value was changed) |
I would prefer the user experience of a debounced input field, but that's a subjective opinion. Also as these requests just do a simple search fetching documents (no costly aggregations), it feels like this should be fine. @ryankeairns what do you think? |
@flash1293 I do agree that these are light requests, I just think the 'I changed my mind' situation on the bottom bar can't happen with the submit button solution: Also like using |
In this situation, I feel the 'on submit' (press enter or leave the input) is the expected trigger. Unlike a search ahead (autocomplete) where I would expect each keystroke to refine the search, this feels like an instance where I want to type a number with certainty prior to submitting. I don't feel the extra icon button is necessary, either. |
…-context-size-picker-to-react
- submit form onblur - submit form on enter/return
- the increase of count is done by the react component
💚 Build Succeeded |
Really like your solution, @kertal 👍 Great work! Just one little thing that should be fixed - if you clear the input and submit it, you get hit with a bunch of errors: Should be a small fix. |
thx @flash1293! yes, I've added better checking for valid input between the range of MAX_CONTEXT_SIZE & MIN_CONTEXT_SIZE, and improved / deduplicated jest tests |
💚 Build Succeeded |
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.
LGTM, tested and works as expected. Great improvement! 👍
…-to-np-ready * 'master' of github.com:elastic/kibana: Revert "Revert "[ci] compress jobs for CI stability" (elastic#44584)" add src/plugins to the list of plugin dirs to watch (elastic#45033) De-angularize and EUI-ficate Discover Context control elements (elastic#44474)
…ic#44474) * Create ActionBar component, merges loading button and size picker * Use react component, remove angular code * Migrate constants + state to typescript * Remove unused increaseCount functions + tests * Add jest test
… (#45288) * Create ActionBar component, merges loading button and size picker * Use react component, remove angular code * Migrate constants + state to typescript * Remove unused increaseCount functions + tests * Add jest test
Summary
Convert Discover's Context control elements to React, introducing EUI elements
Old Layout
New Layout
Note: I might adapt structure a bit when also the containing page is deangularized
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorialsFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately