From e59fffc2f3e7f0f385a79f37eff0de93ee3526b3 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Fri, 8 Dec 2023 13:13:19 +0530 Subject: [PATCH] MINOR: Fix the query of domain in explore (#14297) * Fix the query of domian in exolore * added cypress test * minor change in url * minor change --- .../ui/cypress/e2e/Pages/Domains.spec.js | 21 +++++++++++++++++++ .../Auth/AuthProviders/AuthProvider.tsx | 4 ++-- .../ui/src/components/NavBar/NavBar.tsx | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Domains.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Domains.spec.js index ab318d57662..32a2b8f9b85 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Domains.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Domains.spec.js @@ -13,6 +13,7 @@ // eslint-disable-next-line spaced-comment /// +import { interceptURL, verifyResponseStatusCode } from '../../common/common'; import { addAssetsToDataProduct, addAssetsToDomain, @@ -88,6 +89,26 @@ describe('Domain page should work properly', () => { addAssetsToDataProduct(DOMAIN_3.dataProducts[0], DOMAIN_3); }); + it('Switch domain from navbar and check domain query call warp in quotes', () => { + cy.get('[data-testid="domain-dropdown"]').should('be.visible').click(); + + cy.get( + `[data-menu-id*="${DOMAIN_3.name}"] > .ant-dropdown-menu-title-content` + ) + .should('be.visible') + .click(); + + interceptURL( + 'GET', + '/api/v1/search/query?q=%28domain.fullyQualifiedName%3A%22Cypress%20Space%22%29*', + 'tableSearchQuery' + ); + + cy.get('[data-testid="app-bar-item-explore"]').click(); + + verifyResponseStatusCode('@tableSearchQuery', 200); + }); + it('Remove data product assets using asset selection modal should work properly', () => { removeAssetsFromDataProduct(DOMAIN_2.dataProducts[0], DOMAIN_2); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Auth/AuthProviders/AuthProvider.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Auth/AuthProviders/AuthProvider.tsx index 5c1a5de2e1e..364bf2a91cc 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Auth/AuthProviders/AuthProvider.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Auth/AuthProviders/AuthProvider.tsx @@ -435,9 +435,9 @@ export const AuthProvider = ({ // Parse and update the query parameter const queryParams = Qs.parse(config.url.split('?')[1]); // adding quotes for exact matching - const domainStatement = `(domain.fullyQualifiedName:${escapeESReservedCharacters( + const domainStatement = `(domain.fullyQualifiedName:"${escapeESReservedCharacters( activeDomain - )})`; + )}")`; queryParams.q = queryParams.q ?? ''; queryParams.q += isEmpty(queryParams.q) ? domainStatement diff --git a/openmetadata-ui/src/main/resources/ui/src/components/NavBar/NavBar.tsx b/openmetadata-ui/src/main/resources/ui/src/components/NavBar/NavBar.tsx index 725ccdd551a..668efde3fe3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/NavBar/NavBar.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/NavBar/NavBar.tsx @@ -443,7 +443,7 @@ const NavBar = ({ }} placement="bottomRight" trigger={['click']}> - +