Skip to content

Commit

Permalink
Assets filters (open-metadata#14229)
Browse files Browse the repository at this point in the history
* assets filter

* localisation

* update filters

* fix: update filters on teams page

* hide searchbar & restrict adding assets for draft

* fix: code smells

* fix: encoding decoding issues

* fix: css

* fix: add permissions check

* fix(ui): throw validation errors while modifying glossary term (open-metadata#14236)

* fix(ui): throw validation errors while modifying glossary term

* update modal layout

* fix: domain cypress

* minor update

* update modal

* fix: glossary cypress

* fix: show inline errors

* fix comments

---------

Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
  • Loading branch information
2 people authored and Shiyang Xiao committed Dec 12, 2023
1 parent 9ee634b commit 3137bf1
Show file tree
Hide file tree
Showing 47 changed files with 1,640 additions and 796 deletions.
31 changes: 12 additions & 19 deletions openmetadata-ui/src/main/resources/ui/cypress/common/DomainUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,8 @@ export const removeAssetsFromDomain = (domainObj) => {
domainObj.assets.forEach((asset, index) => {
interceptURL('GET', '/api/v1/search/query*', 'searchAssets');

cy.get(
`[data-testid="table-data-card_${asset.fullyQualifiedName}"]`
).within(() => {
cy.get('.explore-card-actions').invoke('show');
cy.get('.explore-card-actions').within(() => {
cy.get('[data-testid="delete-tag"]').click();
});
});
cy.get(`[data-testid="manage-button-${asset.fullyQualifiedName}"]`).click();
cy.get('[data-testid="delete-button"]').click();

cy.get("[data-testid='save-button']").click();

Expand All @@ -460,9 +454,13 @@ export const removeAssetsFromDomain = (domainObj) => {

export const addAssetsToDataProduct = (dataProductObj, domainObj) => {
interceptURL('GET', `/api/v1/search/query**`, 'getDataProductAssets');
interceptURL('GET', '/api/v1/dataProducts/**', 'getDataProductDetails');

goToDataProductsTab(domainObj);
cy.get(`[data-testid="explore-card-${dataProductObj.name}"]`).click();
cy.get(
`[data-testid="explore-card-${dataProductObj.name}"] [data-testid="entity-link"]`
).click();
verifyResponseStatusCode('@getDataProductDetails', 200);

cy.get('[data-testid="assets"]').should('be.visible').click();
cy.get('.ant-tabs-tab-active').contains('Assets').should('be.visible');
Expand Down Expand Up @@ -501,7 +499,9 @@ export const addAssetsToDataProduct = (dataProductObj, domainObj) => {

export const removeAssetsFromDataProduct = (dataProductObj, domainObj) => {
goToDataProductsTab(domainObj);
cy.get(`[data-testid="explore-card-${dataProductObj.name}"]`).click();
cy.get(
`[data-testid="explore-card-${dataProductObj.name}"] [data-testid="entity-link"]`
).click();

cy.get('[data-testid="assets"]').should('be.visible').click();
cy.get('.ant-tabs-tab-active').contains('Assets').should('be.visible');
Expand All @@ -510,15 +510,8 @@ export const removeAssetsFromDataProduct = (dataProductObj, domainObj) => {

dataProductObj.assets.forEach((asset, index) => {
interceptURL('GET', '/api/v1/search/query*', 'searchAssets');

cy.get(
`[data-testid="table-data-card_${asset.fullyQualifiedName}"]`
).within(() => {
cy.get('.explore-card-actions').invoke('show');
cy.get('.explore-card-actions').within(() => {
cy.get('[data-testid="delete-tag"]').click();
});
});
cy.get(`[data-testid="manage-button-${asset.fullyQualifiedName}"]`).click();
cy.get('[data-testid="delete-button"]').click();

cy.get("[data-testid='save-button']").click();

Expand Down
113 changes: 98 additions & 15 deletions openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,63 @@ export const NEW_GLOSSARY = {
name: 'Cypress Glossary',
description: 'This is the Cypress Glossary',
reviewer: 'Aaron Johnson',
tag: 'PII.None',
addReviewer: true,
tag: 'PersonalData.Personal',
};
export const NEW_GLOSSARY_1 = {
name: 'Cypress Product%Glossary',
description: 'This is the Product glossary with percentage',
reviewer: 'Brandy Miller',
addReviewer: false,
};
export const CYPRESS_ASSETS_GLOSSARY = {
name: 'Cypress Assets Glossary',
description: 'This is the Assets Cypress Glossary',
reviewer: '',
addReviewer: false,
tag: 'PII.None',
};

const COMMON_ASSETS = [
{
name: 'dim_customer',
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.dim_address',
},
{
name: 'raw_order',
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.raw_order',
},
{
name: 'presto_etl',
fullyQualifiedName: 'sample_airflow.presto_etl',
},
];

export const CYPRESS_ASSETS_GLOSSARY_TERMS = {
term_1: {
name: 'Cypress%PercentTerm',
description: 'This is the Cypress PercentTerm',
synonyms: 'buy,collect,acquire',
fullyQualifiedName: 'Cypress Assets Glossary.Cypress%PercentTerm',
assets: COMMON_ASSETS,
},
term_2: {
name: 'Cypress Space GTerm',
description: 'This is the Cypress Sales',
synonyms: 'give,disposal,deal',
fullyQualifiedName: 'Cypress Assets Glossary.Cypress Space GTerm',
assets: COMMON_ASSETS,
},
term_3: {
name: 'Cypress.Dot.GTerm',
description: 'This is the Cypress with space',
synonyms: 'tea,coffee,water',
fullyQualifiedName: 'Cypress Assets Glossary."Cypress.Dot.GTerm"',
displayFqn: 'Cypress Assets Glossary.&quot;Cypress.Dot.GTerm&quot;',
assets: COMMON_ASSETS,
},
};

export const NEW_GLOSSARY_TERMS = {
term_1: {
name: 'CypressPurchase',
Expand All @@ -332,20 +380,7 @@ export const NEW_GLOSSARY_TERMS = {
description: 'This is the Cypress with space',
synonyms: 'tea,coffee,water',
fullyQualifiedName: 'Cypress Glossary.Cypress Space',
assets: [
{
name: 'dim_customer',
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.dim_address',
},
{
name: 'raw_order',
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.raw_order',
},
{
name: 'presto_etl',
fullyQualifiedName: 'sample_airflow.presto_etl',
},
],
assets: COMMON_ASSETS,
},
};
export const GLOSSARY_TERM_WITH_DETAILS = {
Expand Down Expand Up @@ -613,3 +648,51 @@ export const DOMAIN_2 = {
},
],
};

export const DOMAIN_3 = {
name: 'Cypress Space',
updatedName: 'Cypress Space',
updatedDisplayName: 'Cypress Space',
fullyQualifiedName: 'Cypress Space',
description: 'This is the Cypress for testing domain with space creation',
experts: 'Alex Pollard',
owner: 'Alex Pollard',
domainType: 'Source-aligned',
dataProducts: [
{
name: 'Cypress%PercentDP',
description:
'This is the data product description for Cypress DataProduct Assets',
experts: 'Aaron Johnson',
owner: 'Aaron Johnson',
assets: [
{
name: 'forecast_sales_performance',
fullyQualifiedName: 'sample_superset.forecast_sales_performance',
},
{
name: 'eta_predictions',
fullyQualifiedName: 'mlflow_svc.eta_predictions',
},
{
name: 'operations_view',
fullyQualifiedName: 'sample_looker.model.operations_view',
},
],
},
],
assets: [
{
name: 'forecast_sales_performance',
fullyQualifiedName: 'sample_superset.forecast_sales_performance',
},
{
name: 'eta_predictions',
fullyQualifiedName: 'mlflow_svc.eta_predictions',
},
{
name: 'operations_view',
fullyQualifiedName: 'sample_looker.model.operations_view',
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
updateDomainDetails,
verifyDomain,
} from '../../common/DomainUtils';
import { DOMAIN_1, DOMAIN_2 } from '../../constants/constants';
import { DOMAIN_1, DOMAIN_2, DOMAIN_3 } from '../../constants/constants';

describe('Domain page should work properly', () => {
beforeEach(() => {
Expand All @@ -52,6 +52,11 @@ describe('Domain page should work properly', () => {
addAssetsToDomain(DOMAIN_2);
});

it('Add assets to domain having space using asset selection modal should work properly', () => {
createDomain(DOMAIN_3, false);
addAssetsToDomain(DOMAIN_3);
});

it('Create new data product should work properly', () => {
DOMAIN_1.dataProducts.forEach((dataProduct) => {
createDataProducts(dataProduct, DOMAIN_1);
Expand All @@ -72,6 +77,17 @@ describe('Domain page should work properly', () => {
addAssetsToDataProduct(DOMAIN_2.dataProducts[0], DOMAIN_2);
});

it('Add data product assets using asset selection modal with separate domain and dp having space', () => {
DOMAIN_3.dataProducts.forEach((dp) => {
createDataProducts(dp, DOMAIN_3);
cy.get('[data-testid="app-bar-item-domain"]')
.should('be.visible')
.click({ force: true });
});

addAssetsToDataProduct(DOMAIN_3.dataProducts[0], DOMAIN_3);
});

it('Remove data product assets using asset selection modal should work properly', () => {
removeAssetsFromDataProduct(DOMAIN_2.dataProducts[0], DOMAIN_2);
});
Expand All @@ -97,7 +113,7 @@ describe('Domain page should work properly', () => {
});

it('Delete domain flow should work properly', () => {
[DOMAIN_1, DOMAIN_2].forEach((domain) => {
[DOMAIN_1, DOMAIN_2, DOMAIN_3].forEach((domain) => {
deleteDomain(domain);
});
});
Expand Down
Loading

0 comments on commit 3137bf1

Please sign in to comment.