From 5c5c30581351e45be485e323fe4347bd0846e7e4 Mon Sep 17 00:00:00 2001 From: Aniket Katkar <51777795+aniketkatkar97@users.noreply.github.com> Date: Fri, 30 Sep 2022 20:19:29 +0530 Subject: [PATCH] UI: Fixed issue with suggestion overlay staying after redirection to the result (#7808) * Fixed issue with suggetion overlay staying after redirection to the result * fixed failing cypress test for my-data spec --- .../src/main/resources/ui/cypress/e2e/Pages/myData.spec.js | 2 +- .../src/main/resources/ui/src/components/app-bar/Appbar.tsx | 1 + .../main/resources/ui/src/components/app-bar/Suggestions.tsx | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/myData.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/myData.spec.js index 5c29b265dd4..f220d19a3ec 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/myData.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/myData.spec.js @@ -55,7 +55,7 @@ describe('MyData page should work', () => { }; const checkRecentlySearchElement = (term) => { - searchEntity(term); + searchEntity(term, false); cy.clickOnLogo(); cy.get(`[data-testid="search-term-${term}"]`) .scrollIntoView() diff --git a/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx b/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx index e41f8a66181..5f24226bea8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx @@ -75,6 +75,7 @@ const Appbar: React.FC = (): JSX.Element => { const handleSearchChange = (value: string) => { setSearchValue(value); + value ? setIsOpen(true) : setIsOpen(false); }; const supportLinks = [ diff --git a/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Suggestions.tsx b/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Suggestions.tsx index 0c4d4828158..69f52069c18 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Suggestions.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Suggestions.tsx @@ -298,7 +298,6 @@ const Suggestions = ({ searchText, isOpen, setIsOpen }: SuggestionProp) => { // eslint-disable-next-line @typescript-eslint/no-explicit-any (res.data as any).suggest['metadata-suggest'][0].options ); - setIsOpen(true); } else { throw jsonData['api-error-messages']['unexpected-server-response']; }