diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/TaskUtils.js b/openmetadata-ui/src/main/resources/ui/cypress/common/TaskUtils.js index 414485195c0..cff4f86f0c1 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/TaskUtils.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/TaskUtils.js @@ -102,7 +102,7 @@ export const createAndUpdateDescriptionTask = (value) => { createDescriptionTask(value); // verify the task details - verifyTaskDetails(/#(\d+) UpdateDescriptionfordescription/); + verifyTaskDetails(/#(\d+) Request to update description for/); // edit task assignees editAssignee(); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/ActivityFeed.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/ActivityFeed.spec.js index b26b8eb48cf..7211780e054 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/ActivityFeed.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/ActivityFeed.spec.js @@ -357,7 +357,9 @@ describe('Activity feed', () => { cy.get('[data-testid="message-container"]') .invoke('text') .then((textContent) => { - const matches = textContent.match(/#(\d+) UpdateDescriptionfortable/); + const matches = textContent.match( + /#(\d+) Request to update description for/ + ); expect(matches).to.not.be.null; }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Task.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Task.spec.js index 76a01e3e88f..15bb1c226ec 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Task.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Task.spec.js @@ -123,8 +123,8 @@ describe('Task flow should work', () => { // verify the task details verifyTaskDetails( value.tagCount > 0 - ? /#(\d+) UpdateTagfortags/ - : /#(\d+) RequestTagfortags/ + ? /#(\d+) Request to update tags for/ + : /#(\d+) Request tags for/ ); // edit task assignees diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExplorePage.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExplorePage.interface.ts index 014e30037fb..2f654d3ee8a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExplorePage.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExplorePage.interface.ts @@ -35,6 +35,7 @@ import { MlmodelService } from '../../generated/entity/services/mlmodelService'; import { PipelineService } from '../../generated/entity/services/pipelineService'; import { SearchService } from '../../generated/entity/services/searchService'; import { StorageService } from '../../generated/entity/services/storageService'; +import { TestCase } from '../../generated/tests/testCase'; import { Aggregations, SearchResponse } from '../../interface/search.interface'; import { QueryFilterInterface } from '../../pages/ExplorePage/ExplorePage.interface'; import { SearchDropdownOption } from '../SearchDropdown/SearchDropdown.interface'; @@ -131,6 +132,7 @@ export type EntityUnion = | Database | Glossary | Tag + | TestCase | DashboardDataModel | StoredProcedure | SearchIndexEntity diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/PopOverCard/EntityPopOverCard.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/PopOverCard/EntityPopOverCard.tsx index 131c35554dd..e6cd0418863 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/PopOverCard/EntityPopOverCard.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/PopOverCard/EntityPopOverCard.tsx @@ -43,8 +43,8 @@ import { getContainerByFQN } from '../../../rest/storageAPI'; import { getStoredProceduresByFqn } from '../../../rest/storedProceduresAPI'; import { getTableDetailsByFQN } from '../../../rest/tableAPI'; import { getTagByFqn } from '../../../rest/tagAPI'; +import { getTestCaseByFqn } from '../../../rest/testAPI'; import { getTopicByFqn } from '../../../rest/topicsAPI'; -import { getTableFQNFromColumnFQN } from '../../../utils/CommonUtils'; import { getEntityName } from '../../../utils/EntityUtils'; import { getDecodedFqn } from '../../../utils/StringsUtils'; import { useApplicationConfigContext } from '../../ApplicationConfigProvider/ApplicationConfigProvider'; @@ -101,8 +101,8 @@ export const PopoverContent: React.FC<{ break; case EntityType.TEST_CASE: - promise = getTableDetailsByFQN(getTableFQNFromColumnFQN(decodedFqn), { - fields, + promise = getTestCaseByFqn(decodedFqn, { + fields: ['owner'], }); break; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/IncidentManager/IncidentManagerDetailPage/IncidentManagerDetailPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/IncidentManager/IncidentManagerDetailPage/IncidentManagerDetailPage.tsx index 9c57d21436f..0678d4f31c7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/IncidentManager/IncidentManagerDetailPage/IncidentManagerDetailPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/IncidentManager/IncidentManagerDetailPage/IncidentManagerDetailPage.tsx @@ -125,7 +125,7 @@ const IncidentManagerDetailPage = () => { 'incidentId', ], }); - setTestCaseData((prev) => ({ ...prev, data: response.data })); + setTestCaseData((prev) => ({ ...prev, data: response })); } catch (error) { showErrorToast( error as AxiosError, diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TestCaseDetailsPage/TestCaseDetailsPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TestCaseDetailsPage/TestCaseDetailsPage.component.tsx index fb32e735ec6..ed1c543caf1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TestCaseDetailsPage/TestCaseDetailsPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TestCaseDetailsPage/TestCaseDetailsPage.component.tsx @@ -39,7 +39,7 @@ function TestCaseDetailsPage() { const response = await getTestCaseByFqn(testCaseFQN, { fields: ['testSuite', 'testCaseResult'], }); - setTestCaseData(response.data); + setTestCaseData(response); } catch (error) { showErrorToast( error as AxiosError, diff --git a/openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts b/openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts index 06865ef156d..a2459fb4592 100644 --- a/openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts +++ b/openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts @@ -106,7 +106,7 @@ export const getTestCaseByFqn = async ( } ); - return response; + return response.data; }; export const getTestCaseById = async ( id: string, diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx index 7ced3704a58..d25a3ba9d71 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx @@ -59,6 +59,7 @@ import { getTagsDetailsPath, getTopicDetailsPath, NO_DATA, + ROUTES, } from '../constants/constants'; import { EntityField } from '../constants/Feeds.constants'; import { GlobalSettingsMenuCategory } from '../constants/GlobalSettings.constants'; @@ -94,6 +95,7 @@ import { } from '../generated/entity/data/table'; import { Topic } from '../generated/entity/data/topic'; import { DataProduct } from '../generated/entity/domains/dataProduct'; +import { TestCase } from '../generated/tests/testCase'; import { Edge, EntityLineage } from '../generated/type/entityLineage'; import { EntityReference } from '../generated/type/entityUsage'; import { TagLabel } from '../generated/type/tagLabel'; @@ -112,6 +114,7 @@ import { getDataProductsDetailsPath, getDomainPath, getGlossaryPath, + getIncidentManagerDetailPagePath, getSettingPath, } from './RouterUtils'; import { getSearchIndexTabPath } from './SearchIndexUtils'; @@ -1371,6 +1374,8 @@ export const getEntityLinkFromType = ( fullyQualifiedName, ServiceCategory.METADATA_SERVICES ); + case EntityType.TEST_CASE: + return getIncidentManagerDetailPagePath(fullyQualifiedName); default: return ''; } @@ -1491,6 +1496,21 @@ export const getBreadcrumbForContainer = (data: { ]; }; +export const getBreadcrumbForTestCase = (entity: TestCase) => [ + { + name: i18next.t('label.incident-manager'), + url: ROUTES.INCIDENT_MANAGER, + }, + + { + name: entity.name, + url: getEntityLinkFromType( + entity.fullyQualifiedName ?? '', + (entity as SourceType)?.entityType as EntityType + ), + }, +]; + export const getEntityBreadcrumbs = ( entity: | SearchedDataProps['data'][number]['_source'] @@ -1705,6 +1725,10 @@ export const getEntityBreadcrumbs = ( ]; } + case EntityType.TEST_CASE: { + return getBreadcrumbForTestCase(entity as TestCase); + } + case EntityType.TOPIC: case EntityType.DASHBOARD: case EntityType.PIPELINE: diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts index 9534a97d018..dbf80124415 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts @@ -241,7 +241,12 @@ class SearchClassBase { } public getListOfEntitiesWithoutTier() { - return [EntityType.GLOSSARY_TERM, EntityType.TAG, EntityType.DATA_PRODUCT]; + return [ + EntityType.GLOSSARY_TERM, + EntityType.TAG, + EntityType.DATA_PRODUCT, + EntityType.TEST_CASE, + ]; } public getServiceIcon(source: SearchSourceAlias) { @@ -249,7 +254,7 @@ class SearchClassBase { } public getListOfEntitiesWithoutDomain(): string[] { - return []; + return [EntityType.TEST_CASE]; } public getEntityBreadcrumbs( diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx index 5e3cd1353ae..39af62d6e5e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx @@ -39,6 +39,7 @@ import { ReactComponent as IconForeignKey } from '../assets/svg/foreign-key.svg' import { ReactComponent as GlossaryIcon } from '../assets/svg/glossary.svg'; import { ReactComponent as IconDown } from '../assets/svg/ic-arrow-down.svg'; import { ReactComponent as IconRight } from '../assets/svg/ic-arrow-right.svg'; +import { ReactComponent as TestCaseIcon } from '../assets/svg/ic-checklist.svg'; import { ReactComponent as DashboardIcon } from '../assets/svg/ic-dashboard.svg'; import { ReactComponent as DataProductIcon } from '../assets/svg/ic-data-product.svg'; import { ReactComponent as DatabaseIcon } from '../assets/svg/ic-database.svg'; @@ -223,6 +224,13 @@ export const getServiceIcon = (source: SourceType) => { style={{ color: DE_ACTIVE_COLOR }} /> ); + } else if (source.entityType === EntityType.TEST_CASE) { + return ( + + ); } else { return (