-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add debounce to transporter search #727
Comments
This is a great idea, and I agree that it would improve the user experience and has the added benefit of reducing excessive traffic between Haztrak and the e-Manifest system (also I appreciate the video). We do need to consider the constraints of the e-Manifest Site Search service which we call on the back end if the user's org has provided API credentials. The I believe we still need to implement that constraint in our back end. I see a couple options: Option A:
Option B:
I'm partial to the first option A, and seems inline with your initial proposal. Let me know what you think @sheckathorne. |
Honestly, I don't think I understand the implications of A versus B as well as you, so I would lean with you toward option A if you think that's best. With that said, I think the implementation on the back end would look like this. Let me know if you had something different in mind:
|
We went ahead and implemented a check using the view's DRF Serializer class in #728 like so class HandlerSearchSerializer(serializers.Serializer):
siteId = serializers.CharField(required=True)
siteId = serializers.CharField(
required=True,
min_length=2,
)
... I also went ahead and implemented a new RcraSiteSearch class (maybe overkill) which validates a 2-character minimum before calling the e-Manifest site search service as well. A future PR for this can also remove the logic in the front end for a 5-character minimum |
closed with #729 Thanks again @sheckathorne. We appreciate your input on ways that we could enhance this project nad hope to see more awesome feature requests like these. |
🚀 Feature Request
Within the manifest form, I think it would be nice from a UX perspective to not require five characters before returning transporter results. I was experimenting with removing the character count requirement and instead adding a debounce filter on the input instead to limit requests to the API.
In the following example, I paused my search twice to refine my search and made two requests to the server - however, I noticed there is a third request with an empty epaId querystring after selecting the transporter.
Screen.Recording.2024-06-03.at.7.10.42.PM.mov
The text was updated successfully, but these errors were encountered: