-
Notifications
You must be signed in to change notification settings - Fork 3.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
[#13054] Make substrings of the name in dropdown selections of recipient to be searchable #13179
base: master
Are you sure you want to change the base?
[#13054] Make substrings of the name in dropdown selections of recipient to be searchable #13179
Conversation
…able-dropdown-Grace
…3054-searchable-dropdown
This reverts commit 40c2c14.
Retry input design
It's weird that the failed tests were passed in my local environment for commit "Try to fix e2e tests". I felt that adding a hidden select to avoid tests was not a good solution, and it also didn't work. Please let us know if these changes are acceptable, and we will be happy to complete this PR. |
Fixes #13054 (#13054)
Outline of Solution
Problem: Users were unable to easily search for specific substrings in the name when selecting recipients from a dropdown menu. The previous dropdown list did not have search functionality for substrings, which made it challenging to find and select specific recipients, especially in large lists.
Solution:
Modified the dropdown component to include a searchable input field.
Implemented logic that allows searching for substrings in the recipient names. This means users can now type partial names to filter down the options in the dropdown.
Updated related unit tests (question-submission-form.component.spec.ts) to verify that the new search functionality works correctly, including edge cases for partial name matches.
Changes Made:
Modified the component at src/web/app/components/question-submission-form/question-submission-form.component.ts to embed a text input.
Added styling to the input field to highlight when a name doesn't match any results. (If the input does not match any filter results, it will turn red.)
Updated the HTML and CSS to style the input field appropriately.
Enhanced the dropdown functionality to filter names by any substring.
Added new test cases to question-submission-form.component.spec.ts to verify substring search functionality.
Adjusted other relevant UI logic to ensure compatibility with the new feature.
Screenshots of the New UI:
Screenshot 1: Demonstration of the substring filtering:
Example 1: Typing "cha" will display all recipients whose names contain "cha", such as "Charlie Davis" and "Benny Charles".
Example 2: Typing "is" will filter to show all names containing the substring "is", like "Charlie Davis" and "Francis Gabriel".
Screenshot 2: Example of invalid input where there are no matching results:
Typing "Jerry" results in the input field turning red, indicating that no recipients match the given name. This immediate visual feedback helps users adjust their search term.