diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Utils/CustomProperty.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Utils/CustomProperty.ts index d4eb63d0ec4..ae77ebaf200 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Utils/CustomProperty.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/Utils/CustomProperty.ts @@ -40,7 +40,8 @@ export enum CustomPropertyTypeByName { ENUM = 'enum', SQL_QUERY = 'sqlQuery', TIMESTAMP = 'timestamp', - // TIME_INTERVAL = 'timeInterval', + ENTITY_REFERENCE = 'entityReference', + ENTITY_REFERENCE_LIST = 'entityReferenceList', } export interface CustomProperty { @@ -108,11 +109,17 @@ export const getPropertyValues = (type: string) => { value: '1710831125922', newValue: '1710831125923', }; - // case 'timeInterval': - // return { - // value: '1710831125922,1710831125923', - // newValue: '1710831125923,1710831125924', - // }; + case 'entityReference': + return { + value: 'Aaron Johnson', + newValue: 'Aaron Singh', + }; + + case 'entityReferenceList': + return { + value: 'Aaron Johnson,Organization', + newValue: 'Aaron Warren', + }; default: return { @@ -245,6 +252,20 @@ export const setValueForProperty = ( break; + case 'entityReference': + case 'entityReferenceList': { + const refValues = value.split(','); + + refValues.forEach((val) => { + cy.get('#entityReference').clear().type(`${val}`); + cy.get(`[data-testid="${val}"]`).click(); + }); + + cy.get('[data-testid="inline-save-btn"]').click(); + + break; + } + default: break; } @@ -259,6 +280,10 @@ export const setValueForProperty = ( cy.get('[data-testid="time-interval-value"]').should('contain', endValue); } else if (propertyType === 'sqlQuery') { cy.get('.CodeMirror-scroll').should('contain', value); + } else if ( + ['entityReference', 'entityReferenceList'].includes(propertyType) + ) { + // do nothing } else { cy.get(`[data-row-key="${propertyName}"]`).should( 'contain', @@ -287,6 +312,10 @@ export const validateValueForProperty = ( cy.get('[data-testid="time-interval-value"]').should('contain', endValue); } else if (propertyType === 'sqlQuery') { cy.get('.CodeMirror-scroll').should('contain', value); + } else if ( + ['entityReference', 'entityReferenceList'].includes(propertyType) + ) { + // do nothing } else { cy.get(`[data-row-key="${propertyName}"]`).should( 'contain', @@ -574,6 +603,15 @@ export const createCustomPropertyForEntity = (prop: string) => { }, } : {}), + ...(['entityReference', 'entityReferenceList'].includes( + item.name + ) + ? { + customPropertyConfig: { + config: ['user', 'team'], + }, + } + : {}), }, }) .then(({ body }) => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList.tsx index 4983cfabe32..067fc699bdd 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList.tsx @@ -144,7 +144,9 @@ const DataAssetAsyncSelectList: FC = ({ type="circle" width="24" /> - {getEntityName(option)} + + {getEntityName(option)} + ); } else {