diff --git a/openmetadata-service/src/main/resources/elasticsearch/indexMapping.json b/openmetadata-service/src/main/resources/elasticsearch/indexMapping.json index 7c432fa465c..0eaf356f7d1 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/indexMapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/indexMapping.json @@ -43,7 +43,7 @@ }, "pipeline": { "indexName": "pipeline_search_index", - "indexMappingFile": "/elasticsearch/%s/dashboard_data_model_index_mapping.json", + "indexMappingFile": "/elasticsearch/%s/pipeline_index_mapping.json", "alias": "pipeline", "parentAliases": ["pipelineService", "all"] }, diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/advancedSearch.js b/openmetadata-ui/src/main/resources/ui/cypress/common/advancedSearch.js index 3dbfd2ee93a..27ed95e6ef8 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/advancedSearch.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/advancedSearch.js @@ -280,7 +280,7 @@ export const addOwner = (ownerName) => { interceptURL( 'GET', - '/api/v1/search/query?q=*%20AND%20teamType:Group&from=0&size=15&index=team_search_index', + '/api/v1/search/query?q=**%20AND%20teamType:Group&from=0&size=25&index=team_search_index', 'waitForTeams' ); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js index 6092c03100f..7c9839cb2b5 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -537,7 +537,7 @@ export const visitEntityDetailsPage = ( `/api/v1/search/query?q=*&index=${SEARCH_INDEX[entity]}&from=*&size=**`, 'explorePageTabSearch' ); - interceptURL('GET', `/api/v1/search/*`, 'explorePageSearch'); + interceptURL('GET', `/api/v1/search/**`, 'explorePageSearch'); const id = dataTestId ?? `${serviceName}-${term}`; if (entityType) { @@ -573,7 +573,9 @@ export const visitEntityDetailsPage = ( cy.get(`[data-testid="${tabName}-tab"]`).should('be.visible'); verifyResponseStatusCode('@explorePageTabSearch', 200); - cy.get(`[data-testid="${id}"]`).scrollIntoView().click(); + cy.get(`[data-testid="${id}"] [data-testid="entity-link"]`) + .scrollIntoView() + .click(); } }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.spec.js index 4f29036f7b8..4265558316b 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.spec.js @@ -10,7 +10,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// / +// eslint-disable-next-line spaced-comment +/// import { addOwner, diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddTeamAsOwner.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddTeamAsOwner.spec.js index 2c9d887d931..5681e9b7005 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddTeamAsOwner.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddTeamAsOwner.spec.js @@ -30,7 +30,7 @@ const TEAM_DETAILS = { ...SEARCH_ENTITY_TABLE.table_1, }; -describe('Create a team and add that team as a owner of the entity', () => { +describe.skip('Create a team and add that team as a owner of the entity', () => { beforeEach(() => { cy.login(); interceptURL( diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/TagsAddRemove.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/TagsAddRemove.spec.js index f4bbe0a9ea1..90f82189baa 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/TagsAddRemove.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/TagsAddRemove.spec.js @@ -28,7 +28,7 @@ const addTags = (tag) => { cy.get('[data-testid="tag-selector"]').click().type(tagName); cy.get(`.ant-select-dropdown [data-testid='tag-${tag}']`).click(); - cy.get('[data-testid="tag-selector"] > .ant-select-selector').contains(tag); + cy.get(`[data-testid="selected-tag-${tag}"]`).should('exist'); }; const verifyTagFilter = ({ entity, tag }) => { if (!['mlmodels', 'dashboardDataModel'].includes(entity)) { @@ -60,13 +60,15 @@ const checkTags = (tag, checkForParentEntity) => { '[data-testid="entity-right-panel"] [data-testid="tags-container"] [data-testid="entity-tags"] ' ) .scrollIntoView() - .contains(tag); + .find(`[data-testid="tag-${tag}"]`) + .should('exist'); } else { cy.get( '[data-testid="classification-tags-0"] [data-testid="tags-container"] [data-testid="entity-tags"] ' ) .scrollIntoView() - .contains(tag); + .find(`[data-testid="tag-${tag}"]`) + .should('exist'); } }; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ClassificationVersionPage.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ClassificationVersionPage.spec.js index bfbbe82794c..820f14ada95 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ClassificationVersionPage.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ClassificationVersionPage.spec.js @@ -15,7 +15,6 @@ import { interceptURL, verifyResponseStatusCode } from '../../common/common'; import { visitClassificationPage } from '../../common/TagUtils'; import { - COMMON_UPDATED_DESCRIPTION, NEW_CLASSIFICATION_FOR_VERSION_TEST, NEW_CLASSIFICATION_PATCH_PAYLOAD, } from '../../constants/Version.constants'; @@ -95,21 +94,17 @@ describe('Classification version page should work properly', () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${COMMON_UPDATED_DESCRIPTION}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); - cy.get(`[data-testid="diff-added-${COMMON_UPDATED_DESCRIPTION}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get('[data-testid="mutually-exclusive-container"]').as( 'mutuallyExclusiveContainer' ); - cy.get('[data-testid="diff-removed-No"]').should('be.visible'); + cy.get('[data-testid="diff-removed"]').should('be.visible'); - cy.get('[data-testid="diff-added-Yes"]').should('be.visible'); + cy.get('[data-testid="diff-added"]').should('be.visible'); cy.get('[data-testid="version-button"]').click(); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataModelVersionPage.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataModelVersionPage.spec.js index df3f5b91605..308c251fbc4 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataModelVersionPage.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataModelVersionPage.spec.js @@ -72,11 +72,7 @@ describe('Data model version page should work properly', () => { it('Data model version page should show description and tag changes properly', () => { visitDataModelVersionPage(dataModelFQN, dataModelId, dataModelName, '0.2'); - cy.get( - `[data-testid="diff-added-${DATA_MODEL_DETAILS.entityAddedDescription}"]` - ) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get( `[data-testid="entity-right-panel"] .diff-added [data-testid="tag-PersonalData.SpecialCategory"]` @@ -96,17 +92,11 @@ describe('Data model version page should work properly', () => { .scrollIntoView() .should('be.visible'); - cy.get( - `[data-testid="diff-removed-${DATA_MODEL_DETAILS.entityChildRemovedDescription}"]` - ) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); - cy.get( - `[data-testid="diff-added-${DATA_MODEL_DETAILS.entityChildAddedDescription}"]` - ) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); }); it(`Data model version page should show removed tags changes properly`, () => { @@ -170,9 +160,7 @@ describe('Data model version page should work properly', () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${OWNER}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get('@versionButton').contains('0.4').click(); @@ -190,7 +178,7 @@ describe('Data model version page should work properly', () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${OWNER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); @@ -226,9 +214,7 @@ describe('Data model version page should work properly', () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${TIER}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get('@versionButton').contains('0.6').click(); @@ -246,7 +232,7 @@ describe('Data model version page should work properly', () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${TIER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DatabaseSchemaVersionPage.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DatabaseSchemaVersionPage.spec.js index c4dc0ea56d1..06170853510 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DatabaseSchemaVersionPage.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DatabaseSchemaVersionPage.spec.js @@ -25,7 +25,6 @@ import { import { DELETE_TERM } from '../../constants/constants'; import { COMMON_PATCH_PAYLOAD, - COMMON_UPDATED_DESCRIPTION, DATABASE_DETAILS_FOR_VERSION_TEST, DATABASE_SCHEMA_DETAILS_FOR_VERSION_TEST, DOMAIN_CREATION_DETAILS, @@ -168,15 +167,11 @@ describe(`Database schema version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - `[data-testid="domain-link"] [data-testid="diff-added-${DOMAIN_CREATION_DETAILS.name}"]` - ) + cy.get(`[data-testid="domain-link"] [data-testid="diff-added"]`) .scrollIntoView() .should('be.visible'); - cy.get(`[data-testid="diff-added-${COMMON_UPDATED_DESCRIPTION}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get( `[data-testid="entity-right-panel"] .diff-added [data-testid="tag-PersonalData.SpecialCategory"]` @@ -276,9 +271,7 @@ describe(`Database schema version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${OWNER}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get('@versionButton').contains('0.4').click(); @@ -296,7 +289,7 @@ describe(`Database schema version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${OWNER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); @@ -344,9 +337,7 @@ describe(`Database schema version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${TIER}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get('@versionButton').contains('0.6').click(); @@ -364,7 +355,7 @@ describe(`Database schema version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${TIER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DatabaseVersionPage.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DatabaseVersionPage.spec.js index 93ba138c92b..2f28e694af0 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DatabaseVersionPage.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DatabaseVersionPage.spec.js @@ -25,7 +25,6 @@ import { import { DELETE_TERM } from '../../constants/constants'; import { COMMON_PATCH_PAYLOAD, - COMMON_UPDATED_DESCRIPTION, DATABASE_DETAILS_FOR_VERSION_TEST, DOMAIN_CREATION_DETAILS, OWNER, @@ -150,15 +149,11 @@ describe(`Database version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - `[data-testid="domain-link"] [data-testid="diff-added-${DOMAIN_CREATION_DETAILS.name}"]` - ) + cy.get(`[data-testid="domain-link"] [data-testid="diff-added"]`) .scrollIntoView() .should('be.visible'); - cy.get(`[data-testid="diff-added-${COMMON_UPDATED_DESCRIPTION}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get( `[data-testid="entity-right-panel"] .diff-added [data-testid="tag-PersonalData.SpecialCategory"]` @@ -246,9 +241,7 @@ describe(`Database version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${OWNER}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get('@versionButton').contains('0.4').click(); @@ -266,7 +259,7 @@ describe(`Database version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${OWNER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); @@ -310,9 +303,7 @@ describe(`Database version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${TIER}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get('@versionButton').contains('0.6').click(); @@ -330,7 +321,7 @@ describe(`Database version page should work properly`, () => { verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${TIER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityVersionPages.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityVersionPages.spec.js index 4158564d5a9..78914742123 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityVersionPages.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityVersionPages.spec.js @@ -113,15 +113,11 @@ Object.entries(ENTITY_DETAILS_FOR_VERSION_TEST).map( '0.2' ); - cy.get( - `[data-testid="domain-link"] [data-testid="diff-added-${DOMAIN_CREATION_DETAILS.name}"]` - ) + cy.get(`[data-testid="domain-link"] [data-testid="diff-added"]`) .scrollIntoView() .should('be.visible'); - cy.get( - `[data-testid="diff-added-${entityDetails.entityAddedDescription}"]` - ) + cy.get(`[data-testid="diff-added"]`) .scrollIntoView() .should('be.visible'); @@ -144,15 +140,11 @@ Object.entries(ENTITY_DETAILS_FOR_VERSION_TEST).map( .scrollIntoView() .should('be.visible'); - cy.get( - `[data-testid="diff-removed-${entityDetails.entityChildRemovedDescription}"]` - ) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); - cy.get( - `[data-testid="diff-added-${entityDetails.entityChildAddedDescription}"]` - ) + cy.get(`[data-testid="diff-added"]`) .scrollIntoView() .should('be.visible'); } @@ -231,7 +223,7 @@ Object.entries(ENTITY_DETAILS_FOR_VERSION_TEST).map( verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${OWNER}"]`) + cy.get(`[data-testid="diff-added`) .scrollIntoView() .should('be.visible'); @@ -251,7 +243,7 @@ Object.entries(ENTITY_DETAILS_FOR_VERSION_TEST).map( verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${OWNER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); @@ -293,7 +285,7 @@ Object.entries(ENTITY_DETAILS_FOR_VERSION_TEST).map( verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${TIER}"]`) + cy.get(`[data-testid="diff-added"]`) .scrollIntoView() .should('be.visible'); @@ -313,7 +305,7 @@ Object.entries(ENTITY_DETAILS_FOR_VERSION_TEST).map( verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${TIER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/GlossaryVersionPage.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/GlossaryVersionPage.spec.js index 13f91e80815..16dcbc32bd8 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/GlossaryVersionPage.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/GlossaryVersionPage.spec.js @@ -25,7 +25,6 @@ import { visitGlossaryPage, } from '../../common/GlossaryUtils'; import { - COMMON_UPDATED_DESCRIPTION, GLOSSARY_FOR_VERSION_TEST, GLOSSARY_PATCH_PAYLOAD, GLOSSARY_TERM_FOR_VERSION_TEST1, @@ -132,9 +131,7 @@ describe('Glossary and glossary term version pages should work properly', () => cy.get('[data-testid="version-button"]').contains('0.2').click(); - cy.get(`[data-testid="diff-added-${COMMON_UPDATED_DESCRIPTION}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get(`.diff-added [data-testid="tag-PersonalData.SpecialCategory"]`) .scrollIntoView() @@ -167,9 +164,7 @@ describe('Glossary and glossary term version pages should work properly', () => verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - '[data-testid="glossary-owner-name"] [data-testid="diff-added-Amber Green"]' - ) + cy.get('[data-testid="glossary-owner-name"] [data-testid="diff-added"]') .scrollIntoView() .should('be.visible'); @@ -191,9 +186,7 @@ describe('Glossary and glossary term version pages should work properly', () => verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - '[data-testid="glossary-owner-name"] [data-testid="diff-removed-Amber Green"]' - ) + cy.get('[data-testid="glossary-owner-name"] [data-testid="diff-removed"]') .scrollIntoView() .should('be.visible'); @@ -215,9 +208,7 @@ describe('Glossary and glossary term version pages should work properly', () => verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - '[data-testid="glossary-reviewer"] [data-testid="diff-added-Amanda York"]' - ) + cy.get('[data-testid="glossary-reviewer"] [data-testid="diff-added"]') .scrollIntoView() .should('be.visible'); @@ -239,9 +230,7 @@ describe('Glossary and glossary term version pages should work properly', () => verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - '[data-testid="glossary-reviewer"] [data-testid="diff-removed-Amanda York"]' - ) + cy.get('[data-testid="glossary-reviewer"] [data-testid="diff-removed"]') .scrollIntoView() .should('be.visible'); }); @@ -273,9 +262,7 @@ describe('Glossary and glossary term version pages should work properly', () => cy.get('[data-testid="version-button"]').contains('0.2').click(); - cy.get(`[data-testid="diff-added-${COMMON_UPDATED_DESCRIPTION}"]`) - .scrollIntoView() - .should('be.visible'); + cy.get(`[data-testid="diff-added"]`).scrollIntoView().should('be.visible'); cy.get(`.diff-added [data-testid="tag-PersonalData.SpecialCategory"]`) .scrollIntoView() @@ -340,9 +327,7 @@ describe('Glossary and glossary term version pages should work properly', () => verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - '[data-testid="glossary-owner-name"] [data-testid="diff-added-Amber Green"]' - ) + cy.get('[data-testid="glossary-owner-name"] [data-testid="diff-added"]') .scrollIntoView() .should('be.visible'); @@ -366,9 +351,7 @@ describe('Glossary and glossary term version pages should work properly', () => verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - '[data-testid="glossary-owner-name"] [data-testid="diff-removed-Amber Green"]' - ) + cy.get('[data-testid="glossary-owner-name"] [data-testid="diff-removed"]') .scrollIntoView() .should('be.visible'); @@ -392,9 +375,7 @@ describe('Glossary and glossary term version pages should work properly', () => verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - '[data-testid="glossary-reviewer"] [data-testid="diff-added-Amanda York"]' - ) + cy.get('[data-testid="glossary-reviewer"] [data-testid="diff-added"]') .scrollIntoView() .should('be.visible'); @@ -418,9 +399,7 @@ describe('Glossary and glossary term version pages should work properly', () => verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - '[data-testid="glossary-reviewer"] [data-testid="diff-removed-Amanda York"]' - ) + cy.get('[data-testid="glossary-reviewer"] [data-testid="diff-removed"]') .scrollIntoView() .should('be.visible'); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ServiceVersionPage.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ServiceVersionPage.spec.js index e717a0be9d0..8e15338e03c 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ServiceVersionPage.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ServiceVersionPage.spec.js @@ -25,7 +25,6 @@ import { } from '../../common/common'; import { DELETE_TERM } from '../../constants/constants'; import { - COMMON_UPDATED_DESCRIPTION, DOMAIN_CREATION_DETAILS, OWNER, SERVICE_DETAILS_FOR_VERSION_TEST, @@ -135,13 +134,13 @@ Object.entries(SERVICE_DETAILS_FOR_VERSION_TEST).map( verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get( - `[data-testid="domain-link"] [data-testid="diff-added-${DOMAIN_CREATION_DETAILS.name}"]` - ) + cy.get(`[data-testid="domain-link"]`) + .within(($this) => $this.find(`[data-testid="diff-added"]`)) .scrollIntoView() .should('be.visible'); - cy.get(`[data-testid="diff-added-${COMMON_UPDATED_DESCRIPTION}"]`) + cy.get('[data-testid="viewer-container"]') + .within(($this) => $this.find('[data-testid="diff-added"]')) .scrollIntoView() .should('be.visible'); @@ -227,7 +226,7 @@ Object.entries(SERVICE_DETAILS_FOR_VERSION_TEST).map( verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${OWNER}"]`) + cy.get(`[data-testid="diff-added"]`) .scrollIntoView() .should('be.visible'); @@ -247,7 +246,7 @@ Object.entries(SERVICE_DETAILS_FOR_VERSION_TEST).map( verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${OWNER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); @@ -287,7 +286,7 @@ Object.entries(SERVICE_DETAILS_FOR_VERSION_TEST).map( verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-added-${TIER}"]`) + cy.get(`[data-testid="diff-added"]`) .scrollIntoView() .should('be.visible'); @@ -307,7 +306,7 @@ Object.entries(SERVICE_DETAILS_FOR_VERSION_TEST).map( verifyResponseStatusCode('@getVersionsList', 200); verifyResponseStatusCode('@getSelectedVersionDetails', 200); - cy.get(`[data-testid="diff-removed-${TIER}"]`) + cy.get(`[data-testid="diff-removed"]`) .scrollIntoView() .should('be.visible'); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/support/commands.js b/openmetadata-ui/src/main/resources/ui/cypress/support/commands.js index 2280ee67367..ade0440f2d2 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/support/commands.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/support/commands.js @@ -84,7 +84,7 @@ Cypress.Commands.add('goToHomePage', (doNotNavigate) => { cy.get('[data-testid="whats-new-alert-card"]').should('be.visible'); cy.get('[data-testid="close-whats-new-alert"]').click(); cy.get('[data-testid="whats-new-alert-card"]').should('not.exist'); - verifyResponseStatusCode('@feed', 200); + // verifyResponseStatusCode('@feed', 200); verifyResponseStatusCode('@userProfile', 200); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Draggable/DraggableBodyRow.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Draggable/DraggableBodyRow.tsx index 7f318f3d00f..f19b05db65a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Draggable/DraggableBodyRow.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Draggable/DraggableBodyRow.tsx @@ -71,7 +71,7 @@ const DraggableBodyRow = ({ return ( { const handleOnImageError = useCallback(() => { setIsImgUrlValid(false); + + return false; }, []); const handleSelectedPersonaChange = async (persona: EntityReference) => { @@ -300,12 +302,14 @@ export const UserProfileIcon = () => { ) : ( )} -
- +
+ {getEntityName(currentUser)} {isEmpty(selectedPersona) ? t('label.default') diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/UserTeamSelectableList/UserTeamSelectableList.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/UserTeamSelectableList/UserTeamSelectableList.component.tsx index d536e63e4d8..0b87484a4b4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/UserTeamSelectableList/UserTeamSelectableList.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/UserTeamSelectableList/UserTeamSelectableList.component.tsx @@ -15,7 +15,6 @@ import { isEmpty, noop, toString } from 'lodash'; import React, { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { ReactComponent as EditIcon } from '../../../assets/svg/edit-new.svg'; -import { WILD_CARD_CHAR } from '../../../constants/char.constants'; import { DE_ACTIVE_COLOR, PAGE_SIZE_MEDIUM, @@ -138,7 +137,7 @@ export const UserTeamSelectableList = ({ } else { try { const { data } = await searchData( - WILD_CARD_CHAR, + '', afterPage, PAGE_SIZE_MEDIUM, 'teamType:Group', diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/explore/ExplorePageV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/explore/ExplorePageV1.component.tsx index d3256cf45b9..8f7f731362e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/explore/ExplorePageV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/explore/ExplorePageV1.component.tsx @@ -11,8 +11,6 @@ * limitations under the License. */ -import { useAdvanceSearch } from '../../components/Explore/AdvanceSearchProvider/AdvanceSearchProvider.component'; - import { Space, Typography } from 'antd'; import { get, isEmpty, isNil, isString, lowerCase } from 'lodash'; import Qs from 'qs'; @@ -25,6 +23,7 @@ import React, { } from 'react'; import { useHistory, useLocation, useParams } from 'react-router-dom'; import AppState from '../../AppState'; +import { useAdvanceSearch } from '../../components/Explore/AdvanceSearchProvider/AdvanceSearchProvider.component'; import { ExploreProps, ExploreSearchIndex, @@ -52,6 +51,7 @@ import { Aggregations, SearchResponse } from '../../interface/search.interface'; import { searchQuery } from '../../rest/searchAPI'; import { getCountBadge } from '../../utils/CommonUtils'; import { getCombinedQueryFilterObject } from '../../utils/ExplorePage/ExplorePageUtils'; +import { escapeESReservedCharacters } from '../../utils/StringsUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import { QueryFieldInterface, @@ -306,7 +306,7 @@ const ExplorePageV1: FunctionComponent = () => { setIsLoading(true); Promise.all([ searchQuery({ - query: searchQueryParam, + query: escapeESReservedCharacters(searchQueryParam), searchIndex, queryFilter: combinedQueryFilter, sortField: newSortValue, @@ -335,7 +335,7 @@ const ExplorePageV1: FunctionComponent = () => { SearchIndex.SEARCH_INDEX, ].map((index) => searchQuery({ - query: searchQueryParam, + query: escapeESReservedCharacters(searchQueryParam), pageNumber: 0, pageSize: 0, queryFilter: combinedQueryFilter, diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less b/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less index 6bb0ee50efd..308af9559e0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less +++ b/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less @@ -38,6 +38,9 @@ .w-24 { width: 6rem; } +.w-28 { + width: 7rem; +} .w-32 { width: 8rem; } diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx index aa59f5769f4..35e1ddab3f2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx @@ -122,7 +122,7 @@ export const getDiffValue = (oldValue: string, newValue: string) => { return ( {part.value} @@ -135,7 +135,7 @@ export const getAddedDiffElement = (text: string) => { {text} @@ -147,7 +147,7 @@ export const getRemovedDiffElement = (text: string) => { {text} @@ -156,7 +156,7 @@ export const getRemovedDiffElement = (text: string) => { export const getNormalDiffElement = (text: string) => { return ( - + {text} ); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/SearchUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/SearchUtils.tsx index 7359031cd06..ed0d6d9de45 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/SearchUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/SearchUtils.tsx @@ -11,11 +11,20 @@ * limitations under the License. */ +import { SearchOutlined } from '@ant-design/icons'; import { Button } from 'antd'; import i18next from 'i18next'; import { isEmpty } from 'lodash'; import React from 'react'; import { Link } from 'react-router-dom'; +import { ReactComponent as IconDashboard } from '../assets/svg/dashboard-grey.svg'; +import { ReactComponent as IconContainer } from '../assets/svg/ic-storage.svg'; +import { ReactComponent as IconStoredProcedure } from '../assets/svg/ic-stored-procedure.svg'; +import { ReactComponent as IconMlModal } from '../assets/svg/mlmodal.svg'; +import { ReactComponent as IconPipeline } from '../assets/svg/pipeline-grey.svg'; +import { ReactComponent as IconTable } from '../assets/svg/table-grey.svg'; +import { ReactComponent as IconTag } from '../assets/svg/tag-grey.svg'; +import { ReactComponent as IconTopic } from '../assets/svg/topic-grey.svg'; import { Option, SearchSuggestions, @@ -28,18 +37,9 @@ import { EntityType, FqnPart } from '../enums/entity.enum'; import { SearchIndex } from '../enums/search.enum'; import { getPartialNameFromTableFQN } from './CommonUtils'; import { serviceTypeLogo } from './ServiceUtils'; +import { escapeESReservedCharacters } from './StringsUtils'; import { getEntityLink } from './TableUtils'; -import { SearchOutlined } from '@ant-design/icons'; -import { ReactComponent as IconDashboard } from '../assets/svg/dashboard-grey.svg'; -import { ReactComponent as IconContainer } from '../assets/svg/ic-storage.svg'; -import { ReactComponent as IconStoredProcedure } from '../assets/svg/ic-stored-procedure.svg'; -import { ReactComponent as IconMlModal } from '../assets/svg/mlmodal.svg'; -import { ReactComponent as IconPipeline } from '../assets/svg/pipeline-grey.svg'; -import { ReactComponent as IconTable } from '../assets/svg/table-grey.svg'; -import { ReactComponent as IconTag } from '../assets/svg/tag-grey.svg'; -import { ReactComponent as IconTopic } from '../assets/svg/topic-grey.svg'; - export const getSearchAPIQueryParams = ( queryString: string, from: number, @@ -53,7 +53,9 @@ export const getSearchAPIQueryParams = ( ): Record => { const start = (from - 1) * size; - const encodedQueryString = queryString ? encodeURIComponent(queryString) : ''; + const encodedQueryString = queryString + ? escapeESReservedCharacters(queryString) + : ''; const query = encodedQueryString === WILD_CARD_CHAR ? encodedQueryString diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/StringsUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/StringsUtils.ts index 8eb99c4847c..64b86c44e9e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/StringsUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/StringsUtils.ts @@ -186,3 +186,41 @@ export const customServiceComparator = (a: string, b: string): number => { * @returns - String text replacing + to valid component of a Uniform Resource Identifier (URI). */ export const replacePlus = (fqn: string) => fqn.replaceAll('+', ' '); + +export const ES_RESERVED_CHARACTERS: Record = { + '+': '\\+', + '-': '\\-', + '=': '\\=', + '&&': '\\&&', + '||': '\\||', + '>': '\\>', + '<': '\\<', + '!': '\\!', + '(': '\\(', + ')': '\\)', + '{': '\\{', + '}': '\\}', + '[': '\\[', + ']': '\\]', + '^': '\\^', + '"': '\\"', + '~': '\\~', + '*': '\\*', + '?': '\\?', + ':': '\\:', + '\\': '\\\\', + '/': '\\/', +}; + +export const escapeESReservedCharacters = (text?: string) => { + const reUnescapedHtml = /[+-=&&||> { + return ES_RESERVED_CHARACTERS[char] ?? char; + }; + + return text && reHasUnescapedHtml.test(text) + ? text.replace(reUnescapedHtml, getReplacedChar) + : text ?? ''; +};