diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityDetails.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityDetails.spec.js index da8233d58ce..83a291bf55f 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityDetails.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityDetails.spec.js @@ -24,6 +24,8 @@ import { } from '../../common/common'; import { DELETE_ENTITY, DELETE_TERM } from '../../constants/constants'; +const entityTag = 'PersonalData.Personal'; + describe('Entity Details Page', () => { beforeEach(() => { cy.login(); @@ -105,7 +107,7 @@ describe('Entity Details Page', () => { cy.clickOnLogo(); }; - const addOwnerAndTier = (value) => { + const addOwnerTierAndTag = (value) => { visitEntityDetailsPage(value.term, value.serviceName, value.entity); interceptURL( @@ -161,27 +163,52 @@ describe('Entity Details Page', () => { cy.get('[data-testid="entity-tags"]').should('contain', 'Tier1'); + // add tag to the entity + interceptURL('GET', '/api/v1/tags?limit=1000', 'tagsRequest'); + interceptURL( + 'GET', + '/api/v1/search/query?q=*&from=0&size=1000&index=glossary_search_index', + 'glossaryRequest' + ); + + cy.get('[data-testid="edit-button"]').should('be.visible').click(); + + cy.get('[data-testid="tag-selector"]') + .scrollIntoView() + .should('be.visible') + .type(entityTag); + + verifyResponseStatusCode('@tagsRequest', 200); + verifyResponseStatusCode('@glossaryRequest', 200); + + cy.get('.ant-select-item-option-content') + .first() + .should('be.visible') + .click(); + + cy.get('[data-testid="saveAssociatedTag"]').should('be.visible').click(); + // Test out the activity feed and task tab cy.get('[data-testid="Activity Feeds & Tasks"]') .should('be.visible') .click(); // Check for tab count - cy.get('[data-testid=filter-count').should('be.visible').contains('2'); + cy.get('[data-testid=filter-count').should('be.visible').contains('3'); - // Check for activity feeds - count should be 2 - // 1 for tier change and 1 for owner change - cy.get('[data-testid="message-container"]').its('length').should('eq', 2); + // Check for activity feeds - count should be 3 + // 1 for tier change , 1 for owner change, 1 for entity tag + cy.get('[data-testid="message-container"]').its('length').should('eq', 3); cy.clickOnLogo(); // checks newly generated feed for follow and setting owner cy.get('[data-testid="message-container"]') - .eq(1) + .eq(2) .contains('Added owner: admin') .should('be.visible'); cy.get('[data-testid="message-container"]') - .eq(0) + .eq(1) .scrollIntoView() .contains('Added tags: Tier.Tier1') .should('be.visible'); @@ -235,6 +262,9 @@ describe('Entity Details Page', () => { .should('be.visible') .click(); + // after removing the tier entity tag should exists + cy.get('[data-testid="entity-tags"]').should('contain', entityTag); + cy.clickOnLogo(); }; @@ -282,8 +312,8 @@ describe('Entity Details Page', () => { cy.clickOnLogo(); }; - it('Add Owner and Tier for entity', () => { - addOwnerAndTier(DELETE_ENTITY.table); + it('Add Owner, Tier and tags for entity', () => { + addOwnerTierAndTag(DELETE_ENTITY.table); }); it('Remove Owner and Tier for entity', () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContainerDetail/ContainerDataModel/ContainerDataModel.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ContainerDetail/ContainerDataModel/ContainerDataModel.tsx index f2d5db145f1..2ab010d2f77 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ContainerDetail/ContainerDataModel/ContainerDataModel.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContainerDetail/ContainerDataModel/ContainerDataModel.tsx @@ -153,9 +153,7 @@ const ContainerDataModel: FC = ({ return ( <> {isReadOnly ? ( - - - + ) : ( handleTagContainerClick(record, index)}> {deleted ? ( - - - + ) : ( = ({ if (tableDetails) { const updatedTableDetails = { ...tableDetails, - tags: undefined, + tags: getTagsWithoutTier(tableDetails.tags ?? []), }; settingsUpdateHandler(updatedTableDetails); } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx index 18167381946..b6bada6fedf 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx @@ -522,9 +522,7 @@ const EntityTable = ({ return (
{isReadOnly ? ( -
- -
+ ) : (
- - - getTagValue(tag) - )} - /> - + + getTagValue(tag) + )} + /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx index 33c24513fe6..05c7ca11050 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx @@ -355,7 +355,7 @@ const MlModelDetail: FC = ({ if (mlModelDetail) { const updatedMlModelDetails = { ...mlModelDetail, - tags: undefined, + tags: getTagsWithoutTier(mlModelDetail.tags ?? []), }; settingsUpdateHandler(updatedMlModelDetails); } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/PipelineDetails/PipelineDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/PipelineDetails/PipelineDetails.component.tsx index cc2958e11bc..8284eac99f7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/PipelineDetails/PipelineDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/PipelineDetails/PipelineDetails.component.tsx @@ -304,7 +304,7 @@ const PipelineDetails = ({ if (pipelineDetails) { const updatedPipelineDetails = { ...pipelineDetails, - tags: undefined, + tags: getTagsWithoutTier(pipelineDetails.tags ?? []), }; settingsUpdateHandler(updatedPipelineDetails); } @@ -531,9 +531,7 @@ const PipelineDetails = ({ data-testid="tags-wrapper" onClick={() => handleEditTaskTag(record, index)}> {deleted ? ( -
- -
+ ) : ( = ({ [tags] ); - return sizeCap > -1 ? ( - <> - {sortedTagsBySource - .slice(0, sizeCap) - .map((tag, index) => getTagsElement(tag, index))} + return ( + + {sizeCap > -1 ? ( + <> + {sortedTagsBySource + .slice(0, sizeCap) + .map((tag, index) => getTagsElement(tag, index))} - {sortedTagsBySource.slice(sizeCap).length > 0 && ( - - {sortedTagsBySource.slice(sizeCap).map((tag, index) => ( -

- {getTagsElement(tag, index)} -

- ))} - - } - placement="bottom" - trigger="click"> - - {ELLIPSES} - -
+ {sortedTagsBySource.slice(sizeCap).length > 0 && ( + + {sortedTagsBySource.slice(sizeCap).map((tag, index) => ( +

+ {getTagsElement(tag, index)} +

+ ))} + + } + placement="bottom" + trigger="click"> + + {ELLIPSES} + +
+ )} + + ) : ( + <> + {sortedTagsBySource.map((tag, index) => getTagsElement(tag, index))} + )} - - ) : ( - <>{sortedTagsBySource.map((tag, index) => getTagsElement(tag, index))} +
); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicDetails.component.tsx index 2921922d335..1ac8f250b10 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicDetails.component.tsx @@ -314,7 +314,7 @@ const TopicDetails: React.FC = ({ if (topicDetails) { const updatedTopicDetails = { ...topicDetails, - tags: undefined, + tags: getTagsWithoutTier(topicDetails.tags ?? []), }; settingsUpdateHandler(updatedTopicDetails); } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicSchema/TopicSchema.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicSchema/TopicSchema.tsx index 8e0a251370d..14cd9b38ce2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicSchema/TopicSchema.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicSchema/TopicSchema.tsx @@ -183,9 +183,7 @@ const TopicSchemaFields: FC = ({ return ( <> {isReadOnly ? ( - - - + ) : ( { accessor: 'tags', width: 272, render: (tags: Column['tags']) => ( -
- -
+ ), }, ],