Prasad P. Pawar created ATLAS-5412:
--------------------------------------
Summary: Atlas UI: React UI Quick Search: disable Search button
and block empty/whitespace submit
Key: ATLAS-5412
URL: https://issues.apache.org/jira/browse/ATLAS-5412
Project: Atlas
Issue Type: Bug
Components: atlas-webui
Affects Versions: 3.0.0
Reporter: Prasad P. Pawar
Assignee: Prasad P. Pawar
Quick Search (dashboard center and header) should not allow search with an
empty or whitespace-only query. The Search button must stay disabled until the
user enters at least one non-whitespace character. Enter key and button click
must not navigate or submit a wildcard {{query=*}} search.
h3. Problem
Previously, submitting empty search could trigger navigation with a wildcard
query ({{{}*{}}}), returning overly broad results and poor UX.
h3. Expected behavior
* Search button disabled when input is empty or whitespace-only
* Search button enabled when input has ≥1 non-whitespace character
* Click Search with empty input → no navigation
* Press Enter with empty input → no navigation
* Valid query → navigates to {{/search/searchResult?query=...}}
h3. Scope
* {{QuickSearch}} component (used in dashboard center and header)
* Does not affect Advanced Search modal
h3. Technical approach
* {{hasValidSearchQuery(value)}} → {{value.trim().length > 0}}
* {{disabled=\{!isSearchEnabled}}} on Search {{CustomButton}}
* Early return in {{handleSubmitSearch}} and Enter handler when invalid
h3.
h3. Test plan
* Manual: dashboard home + header search bar
* Automated: {{QuickSearch.test.tsx}} → {{Search Button Validation}} describe
block
* Verify no {{query=*}} in URL after empty submit attempts
--
This message was sent by Atlassian Jira
(v8.20.10#820010)