diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/IncidentManager.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/IncidentManager.spec.ts index 2d99c240ec9f..2253d9709635 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/IncidentManager.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/IncidentManager.spec.ts @@ -145,7 +145,7 @@ const isVisible = async (locator: Locator) => const expectIncidentTableRowsToContain = async (page: Page, text: string) => { const rows = page.locator( - '.ant-table-tbody tr:not(.ant-table-measure-row):not(.ant-table-placeholder)' + '[data-testid="test-case-incident-manager-table"] tbody tr' ); const rowCount = await rows.count(); @@ -182,7 +182,7 @@ const openIncidentReassignModal = async (page: Page, testCaseName?: string) => { .last(); const incidentListRowAction = testCaseName ? page - .locator('.ant-table-tbody tr') + .locator('[data-testid="test-case-incident-manager-table"] tbody tr') .filter({ hasText: testCaseName }) .first() .locator('button') diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/incidentManager.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/incidentManager.ts index 7337475ed6d6..5c4c1a469e5e 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/incidentManager.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/incidentManager.ts @@ -73,9 +73,7 @@ export const addAssigneeFromPopoverWidget = async (data: { const taskTabEditAssigneesButton = page.getByTestId('edit-assignees').last(); if (testCaseName) { - const incidentRow = page - .getByRole('row', { name: new RegExp(testCaseName, 'i') }) - .first(); + const incidentRow = page.getByTestId(`test-case-${testCaseName}`).first(); const editOwnerButton = incidentRow.getByTestId('edit-owner'); if (await editOwnerButton.isVisible().catch(() => false)) { @@ -184,7 +182,7 @@ export const assignIncident = async (data: { .poll( async () => { const incidentRow = page - .getByRole('row', { name: new RegExp(testCaseName, 'i') }) + .getByTestId(`test-case-${testCaseName}`) .first(); const incidentLink = page .getByRole('link', { name: testCaseName }) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/DimensionalityTab/DimensionalityTab.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/DimensionalityTab/DimensionalityTab.tsx index 93d4d9889d24..31260c8b3ea7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/DimensionalityTab/DimensionalityTab.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/DimensionalityTab/DimensionalityTab.tsx @@ -10,13 +10,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Select, Skeleton, Tooltip } from '@openmetadata/ui-core-components'; -import { HelpCircle } from '@untitledui/icons'; -import { ColumnsType } from 'antd/lib/table'; +import { Select, Skeleton, Table } from '@openmetadata/ui-core-components'; import { format } from 'date-fns'; import { isEmpty, split, toLower } from 'lodash'; import { DateRangeObject } from 'Models'; -import { useEffect, useMemo, useState } from 'react'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; import { @@ -43,7 +41,6 @@ import NoDataPlaceholderNew from '../../../common/ErrorWithPlaceholder/NoDataPla import MuiDatePickerMenu from '../../../common/MuiDatePickerMenu/MuiDatePickerMenu'; import StatusBadge from '../../../common/StatusBadge/StatusBadge.component'; import { StatusType } from '../../../common/StatusBadge/StatusBadge.interface'; -import Table from '../../../common/Table/Table'; import { ProfilerTabPath } from '../../../Database/Profiler/ProfilerDashboard/profilerDashboard.interface'; import DimensionalityHeatmap from './DimensionalityHeatmap/DimensionalityHeatmap.component'; import { DimensionResultWithTimestamp } from './DimensionalityHeatmap/DimensionalityHeatmap.interface'; @@ -176,84 +173,65 @@ const DimensionalityTab = () => { }); }, [dimensionData]); - const tableColumns: ColumnsType<{ - key: string; - dimensionValue: string; - result: DimensionResultWithTimestamp; - }> = [ - { - title: t('label.status'), - dataIndex: 'result', - key: 'status', - width: 120, - render: (result: DimensionResultWithTimestamp) => { - return result?.testCaseStatus ? ( - - ) : ( - -- - ); - }, - }, - { - title: ( -
- {t('label.impact-score')} - - {t('message.impact-score-helper')} - - }> - - -
- ), - dataIndex: 'result', - key: 'impactScore', - width: 120, - render: (result: DimensionResultWithTimestamp) => { - return ( - {result?.impactScore ?? '--'} - ); - }, - }, - { - title: t('label.dimension'), - dataIndex: 'dimensionValue', - key: 'dimensionValue', - width: 200, - render: (dimensionValue: string, record) => { - return ( - - {dimensionValue} - - ); - }, - }, - { - title: t('label.last-run'), - dataIndex: 'result', - key: 'lastRun', - width: 200, - render: (result: DimensionResultWithTimestamp) => { - return result?.timestamp ? ( - - ) : ( - -- - ); + const dimensionTableColumns = useMemo( + () => [ + { id: 'status', label: t('label.status') }, + { + id: 'impactScore', + label: t('label.impact-score'), + tooltip: t('message.impact-score-helper'), }, + { id: 'dimensionValue', label: t('label.dimension') }, + { id: 'lastRun', label: t('label.last-run') }, + ], + [t] + ); + + const renderCell = useCallback( + ( + col: { id: string }, + row: (typeof getLatestResultPerDimension)[number] + ) => { + switch (col.id) { + case 'status': + return row.result?.testCaseStatus ? ( + + ) : ( + -- + ); + case 'impactScore': + return ( + + {row.result?.impactScore ?? '--'} + + ); + case 'dimensionValue': + return ( + + {row.dimensionValue} + + ); + case 'lastRun': + return row.result?.timestamp ? ( + + ) : ( + -- + ); + default: + return null; + } }, - ]; + [testCase?.fullyQualifiedName] + ); const noDataPlaceholder = useMemo(() => { if (isLoading) { @@ -287,8 +265,9 @@ const DimensionalityTab = () => { {`${t('label.select-dimension')}:`}