-
Notifications
You must be signed in to change notification settings - Fork 45
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
Feat/heal search debounce #1232
Conversation
…sts can be written and so debouncing works
…earch into a search folder and authored a test for doDebounceSearch
…ay to object to avoid needing spread operator
@@ -0,0 +1,63 @@ | |||
import { DiscoveryConfig } from '../../DiscoveryConfig'; | |||
|
|||
interface FilterState { |
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.
this can use the exported interface?
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.
Good point! The FilterState here has been updated as an import from the Discovery.tsx file.
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.
overall the debounce logic seems working fine in QA and looks good to me. One minor comment below
There is a bug that if there is a value in the search bar and user switches page, the value will be preserved but the table will show as it has 0 reocrds. But I think this is an existing bug that is not relevent to the change
Thanks @mfshao! I agree that the bug is a preexisting condition, I spent an hour or so working on it and I think it merits a separate ticket. |
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.
👍 looks good, let's see when CI will be happy... 🕒
Jira Ticket: HP-983
New Features
This adds 500ms debouncing to the HEAL search functionality following page load. This uses the lodash debounce API (this library is already included in the code base).
This also adds a unit test for the debouncing functionality.
Improvements
A utils folder has been added containing a Search folder to house the search functionality and to aid in code organization. The filtering functions associated with searching have been moved into this folder to help clean up Discovery.tsx. Unneeded imports were removed from Discovery.tsx.
Screen Shots
With a 500ms debounce
![output](https://user-images.githubusercontent.com/113449836/218203865-cb472065-e475-4093-b61e-54c2958a711a.gif)
Note that when typing a longer query, such as "intersection" it only searches once