Skip to content

Refactor DataQualityTab table to ui-core components#27695

Merged
shah-harshit merged 10 commits intomainfrom
fix-3837-dataqualitytab-table
May 5, 2026
Merged

Refactor DataQualityTab table to ui-core components#27695
shah-harshit merged 10 commits intomainfrom
fix-3837-dataqualitytab-table

Conversation

@shah-harshit
Copy link
Copy Markdown
Contributor

@shah-harshit shah-harshit commented Apr 24, 2026

Summary

  • migrate DataQualityTab from the legacy AntD table wrapper to @openmetadata/ui-core-components Table
  • keep existing incident/status and bulk actions behavior while wiring sorting + selection through the new table APIs
  • simplify related table state handling (SortDescriptor, Selection) and remove old antd table-specific callbacks/config

Related issue

Closes https://github.com/open-metadata/openmetadata-collate/issues/3837

Test plan

  • Open profiler data quality tab and verify rows render correctly
  • Validate sorting for Last Run, Name, Table, and Column
  • Validate bulk-selection and clear-selection behavior
  • Validate incident/status actions and row menu actions

Made with Cursor


Summary by Gitar

  • UI adjustments:
    • Increased max-w for DataQualityTab cells to tw:max-w-20 for improved layout responsiveness.
  • Test automation:
    • Updated BundleSuiteBulkOperations to use label[slot="selection"] selectors for table interaction.

This will update automatically on new commits.

Replace the AntD table integration in DataQualityTab with ui-core Table APIs to align interaction behavior (sorting and selection) and improve consistency across data quality views.

Made-with: Cursor
@shah-harshit shah-harshit requested a review from a team as a code owner April 24, 2026 09:22
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@shah-harshit shah-harshit self-assigned this Apr 24, 2026
@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Apr 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.44% (62929/100781) 42.76% (33918/79315) 45.76% (10035/21929)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

🟡 Playwright Results — all passed (11 flaky)

✅ 3987 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 86 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
🟡 Shard 2 750 0 4 8
🟡 Shard 3 743 0 3 7
✅ Shard 4 775 0 0 18
✅ Shard 5 687 0 0 41
🟡 Shard 6 733 0 4 8
🟡 11 flaky test(s) (passed on retry)
  • Features/ActivityAPI.spec.ts › Activity event is created when description is updated (shard 2, 1 retry)
  • Features/ActivityAPI.spec.ts › Activity event shows the actor who made the change (shard 2, 1 retry)
  • Features/DataQuality/BundleSuiteBulkOperations.spec.ts › Create new Bundle Suite with bulk selected test cases (shard 2, 1 retry)
  • Features/DataQuality/BundleSuiteBulkOperations.spec.ts › Add test case to existing Bundle Suite (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/Table.spec.ts › Table pagination with sorting should works (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 3, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Glossary CSV import preserves typed relations (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for container -> container (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 4, 2026

Code Review 👍 Approved with suggestions 3 resolved / 4 findings

Refactors DataQualityTab to use ui-core-components and addresses sorting, state handling, and skeleton rendering issues. Replace the brittle .ant-table-cell fallback selector with a more stable alternative.

💡 Edge Case: Brittle .ant-table-cell selector in fallback path

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/dataContracts.ts:156-159

The fallback locator at line 158 uses .ant-table-cell, an AntD-specific CSS class. Given this PR is migrating tables away from AntD to @openmetadata/ui-core-components, this selector will silently break if the test-suite-table is migrated in a future PR — the fallback path will time out instead of finding the cell, producing a confusing test failure.

Consider using a more resilient selector (e.g., a data-testid on the cell or a role-based locator) so the fallback remains stable across table implementations.

Suggested fix
// Instead of relying on AntD internals:
const suiteNameCell = page
  .getByTestId('test-suite-table')
  .getByRole('cell')
  .filter({ hasText: `Data Contract - ${contractName}` });
✅ 3 resolved
Bug: Duplicate skeleton loading state rendered outside Table

📄 openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:718-728 📄 openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:753-759
The loading skeleton is rendered in two places: once inside Table.Body's renderEmptyState (lines 718-728) when isLoading is true (since items={isLoading ? [] : sortedData}), and again outside the <Table> component (lines 753-759) under the condition isLoading && sortedData.length === 0. When both conditions are true (loading with no prior data), the user sees two sets of skeletons stacked. The outer block is strictly redundant since renderEmptyState already covers this case.

Bug: Cannot return to default status-based sort order

📄 openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:122-125 📄 openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:232-246
The old AntD table supported a three-state sort cycle (ascending → descending → unsorted), allowing users to return to the default status-based ordering (Failed → Aborted → Success). React Aria's sort only toggles between ascending and descending — there is no way to clear the sort. Once a user clicks any sortable column header, the default status-priority ordering is permanently lost until the page is reloaded.

Additionally, the sortedData memo applies client-side sorting for 'table'/'column' on top of the status-based sortBy, effectively overriding it anyway. For 'lastRun'/'name' (API-sorted), isApiSortingEnabled skips the default sort. So the initial status-based ordering is a one-time default that can never be restored via the UI.

Edge Case: handleStatusSubmit may misfire when fullyQualifiedName is absent

📄 openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:223-226
The comparison was changed from stateId (a unique identifier) to testCaseReference?.fullyQualifiedName. Both testCaseReference and fullyQualifiedName are optional (EntityReference at testCaseResolutionStatus.ts:117). If multiple entries in testCaseStatus have testCaseReference as undefined (or with fullyQualifiedName unset), the predicate undefined === undefined is true, and every such entry will be replaced with value, corrupting the state.

stateId was a safer key because it is always present and unique per resolution status. If the intent is to match by test case rather than state id, consider falling back to stateId when fullyQualifiedName is missing.

🤖 Prompt for agents
Code Review: Refactors DataQualityTab to use ui-core-components and addresses sorting, state handling, and skeleton rendering issues. Replace the brittle .ant-table-cell fallback selector with a more stable alternative.

1. 💡 Edge Case: Brittle .ant-table-cell selector in fallback path
   Files: openmetadata-ui/src/main/resources/ui/playwright/utils/dataContracts.ts:156-159

   The fallback locator at line 158 uses `.ant-table-cell`, an AntD-specific CSS class. Given this PR is migrating tables away from AntD to `@openmetadata/ui-core-components`, this selector will silently break if the `test-suite-table` is migrated in a future PR — the fallback path will time out instead of finding the cell, producing a confusing test failure.
   
   Consider using a more resilient selector (e.g., a `data-testid` on the cell or a role-based locator) so the fallback remains stable across table implementations.

   Suggested fix:
   // Instead of relying on AntD internals:
   const suiteNameCell = page
     .getByTestId('test-suite-table')
     .getByRole('cell')
     .filter({ hasText: `Data Contract - ${contractName}` });

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 4, 2026

@shah-harshit shah-harshit enabled auto-merge (squash) May 5, 2026 09:41
@shah-harshit shah-harshit merged commit c70c147 into main May 5, 2026
46 checks passed
@shah-harshit shah-harshit deleted the fix-3837-dataqualitytab-table branch May 5, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants