diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts index e995d39270e..5a11b2a069b 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts @@ -339,17 +339,25 @@ export const addAssetsToDomain = async ( for (const asset of assets) { const name = get(asset, 'entityResponseData.name'); const fqn = get(asset, 'entityResponseData.fullyQualifiedName'); + const entityDisplayName = get(asset, 'entityResponseData.displayName'); + const visibleName = entityDisplayName ?? name; const searchRes = page.waitForResponse( - `/api/v1/search/query?q=${name}&index=all&from=0&size=25&*` + `/api/v1/search/query?q=${visibleName}&index=all&from=0&size=25&*` ); await page .getByTestId('asset-selection-modal') .getByTestId('searchbar') - .fill(name); + .fill(visibleName); await searchRes; await page.locator(`[data-testid="table-data-card_${fqn}"] input`).check(); + + await expect( + page.locator( + `[data-testid="table-data-card_${fqn}"] [data-testid="entity-header-name"]` + ) + ).toContainText(visibleName); } const assetsAddRes = page.waitForResponse(`/api/v1/domains/*/assets/add`); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts index ffe0f79c026..512c0a844d5 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts @@ -696,17 +696,25 @@ export const addAssetToGlossaryTerm = async ( const entityFqn = get(asset, 'entityResponseData.fullyQualifiedName'); const entityName = get(asset, 'entityResponseData.name'); const searchRes = page.waitForResponse('/api/v1/search/query*'); + const entityDisplayName = get(asset, 'entityResponseData.displayName'); + const visibleName = entityDisplayName ?? entityName; await page .locator( '[data-testid="asset-selection-modal"] [data-testid="searchbar"]' ) - .fill(entityName); + .fill(visibleName); await searchRes; await page.click( `[data-testid="table-data-card_${entityFqn}"] input[type="checkbox"]` ); + + await expect( + page.locator( + `[data-testid="table-data-card_${entityFqn}"] [data-testid="entity-header-name"]` + ) + ).toContainText(visibleName); } await page.click('[data-testid="save-btn"]'); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts index 291ce56c147..4db44c4a2b6 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts @@ -113,34 +113,43 @@ export const addAssetsToTag = async ( if (!isUndefined(otherAsset)) { for (const asset of otherAsset) { const name = get(asset, 'entityResponseData.name'); - + const entityDisplayName = get(asset, 'entityResponseData.displayName'); + const visibleName = entityDisplayName ?? name; const searchRes = page.waitForResponse( - `/api/v1/search/query?q=${name}&index=all&from=0&size=25&**` + `/api/v1/search/query?q=${visibleName}&index=all&from=0&size=25&**` ); await page .getByTestId('asset-selection-modal') .getByTestId('searchbar') - .fill(name); + .fill(visibleName); await searchRes; - await expect(page.getByText(name)).not.toBeVisible(); + await expect(page.getByText(visibleName)).not.toBeVisible(); } } for (const asset of assets) { const name = get(asset, 'entityResponseData.name'); const fqn = get(asset, 'entityResponseData.fullyQualifiedName'); + const entityDisplayName = get(asset, 'entityResponseData.displayName'); + const visibleName = entityDisplayName ?? name; const searchRes = page.waitForResponse( - `/api/v1/search/query?q=${name}&index=all&from=0&size=25&**` + `/api/v1/search/query?q=${visibleName}&index=all&from=0&size=25&**` ); await page .getByTestId('asset-selection-modal') .getByTestId('searchbar') - .fill(name); + .fill(visibleName); await searchRes; await page.locator(`[data-testid="table-data-card_${fqn}"] input`).check(); + + await expect( + page.locator( + `[data-testid="table-data-card_${fqn}"] [data-testid="entity-header-name"]` + ) + ).toContainText(visibleName); } const assetsAddRes = page.waitForResponse(`/api/v1/tags/*/assets/add`); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeader/EntityHeader.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeader/EntityHeader.component.tsx index 183a3a7ad21..0a08a40e457 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeader/EntityHeader.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeader/EntityHeader.component.tsx @@ -38,6 +38,7 @@ interface Props { showName?: boolean; nameClassName?: string; displayNameClassName?: string; + showOnlyDisplayName?: boolean; } export const EntityHeader = ({ @@ -54,6 +55,7 @@ export const EntityHeader = ({ showName = true, nameClassName = '', displayNameClassName = '', + showOnlyDisplayName = false, }: Props) => { return (
@@ -83,6 +85,7 @@ export const EntityHeader = ({ openEntityInNewPage={openEntityInNewPage} serviceName={serviceName} showName={showName} + showOnlyDisplayName={showOnlyDisplayName} />
); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeaderWidget.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeaderWidget.tsx index aad1cdb8ed6..0862b785a27 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeaderWidget.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeaderWidget.tsx @@ -49,11 +49,12 @@ export const GlossaryHeaderWidget = ({ return (
= forwardRef< )}