diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.ts index b0d19ed0df7..b7ccb5c5e53 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.ts @@ -1318,8 +1318,14 @@ describe('Glossary page should work properly', { tags: 'Governance' }, () => { NEW_GLOSSARY_TERMS.term_2.name, NEW_GLOSSARY_TERMS.term_1.name ); - // verify the term is moved under the parent term - cy.get('[data-testid="expand-collapse-all-button"]').click(); + + // clicking on the expand icon to view the child term + cy.get( + `[data-row-key=${Cypress.$.escapeSelector( + NEW_GLOSSARY_TERMS.term_1.fullyQualifiedName + )}] [data-testid="expand-icon"] > svg` + ).click(); + cy.get( `.ant-table-row-level-1[data-row-key="${Cypress.$.escapeSelector( NEW_GLOSSARY_TERMS.term_1.fullyQualifiedName diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/AsyncSelectList/TreeAsyncSelectList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/AsyncSelectList/TreeAsyncSelectList.tsx index 9b9b7625918..b56d94bea90 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/AsyncSelectList/TreeAsyncSelectList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/AsyncSelectList/TreeAsyncSelectList.tsx @@ -188,7 +188,8 @@ const TreeAsyncSelectList: FC> = ({ ...searchOptions, ...(initialOptions ?? []), ] as ModifiedGlossaryTerm[], - value + value, + false ); return initialData diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/GlossaryUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/GlossaryUtils.tsx index 8f8c6b53156..39b837c8e1e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/GlossaryUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/GlossaryUtils.tsx @@ -148,17 +148,23 @@ export const getGlossaryBreadcrumbs = (fqn: string) => { return breadcrumbList; }; +// This function finds and gives you the glossary term you're looking for. +// You can then use this term or update its information in the Glossary or Term with it's reference created +// Reference will only be created if withReference is true export const findGlossaryTermByFqn = ( list: ModifiedGlossaryTerm[], - fullyQualifiedName: string + fullyQualifiedName: string, + withReference = true ): GlossaryTerm | Glossary | ModifiedGlossary | null => { for (const item of list) { if ((item.fullyQualifiedName ?? item.value) === fullyQualifiedName) { - return { - ...item, - fullyQualifiedName: item.fullyQualifiedName ?? item.data?.tagFQN, - ...(item.data ?? {}), - }; + return withReference + ? item + : { + ...item, + fullyQualifiedName: item.fullyQualifiedName ?? item.data?.tagFQN, + ...(item.data ?? {}), + }; } if (item.children) { const found = findGlossaryTermByFqn(