diff --git a/datahub-web-react/src/app/domain/CreateDomainModal.tsx b/datahub-web-react/src/app/domain/CreateDomainModal.tsx index 7ea2b3fdbb9b4b..ecfcd116755cb3 100644 --- a/datahub-web-react/src/app/domain/CreateDomainModal.tsx +++ b/datahub-web-react/src/app/domain/CreateDomainModal.tsx @@ -18,7 +18,7 @@ const ClickableTag = styled(Tag)` type Props = { onClose: () => void; - onCreate: (urn: string, id: string | undefined, name: string, description: string) => void; + onCreate: (urn: string, id: string | undefined, name: string, description: string | undefined) => void; }; const SUGGESTED_DOMAIN_NAMES = ['Engineering', 'Marketing', 'Sales', 'Product']; diff --git a/datahub-web-react/src/app/domain/DomainItemMenu.tsx b/datahub-web-react/src/app/domain/DomainItemMenu.tsx index f6aebeb5478552..a0007b90435d74 100644 --- a/datahub-web-react/src/app/domain/DomainItemMenu.tsx +++ b/datahub-web-react/src/app/domain/DomainItemMenu.tsx @@ -59,7 +59,7 @@ export default function DomainItemMenu({ name, urn, onDelete }: Props) { } > - + ); } diff --git a/datahub-web-react/src/app/domain/DomainListColumns.tsx b/datahub-web-react/src/app/domain/DomainListColumns.tsx index 0baf007e49fa7d..952e4567996c6b 100644 --- a/datahub-web-react/src/app/domain/DomainListColumns.tsx +++ b/datahub-web-react/src/app/domain/DomainListColumns.tsx @@ -34,15 +34,17 @@ export function DomainListMenuColumn(handleDelete: (urn: string) => void) { export function DomainNameColumn(logoIcon: JSX.Element) { return (record: DomainEntry) => ( - - {logoIcon} - - {record.name} - - - {record.entities} entities - - + + + {logoIcon} + + {record.name} + + + {record.entities} entities + + + ); } diff --git a/datahub-web-react/src/app/domain/DomainsList.tsx b/datahub-web-react/src/app/domain/DomainsList.tsx index 38875ee786af85..7c0db61cf14aa9 100644 --- a/datahub-web-react/src/app/domain/DomainsList.tsx +++ b/datahub-web-react/src/app/domain/DomainsList.tsx @@ -63,7 +63,7 @@ export const DomainsList = () => { query, }, }, - fetchPolicy: 'cache-first', + fetchPolicy: query && query.length > 0 ? 'no-cache' : 'cache-first', }); const totalDomains = data?.listDomains?.total || 0; @@ -76,7 +76,7 @@ export const DomainsList = () => { }; const handleDelete = (urn: string) => { - removeFromListDomainsCache(client, urn, page, pageSize, query); + removeFromListDomainsCache(client, urn, page, pageSize); setTimeout(function () { refetch?.(); }, 2000); @@ -116,9 +116,9 @@ export const DomainsList = () => { const url = entityRegistry.getEntityUrl(EntityType.Domain, domain.urn); return { + urn: domain.urn, name: displayName, entities: totalEntitiesText, - urn: domain.urn, ownership: domain.ownership, url, }; @@ -147,7 +147,7 @@ export const DomainsList = () => { fontSize: 12, }} onSearch={() => null} - onQueryChange={(q) => setQuery(q)} + onQueryChange={(q) => setQuery(q && q.length > 0 ? q : undefined)} entityRegistry={entityRegistry} hideRecommendations /> @@ -186,13 +186,12 @@ export const DomainsList = () => { urn, properties: { name, - description, + description: description || null, }, ownership: null, entities: null, }, pageSize, - query, ); setTimeout(() => refetch(), 2000); }} diff --git a/datahub-web-react/src/app/domain/utils.ts b/datahub-web-react/src/app/domain/utils.ts index 847d237f78fb9a..3af161bc445659 100644 --- a/datahub-web-react/src/app/domain/utils.ts +++ b/datahub-web-react/src/app/domain/utils.ts @@ -3,7 +3,7 @@ import { ListDomainsDocument, ListDomainsQuery } from '../../graphql/domain.gene /** * Add an entry to the list domains cache. */ -export const addToListDomainsCache = (client, newDomain, pageSize, query) => { +export const addToListDomainsCache = (client, newDomain, pageSize) => { // Read the data from our cache for this query. const currData: ListDomainsQuery | null = client.readQuery({ query: ListDomainsDocument, @@ -11,7 +11,6 @@ export const addToListDomainsCache = (client, newDomain, pageSize, query) => { input: { start: 0, count: pageSize, - query, }, }, }); @@ -26,7 +25,6 @@ export const addToListDomainsCache = (client, newDomain, pageSize, query) => { input: { start: 0, count: pageSize, - query, }, }, data: { @@ -43,7 +41,7 @@ export const addToListDomainsCache = (client, newDomain, pageSize, query) => { /** * Remove an entry from the list domains cache. */ -export const removeFromListDomainsCache = (client, urn, page, pageSize, query) => { +export const removeFromListDomainsCache = (client, urn, page, pageSize) => { // Read the data from our cache for this query. const currData: ListDomainsQuery | null = client.readQuery({ query: ListDomainsDocument, @@ -51,7 +49,6 @@ export const removeFromListDomainsCache = (client, urn, page, pageSize, query) = input: { start: (page - 1) * pageSize, count: pageSize, - query, }, }, }); @@ -66,7 +63,6 @@ export const removeFromListDomainsCache = (client, urn, page, pageSize, query) = input: { start: (page - 1) * pageSize, count: pageSize, - query, }, }, data: { diff --git a/smoke-test/tests/cypress/cypress/integration/mutations/domains.js b/smoke-test/tests/cypress/cypress/integration/mutations/domains.js index cb80d83898b55c..8ae7bc5f63fa85 100644 --- a/smoke-test/tests/cypress/cypress/integration/mutations/domains.js +++ b/smoke-test/tests/cypress/cypress/integration/mutations/domains.js @@ -8,9 +8,6 @@ describe("add remove domain", () => { cy.clickOptionWithText("New Domain"); cy.addViaModel(test_domain, "Create new Domain") cy.waitTextVisible("Created domain!") - - cy.waitTextVisible(test_domain) - cy.waitTextVisible(test_domain) .parents("[data-testid^='urn:li:domain:']") .invoke('attr', 'data-testid') @@ -55,9 +52,7 @@ describe("add remove domain", () => { it("delete a domain and ensure dangling reference is deleted on entities", () => { cy.login(); cy.goToDomainList(); - cy.get('[data-testid="' + domain_created_urn + '"]').within(() => { - cy.get(".ant-dropdown-trigger").click(); - }); + cy.get('[data-testid="dropdown-menu-' + domain_created_urn + '"]').click(); cy.clickOptionWithText("Delete"); cy.clickOptionWithText("Yes"); cy.ensureTextNotPresent(test_domain)