Follow-up from "Jira Connect: show all namespaces when search term length < 3"
The following discussion from !61099 (merged) should be addressed:
-
@pgascouvaillancourt started a discussion: (+3 comments)
Empty strings, or search terms with one or two characters, are essentially considered identical in the component's logic. This means resetting the page
on every user input might not be the best UX because we'll bring them back to the first page even in cases where the query doesn't actually change.
Perhaps we could do the following:
-
onGroupSearch
does not modifythis.page
. - Create a
search
computed property to wrap the term's length logic (searchTerm?.length < MINIMUM_SEARCH_TERM_LENGTH ? '' : searchTerm
). - Define a watcher that resets
page
whenever thesearch
computed property changes. -
loadGroups
leverages the computed property in the fetch query.
Availability & Testing
Suggestion: add a frontend integration test that asserts on the presence/content of an outbound request when changing the searchTerm with a length from (1...2) to (+3).
Edited by Sean Gregory