supported cypress for stored procedure and data models (#13312)

* supported cypress for stored procedure and data models

* fix failing cypress

* remove data model cypress
This commit is contained in:
Ashish Gupta 2023-09-25 21:53:03 +05:30 committed by GitHub
parent 749bd03fe2
commit 8b37b92ffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 343 additions and 166 deletions

View File

@ -493,7 +493,16 @@ export const visitEntityDetailsPage = (
dataTestId,
entityType
) => {
interceptURL('GET', '/api/v1/*/name/*', 'getEntityDetails');
if (entity === 'dashboardDataModel') {
interceptURL(
'GET',
'/api/v1/dashboard/datamodels/name/*',
'getEntityDetails'
);
} else {
interceptURL('GET', '/api/v1/*/name/*', 'getEntityDetails');
}
interceptURL(
'GET',
`/api/v1/search/query?q=*&index=${SEARCH_INDEX[entity]}&from=*&size=**`,

View File

@ -24,6 +24,8 @@ const DASHBOARD_NAME = `cypress_version_dashboard-${uuid()}`;
const PIPELINE_NAME = `cypress_version_pipeline-${uuid()}`;
const ML_MODEL_NAME = `cypress_version_ml_model-${uuid()}`;
const CONTAINER_NAME = `cypress_version_container-${uuid()}`;
const STORED_PROCEDURE_NAME = `cypress_version_stored_procedure-${uuid()}`;
const DATA_MODEL_NAME = `cypress_version_data_model_${uuid()}`;
const TABLE_DETAILS_FOR_VERSION_TEST = {
name: TABLE_NAME,
@ -510,90 +512,39 @@ const CONTAINER_PATCH_PAYLOAD = [
},
];
export const ENTITY_DETAILS_FOR_VERSION_TEST = {
Table: {
name: TABLE_NAME,
serviceName: 'sample_data',
entity: 'tables',
entityCreationDetails: TABLE_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: TABLE_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-row-key',
entityAddedDescription: `Description for ${TABLE_NAME}`,
updatedTagEntityChildName: 'user_id',
entityChildRemovedDescription: 'First name of the staff member.',
entityChildAddedDescription: 'Last name of the staff member.',
},
Topic: {
name: TOPIC_NAME,
serviceName: 'sample_kafka',
entity: 'topics',
entityCreationDetails: TOPIC_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: TOPIC_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-row-key',
entityAddedDescription: `Description for ${TOPIC_NAME}`,
updatedTagEntityChildName: 'default',
entityChildRemovedDescription: 'Description for schema field first_name',
entityChildAddedDescription: 'Description for schema field last_name',
},
// TODO - Remove the comment after this issue is resolved https://github.com/open-metadata/OpenMetadata/issues/12924
// Dashboard: {
// name: DASHBOARD_NAME,
// serviceName: 'sample_superset',
// entity: 'dashboards',
// entityCreationDetails: DASHBOARD_DETAILS_FOR_VERSION_TEST,
// entityPatchPayload: DASHBOARD_PATCH_PAYLOAD,
// isChildrenExist: false,
// entityAddedDescription: `Description for ${DASHBOARD_NAME}`,
// },
Pipeline: {
name: PIPELINE_NAME,
serviceName: 'sample_airflow',
entity: 'pipelines',
entityCreationDetails: PIPELINE_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: PIPELINE_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-row-key',
entityAddedDescription: `Description for ${PIPELINE_NAME}`,
updatedTagEntityChildName: 'cypress_task_1',
entityChildRemovedDescription: 'Description for task cypress_task_2',
entityChildAddedDescription: 'Description for task cypress_task_3',
},
'ML Model': {
name: ML_MODEL_NAME,
serviceName: 'mlflow_svc',
entity: 'mlmodels',
entityCreationDetails: ML_MODEL_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: ML_MODEL_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-testid',
entityAddedDescription: `Description for ${ML_MODEL_NAME}`,
updatedTagEntityChildName: 'feature-card-feature_1',
entityChildRemovedDescription: 'Description for mlFeature feature_2',
entityChildAddedDescription: 'Description for mlFeature feature_3',
},
Container: {
name: CONTAINER_NAME,
serviceName: 's3_storage_sample',
entity: 'containers',
entityCreationDetails: CONTAINER_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: CONTAINER_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-row-key',
entityAddedDescription: `Description for ${CONTAINER_NAME}`,
updatedTagEntityChildName: 'column_1',
entityChildRemovedDescription: 'Description for column column_2',
entityChildAddedDescription: 'Description for column column_3',
const STORED_PROCEDURE_DETAILS_FOR_VERSION_TEST = {
name: STORED_PROCEDURE_NAME,
databaseSchema: 'sample_data.ecommerce_db.shopify',
storedProcedureCode: {
langauge: 'SQL',
code: 'CREATE OR REPLACE PROCEDURE output_message(message VARCHAR)\nRETURNS VARCHAR NOT NULL\nLANGUAGE SQL\nAS\n$$\nBEGIN\n RETURN message;\nEND;\n$$\n;',
},
tags: [],
};
export const DATA_MODEL_NAME = `cypress_version_data_model_${uuid()}`;
const STORED_PROCEDURE_PATCH_PAYLOAD = [
{
op: 'add',
path: '/tags/0',
value: {
labelType: 'Manual',
state: 'Confirmed',
source: 'Classification',
tagFQN: 'PersonalData.SpecialCategory',
},
},
{
op: 'add',
path: '/description',
value: `Description for ${STORED_PROCEDURE_NAME}`,
},
];
export const DATA_MODEL_DETAILS_FOR_VERSION_TEST = {
name: DATA_MODEL_NAME,
service: 'sample_looker',
dataModelType: 'LookMlExplore',
tags: [],
columns: [
{
name: 'column_1',
@ -673,6 +624,96 @@ export const DATA_MODEL_PATCH_PAYLOAD = [
value: `Description for ${DATA_MODEL_NAME}`,
},
];
export const ENTITY_DETAILS_FOR_VERSION_TEST = {
Table: {
name: TABLE_NAME,
serviceName: 'sample_data',
entity: 'tables',
entityCreationDetails: TABLE_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: TABLE_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-row-key',
entityAddedDescription: `Description for ${TABLE_NAME}`,
updatedTagEntityChildName: 'user_id',
entityChildRemovedDescription: 'First name of the staff member.',
entityChildAddedDescription: 'Last name of the staff member.',
},
Topic: {
name: TOPIC_NAME,
serviceName: 'sample_kafka',
entity: 'topics',
entityCreationDetails: TOPIC_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: TOPIC_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-row-key',
entityAddedDescription: `Description for ${TOPIC_NAME}`,
updatedTagEntityChildName: 'default',
entityChildRemovedDescription: 'Description for schema field first_name',
entityChildAddedDescription: 'Description for schema field last_name',
},
// TODO - Remove the comment after this issue is resolved https://github.com/open-metadata/OpenMetadata/issues/12924
// Dashboard: {
// name: DASHBOARD_NAME,
// serviceName: 'sample_superset',
// entity: 'dashboards',
// entityCreationDetails: DASHBOARD_DETAILS_FOR_VERSION_TEST,
// entityPatchPayload: DASHBOARD_PATCH_PAYLOAD,
// isChildrenExist: false,
// entityAddedDescription: `Description for ${DASHBOARD_NAME}`,
// },
Pipeline: {
name: PIPELINE_NAME,
serviceName: 'sample_airflow',
entity: 'pipelines',
entityCreationDetails: PIPELINE_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: PIPELINE_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-row-key',
entityAddedDescription: `Description for ${PIPELINE_NAME}`,
updatedTagEntityChildName: 'cypress_task_1',
entityChildRemovedDescription: 'Description for task cypress_task_2',
entityChildAddedDescription: 'Description for task cypress_task_3',
},
'ML Model': {
name: ML_MODEL_NAME,
serviceName: 'mlflow_svc',
entity: 'mlmodels',
entityCreationDetails: ML_MODEL_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: ML_MODEL_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-testid',
entityAddedDescription: `Description for ${ML_MODEL_NAME}`,
updatedTagEntityChildName: 'feature-card-feature_1',
entityChildRemovedDescription: 'Description for mlFeature feature_2',
entityChildAddedDescription: 'Description for mlFeature feature_3',
},
Container: {
name: CONTAINER_NAME,
serviceName: 's3_storage_sample',
entity: 'containers',
entityCreationDetails: CONTAINER_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: CONTAINER_PATCH_PAYLOAD,
isChildrenExist: true,
childSelector: 'data-row-key',
entityAddedDescription: `Description for ${CONTAINER_NAME}`,
updatedTagEntityChildName: 'column_1',
entityChildRemovedDescription: 'Description for column column_2',
entityChildAddedDescription: 'Description for column column_3',
},
'Stored Procedure': {
name: STORED_PROCEDURE_NAME,
serviceName: 'sample_data',
entity: 'storedProcedures',
entityCreationDetails: STORED_PROCEDURE_DETAILS_FOR_VERSION_TEST,
entityPatchPayload: STORED_PROCEDURE_PATCH_PAYLOAD,
isChildrenExist: false,
childSelector: 'data-row-key',
entityAddedDescription: `Description for ${STORED_PROCEDURE_NAME}`,
updatedTagEntityChildName: '',
entityChildRemovedDescription: '',
entityChildAddedDescription: '',
},
};
export const DATA_MODEL_DETAILS = {
name: DATA_MODEL_NAME,

View File

@ -32,6 +32,8 @@ export const MYDATA_SUMMARY_OPTIONS = {
containers: 'containers',
glossaryTerms: 'glossary-terms',
tags: 'tags',
storedProcedures: 'storedProcedures',
dataModel: 'dashboardDataModel',
};
export const SEARCH_INDEX = {
@ -156,6 +158,38 @@ export const SEARCH_ENTITY_MLMODEL = {
},
};
export const SEARCH_ENTITY_STORED_PROCEDURE = {
stored_procedure_1: {
term: 'update_dim_address_table',
entity: MYDATA_SUMMARY_OPTIONS.storedProcedures,
serviceName: 'sample_data',
entityType: 'Stored Procedure',
},
stored_procedure_2: {
term: 'update_dim_address_table',
entity: MYDATA_SUMMARY_OPTIONS.storedProcedures,
serviceName: 'sample_data',
displayName: 'update_dim_address_table',
entityType: 'Stored Procedure',
},
};
export const SEARCH_ENTITY_DATA_MODEL = {
data_model_1: {
term: 'operations_view',
entity: MYDATA_SUMMARY_OPTIONS.dataModel,
serviceName: 'sample_looker',
entityType: 'Data Model',
},
data_model_2: {
term: 'orders_view',
entity: MYDATA_SUMMARY_OPTIONS.dataModel,
serviceName: 'sample_looker',
displayName: 'Orders View',
entityType: 'Data Model',
},
};
export const DELETE_ENTITY = {
table: {
term: 'dim.shop',
@ -323,6 +357,7 @@ export const SERVICE_TYPE = {
Pipeline: 'Pipeline',
MLModels: 'ML Models',
Storage: 'Storage',
StoredProcedure: 'StoredProcedure',
};
export const ENTITIES = {

View File

@ -58,4 +58,20 @@ export const TAGS_ADD_REMOVE_ENTITIES = [
tags: ['PersonalData.Personal', 'PII.Sensitive'],
permissionApi: '/api/v1/permissions/*/*',
},
{
term: 'update_orders_table',
displayName: 'update_orders_table',
entity: 'storedProcedures',
serviceName: 'sample_data',
tags: ['PersonalData.Personal', 'PII.Sensitive'],
permissionApi: '/api/v1/permissions/*/name/*',
},
{
term: 'orders_view',
displayName: 'orders_view',
entity: 'dashboardDataModel',
serviceName: 'sample_looker',
tags: ['PersonalData.Personal', 'PII.Sensitive'],
permissionApi: '/api/v1/permissions/*/name/*',
},
];

View File

@ -106,6 +106,18 @@ export const ENTITIES_DISPLAY_NAME = {
serviceName: SERVICES.storageServices.name,
breadcrumb: [SERVICES.storageServices.displayName],
},
storedProcedure: {
name: 'update_dim_address_table',
oldDisplayName: 'update_dim_address_table',
displayName: 'Update_Dim_Address_Table',
entity: MYDATA_SUMMARY_OPTIONS.storedProcedures,
serviceName: 'sample_data',
breadcrumb: [
DATABASE_AND_SCHEMA.schemaDisplayName,
DATABASE_AND_SCHEMA.databaseDisplayName,
SERVICES.databaseServices.displayName,
],
},
};
export const DASHBOARD_DATA_MODEL = {
service: SERVICES.dashboardServices,

View File

@ -53,4 +53,18 @@ export const VOTING_ENTITIES = [
fieldName: 'sales',
permissionApi: '/api/v1/permissions/*/*',
},
{
term: 'update_orders_table',
displayName: 'update_orders_table',
entity: 'storedProcedures',
serviceName: 'sample_data',
permissionApi: '/api/v1/permissions/*/name/*',
},
{
term: 'orders_view',
displayName: 'orders_view',
entity: 'dashboardDataModel',
serviceName: 'sample_looker',
permissionApi: '/api/v1/permissions/*/name/*',
},
];

View File

@ -17,8 +17,10 @@ import {
} from '../../common/common';
import {
SEARCH_ENTITY_DASHBOARD,
SEARCH_ENTITY_DATA_MODEL,
SEARCH_ENTITY_MLMODEL,
SEARCH_ENTITY_PIPELINE,
SEARCH_ENTITY_STORED_PROCEDURE,
SEARCH_ENTITY_TABLE,
SEARCH_ENTITY_TOPIC,
} from '../../constants/constants';
@ -33,11 +35,29 @@ const FOLLOWING_ENTITIES = [
SEARCH_ENTITY_TOPIC.topic_1,
SEARCH_ENTITY_PIPELINE.pipeline_1,
SEARCH_ENTITY_MLMODEL.mlmodel_2,
SEARCH_ENTITY_STORED_PROCEDURE.stored_procedure_2,
SEARCH_ENTITY_DATA_MODEL.data_model_2,
];
const followEntity = ({ term, serviceName, entity }, isUnfollow) => {
visitEntityDetailsPage(term, serviceName, entity);
if (entity === 'dashboardDataModel') {
interceptURL(
isUnfollow ? 'DELETE' : 'PUT',
isUnfollow
? '/api/v1/dashboard/datamodels/*/followers/*'
: '/api/v1/dashboard/datamodels/*/followers',
'waitAfterFollow'
);
} else {
interceptURL(
isUnfollow ? 'DELETE' : 'PUT',
isUnfollow ? '/api/v1/*/*/followers/*' : '/api/v1/*/*/followers',
'waitAfterFollow'
);
}
interceptURL(
isUnfollow ? 'DELETE' : 'PUT',
isUnfollow ? '/api/v1/*/*/followers/*' : '/api/v1/*/*/followers',

View File

@ -19,6 +19,7 @@ import {
SEARCH_ENTITY_DASHBOARD,
SEARCH_ENTITY_MLMODEL,
SEARCH_ENTITY_PIPELINE,
SEARCH_ENTITY_STORED_PROCEDURE,
SEARCH_ENTITY_TABLE,
SEARCH_ENTITY_TOPIC,
} from '../../constants/constants';
@ -33,6 +34,7 @@ const RECENTLY_VIEW_ENTITIES = [
SEARCH_ENTITY_TOPIC.topic_1,
SEARCH_ENTITY_PIPELINE.pipeline_1,
SEARCH_ENTITY_MLMODEL.mlmodel_2,
SEARCH_ENTITY_STORED_PROCEDURE.stored_procedure_2,
];
describe('Recently viwed data assets', () => {

View File

@ -26,6 +26,7 @@ import {
DELETE_TERM,
SEARCH_ENTITY_MLMODEL,
SEARCH_ENTITY_PIPELINE,
SEARCH_ENTITY_STORED_PROCEDURE,
SEARCH_ENTITY_TOPIC,
} from '../../constants/constants';
@ -39,6 +40,7 @@ const ENTITIES = {
// dashboard: SEARCH_ENTITY_DASHBOARD.dashboard_2,
pipeline: SEARCH_ENTITY_PIPELINE.pipeline_2,
mlmodel: SEARCH_ENTITY_MLMODEL.mlmodel_2,
storedProcedure: SEARCH_ENTITY_STORED_PROCEDURE.stored_procedure_2,
};
const glossary = 'GlossaryOwnerTest';
const glossaryTerm = 'GlossaryTermOwnerTest';

View File

@ -16,7 +16,7 @@ import {
verifyResponseStatusCode,
visitEntityDetailsPage,
} from '../../common/common';
import { VOTING_ENTITIES } from '../../constants/version.constant';
import { VOTING_ENTITIES } from '../../constants/voting.constant';
describe('Check if voting work properly in entities', () => {
beforeEach(() => {
@ -24,15 +24,20 @@ describe('Check if voting work properly in entities', () => {
});
VOTING_ENTITIES.map((entityDetails) => {
const apiEntity =
entityDetails.entity === 'dashboardDataModel'
? 'dashboard/datamodels'
: entityDetails.entity;
it(`UpVote the ${entityDetails.entity} entity`, () => {
interceptURL('GET', entityDetails.permissionApi, 'getEntityPermission');
interceptURL(
'GET',
`/api/v1/${entityDetails.entity}/name/*?fields=*`,
`/api/v1/${apiEntity}/name/*?fields=*`,
'getEntityDetail'
);
interceptURL('PUT', `/api/v1/${entityDetails.entity}/*/vote`, 'upVoting');
interceptURL('PUT', `/api/v1/${apiEntity}/*/vote`, 'upVoting');
visitEntityDetailsPage(
entityDetails.term,
@ -55,19 +60,20 @@ describe('Check if voting work properly in entities', () => {
});
VOTING_ENTITIES.map((entityDetails) => {
const apiEntity =
entityDetails.entity === 'dashboardDataModel'
? 'dashboard/datamodels'
: entityDetails.entity;
it(`DownVote the ${entityDetails.entity} entity`, () => {
interceptURL('GET', entityDetails.permissionApi, 'getEntityPermission');
interceptURL(
'GET',
`/api/v1/${entityDetails.entity}/name/*?fields=*`,
`/api/v1/${apiEntity}/name/*?fields=*`,
'getEntityDetail'
);
interceptURL(
'PUT',
`/api/v1/${entityDetails.entity}/*/vote`,
'downVoting'
);
interceptURL('PUT', `/api/v1/${apiEntity}/*/vote`, 'downVoting');
visitEntityDetailsPage(
entityDetails.term,
@ -93,15 +99,20 @@ describe('Check if voting work properly in entities', () => {
});
VOTING_ENTITIES.map((entityDetails) => {
const apiEntity =
entityDetails.entity === 'dashboardDataModel'
? 'dashboard/datamodels'
: entityDetails.entity;
it(`UnVote the ${entityDetails.entity} entity`, () => {
interceptURL('GET', entityDetails.permissionApi, 'getEntityPermission');
interceptURL(
'GET',
`/api/v1/${entityDetails.entity}/name/*?fields=*`,
`/api/v1/${apiEntity}/name/*?fields=*`,
'getEntityDetail'
);
interceptURL('PUT', `/api/v1/${entityDetails.entity}/*/vote`, 'unVoting');
interceptURL('PUT', `/api/v1/${apiEntity}/*/vote`, 'unVoting');
visitEntityDetailsPage(
entityDetails.term,

View File

@ -31,7 +31,7 @@ const addTags = (tag) => {
cy.get('[data-testid="tag-selector"] > .ant-select-selector').contains(tag);
};
const verifyTagFilter = ({ entity, tag }) => {
if (entity !== 'mlmodels') {
if (!['mlmodels', 'dashboardDataModel'].includes(entity)) {
let columnLength = 0;
cy.get('.ant-table-tbody')
.find('tr')
@ -108,24 +108,29 @@ describe('Check if tags addition and removal flow working properly from tables',
});
TAGS_ADD_REMOVE_ENTITIES.map((entityDetails) => {
const apiEntity =
entityDetails.entity === 'dashboardDataModel'
? 'dashboard/datamodels'
: entityDetails.entity;
it(`Adding & removing tags to the ${entityDetails.entity} entity`, () => {
interceptURL('GET', entityDetails.permissionApi, 'getEntityPermission');
interceptURL(
'GET',
`/api/v1/${entityDetails.entity}/name/*?fields=*`,
`/api/v1/${apiEntity}/name/*?fields=*`,
'getEntityDetail'
);
interceptURL('PATCH', `/api/v1/${entityDetails.entity}/*`, 'tagsChange');
interceptURL('PATCH', `/api/v1/${apiEntity}/*`, 'tagsChange');
interceptURL(
'PATCH',
`/api/v1/${entityDetails.insideEntity ?? entityDetails.entity}/*`,
`/api/v1/${entityDetails.insideEntity ?? apiEntity}/*`,
'tagsChange'
);
visitEntityDetailsPage(
entityDetails.term,
entityDetails.serviceName,
entityDetails.entity
apiEntity
);
verifyResponseStatusCode('@getEntityDetail', 200);
verifyResponseStatusCode('@getEntityPermission', 200);
@ -156,85 +161,87 @@ describe('Check if tags addition and removal flow working properly from tables',
});
it(`Adding & removing tags to the ${entityDetails.entity} entity schema table`, () => {
interceptURL(
'GET',
`/api/v1/${entityDetails.entity}/name/*?fields=*`,
'getEntityDetail'
);
interceptURL('GET', entityDetails.permissionApi, 'getEntityPermission');
interceptURL('PATCH', `/api/v1/${entityDetails.entity}/*`, 'tagsChange');
interceptURL(
'PATCH',
`/api/v1/${entityDetails.insideEntity ?? entityDetails.entity}/*`,
'tagsChange'
);
if (entityDetails.insideEntity) {
if (entityDetails.entity !== 'storedProcedures') {
interceptURL(
'GET',
`/api/v1/${entityDetails.insideEntity}/*`,
'getInsideColumn'
`/api/v1/${apiEntity}/name/*?fields=*`,
'getEntityDetail'
);
interceptURL('GET', entityDetails.permissionApi, 'getEntityPermission');
interceptURL('PATCH', `/api/v1/${apiEntity}/*`, 'tagsChange');
interceptURL(
'GET',
`/api/v1/permissions/chart/*`,
'getInsideColumnPermission'
'PATCH',
`/api/v1/${entityDetails.insideEntity ?? apiEntity}/*`,
'tagsChange'
);
}
visitEntityDetailsPage(
entityDetails.term,
entityDetails.serviceName,
entityDetails.entity
);
verifyResponseStatusCode('@getEntityDetail', 200);
verifyResponseStatusCode('@getEntityPermission', 200);
if (entityDetails.insideEntity) {
verifyResponseStatusCode('@getInsideColumn', 200);
verifyResponseStatusCode('@getInsideColumnPermission', 200);
}
if (entityDetails.entity === 'mlmodels') {
cy.get(
`[data-testid="feature-card-${entityDetails.fieldName}"] [data-testid="classification-tags-0"]`
).then(($container) => {
if ($container.find('[data-testid="add-tag"]').length === 0) {
removeTags(false);
}
cy.get(
`[data-testid="feature-card-${entityDetails.fieldName}"] [data-testid="classification-tags-0"] [data-testid="add-tag"]`
).click();
});
} else {
if (entityDetails.entity === 'topics') {
cy.get('[id*=panel-schema]').contains('Collapse All').click();
if (entityDetails.insideEntity) {
interceptURL(
'GET',
`/api/v1/${entityDetails.insideEntity}/*`,
'getInsideColumn'
);
interceptURL(
'GET',
`/api/v1/permissions/chart/*`,
'getInsideColumnPermission'
);
}
cy.get(
'.ant-table-tbody [data-testid="classification-tags-0"] [data-testid="tags-container"]'
).then(($container) => {
if ($container.find('[data-testid="add-tag"]').length === 0) {
removeTags(false);
visitEntityDetailsPage(
entityDetails.term,
entityDetails.serviceName,
apiEntity
);
verifyResponseStatusCode('@getEntityDetail', 200);
verifyResponseStatusCode('@getEntityPermission', 200);
if (entityDetails.insideEntity) {
verifyResponseStatusCode('@getInsideColumn', 200);
verifyResponseStatusCode('@getInsideColumnPermission', 200);
}
if (entityDetails.entity === 'mlmodels') {
cy.get(
`[data-testid="feature-card-${entityDetails.fieldName}"] [data-testid="classification-tags-0"]`
).then(($container) => {
if ($container.find('[data-testid="add-tag"]').length === 0) {
removeTags(false);
}
cy.get(
`[data-testid="feature-card-${entityDetails.fieldName}"] [data-testid="classification-tags-0"] [data-testid="add-tag"]`
).click();
});
} else {
if (entityDetails.entity === 'topics') {
cy.get('[id*=panel-schema]').contains('Collapse All').click();
}
cy.get(
'.ant-table-tbody [data-testid="classification-tags-0"] [data-testid="tags-container"] [data-testid="add-tag"]'
).click();
'.ant-table-tbody [data-testid="classification-tags-0"] [data-testid="tags-container"]'
).then(($container) => {
if ($container.find('[data-testid="add-tag"]').length === 0) {
removeTags(false);
}
cy.get(
'.ant-table-tbody [data-testid="classification-tags-0"] [data-testid="tags-container"] [data-testid="add-tag"]'
).click();
});
}
entityDetails.tags.map((tag) => addTags(tag));
cy.clickOutside();
cy.get('[data-testid="saveAssociatedTag"]')
.scrollIntoView()
.should('be.visible')
.click();
verifyResponseStatusCode('@tagsChange', 200);
entityDetails.tags.map((tag) => checkTags(tag));
verifyTagFilter({
entity: entityDetails.entity,
tag: entityDetails.tags[0],
});
removeTags(false, entityDetails.separate);
}
entityDetails.tags.map((tag) => addTags(tag));
cy.clickOutside();
cy.get('[data-testid="saveAssociatedTag"]')
.scrollIntoView()
.should('be.visible')
.click();
verifyResponseStatusCode('@tagsChange', 200);
entityDetails.tags.map((tag) => checkTags(tag));
verifyTagFilter({
entity: entityDetails.entity,
tag: entityDetails.tags[0],
});
removeTags(false, entityDetails.separate);
});
});
});

View File

@ -160,7 +160,13 @@ const StoredProcedureVersion = ({
),
},
],
[description, storedProcedureFQN, currentVersionData, entityPermissions]
[
tags,
description,
storedProcedureFQN,
currentVersionData,
entityPermissions,
]
);
return (

View File

@ -94,7 +94,7 @@ const DataModelsPage = () => {
setIsLoading(true);
try {
const entityPermission = await getEntityPermissionByFqn(
ResourceEntity.CONTAINER,
ResourceEntity.DASHBOARD_DATA_MODEL,
dashboardDataModelFQN
);
setDataModelPermissions(entityPermission);

View File

@ -61,11 +61,13 @@ export const getDataModelsByName = async (
export const getDataModelDetailsByFQN = async (
databaseSchemaName: string,
arrQueryFields?: string | string[]
arrQueryFields?: string | string[],
include = Include.All
) => {
const url = `${getURLWithQueryFields(
`${URL}/name/${databaseSchemaName}`,
arrQueryFields
arrQueryFields,
`include=${include}`
)}`;
const response = await APIClient.get<DashboardDataModel>(url);