Skip to content

Follow-up from "Jira Connect: show all namespaces when search term length < 3"

The following discussion from !61099 (merged) should be addressed:

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:

  1. onGroupSearch does not modify this.page.
  2. Create a search computed property to wrap the term's length logic (searchTerm?.length < MINIMUM_SEARCH_TERM_LENGTH ? '' : searchTerm).
  3. Define a watcher that resets page whenever the search computed property changes.
  4. 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