Skip to content

Fixes #35240: Migrate Add Assets selection to core components - #35242

Merged
anuj-kumary merged 10 commits into
mainfrom
ui/add-assets-core-components
Oct 13, 2026
Merged

anuj-kumary merged 10 commits into
mainfrom
ui/add-assets-core-components

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #35240

The Add Assets selection (drawer on Domain / Data Product / Input-Output ports, modal on Glossary term / Tag / Metric / Ontology concept) still rendered Ant Design pieces plus LESS overrides that fought the design system: cards had no gap, radius or shadow. This moves it fully onto @openmetadata/ui-core-components with no override classes. It also fixes the redirect icon disappearing on long asset names.

AssetSelectionContentBody

  • antd Alert → core Alert (info → brand; validation errors → error, dismissible via a small ValidationErrorAlert that owns its dismissed state).
  • Job-progress Banner → core Alert (success/error) with a spinning core Loading01 icon while the job runs.
  • antd "Select all" Checkbox → core Checkbox; "Clear" Typography with onClick → core Button (link-color).
  • antd List + rc-virtual-list → plain map. The virtual list was never given a height, so it rendered every row anyway (useVirtual = !!(virtual !== false && height && itemHeight)); behaviour is unchanged.
  • Legacy d-flex / .asset-filters-wrapper divs → Box (new data-testid="asset-filters"). The cards sit in a non-scrolling inner Box: Card is overflow-hidden, so as a direct child of the scrolling flex column it would shrink to 0 height.
  • Deleted asset-selection-model.style.less.

TableDataCardV2

  • Rebuilt on core Card (variant="elevated", isClickable, isSelected for checked rows). A failed save renders as color="error" plus a Card.Footer via a new errorMessage prop, instead of a wrapper div in the drawer.
  • antd Checkbox → core Checkbox (same asset-checkbox test id). react-aria stops click propagation, so the checkbox calls the card's handler itself.
  • Removed dead/override-only props (matches, className, nameClassName, displayNameClassName) and the unused forwardRef; deleted TableDataCardV2.less.
  • TagsSummary, the only other consumer, now lists the cards in a gapped Box instead of mb-2 wrappers and gives them keys.

EntityHeaderTitle

  • The "open in new page" icon was inside the ellipsis Typography, so a long name truncated it away. It is now a sibling in the existing row, using core LinkExternal01 (size={14}, tw:text-fg-quaternary to match the copy icon) instead of the hardcoded-fill external-link-grey.svg, so it follows dark mode. The icon only renders where openEntityInNewPage is set (today the Add Assets cards); other headers only see the icon move out of the Typography.

Type of change:

  • Improvement

High-level design:

UI-only refactor, no API, schema or state changes. useAssetSelectionState is untouched; the drawer and modal still share AssetSelectionContentBody.

  • Where the card's visuals come from: core Card owns border, radius, shadow, hover and selected state. The drawer passes data props only (checked, errorMessage), with no className, so there is nothing left to override.
  • Remaining layout classes, each load-bearing:
    • tw:overflow-hidden on SlideoutMenu.Content: keeps the search and filters fixed while the list scrolls, which is what the infinite-scroll onScroll listens to.
    • tw:p-1 on the list: stops the scroll container clipping the cards' shadow.
    • tw:min-w-0 tw:flex-1 on the card's title column: lets long names truncate.
  • Alternative rejected: keep TableDataCardV2's div and restyle it with Tailwind. That re-implements Card and drifts from it.
  • Compatibility: test ids asset-selection-modal, asset-checkbox, table-data-card_<fqn>, entity-header-name, clear-filters and searchbar are unchanged. .asset-filters-wrapper is replaced by data-testid="asset-filters", and playwright/utils/glossary.ts is updated. No openmetadata-collate change is needed: Collate only imports types from AssetSelectionModal.interface.ts (untouched), and its Playwright selectors (table-data-card_*, entity-header-name text) still match.

Tests:

Use cases covered

  • Select / deselect an asset by its checkbox: the handler fires exactly once (react-aria stops propagation, so no double toggle).
  • "Select all" toggles every asset.
  • Validation-error alert shows when requests fail and stays hidden once closed.
  • Job-progress alert shows success (spinner while running) or error from the export job; nothing renders when there is no job.
  • Per-asset failure message renders on that card.
  • The list still fires onScroll for pagination.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files updated: AssetSelectionContentBody.test.tsx (core mocks, alert variant/dismiss, card error message, scroll container), TableDataCardV2.test.tsx (checkbox calls the handler once).
  • Run: yarn test src/components/DataAssets src/components/common/TableDataCardV2 src/components/Entity/EntityHeaderTitle src/components/Entity/EntityHeader src/components/Explore/EntitySummaryPanel. 31 suites, 476 tests passed.
  • Coverage % not measured.
  • ESLint: 0 errors on the changed files. 2 warnings were already there: exhaustive-deps in TagsSummary and EntityHeaderTitle.
  • Prettier: clean.
  • tsc --noEmit: no errors in the changed files.
  • eslint-suppressions.json: removed the now-unneeded no-antd-import entries for AssetSelectionContentBody.tsx and TableDataCardV2.tsx.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

Playwright run - https://github.com/open-metadata/OpenMetadata/actions/runs/38241935792

UI screen recording:

Screen.Recording.2026-10-12.at.2.02.19.PM.mov

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: N/A, no schema changes.

  • For a UI feature or feature task: N/A, a migration/refactor rather than a feature (see above).

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Decision check: no durable decision; this follows the existing rule that new UI uses ui-core-components.

  • I have added tests around the new logic.

🤖 Generated with Claude Code

Replace antd Alert/Checkbox/List and rc-virtual-list in the asset
selection body with ui-core-components, rebuild TableDataCardV2 on the
core Card, drop the LESS overrides, and keep EntityHeaderTitle's
redirect icon outside the ellipsis so long names cannot hide it.
@anuj-kumary anuj-kumary added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@anuj-kumary anuj-kumary self-assigned this Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 77%
77.32% (124217/160643) 63.54% (77278/121614) 64.97% (25877/39825)

anuj-kumary and others added 3 commits October 12, 2026 14:30
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…check()

The core Checkbox puts data-testid on its react-aria label, so locator.check()
rejects it as not a checkbox or radio button.
anuj-kumary and others added 3 commits October 12, 2026 16:48
The banner is a core Alert now, so .ant-alert-info no longer exists:
the output-port assertion failed and the input-port absence check
passed vacuously.
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 911 → 911
- 0 added, 0 removed, 1 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/components/DataAssets/AssetsSelectionModal/AssetSelectionContentBody.tsx

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 2 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 2 warning(s) across 2 changed file(s).

Count Rule
2 react-hooks/exhaustive-deps
All findings
Location Rule Message
🟡 src/components/Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx:140:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/components/Explore/EntitySummaryPanel/TagsSummary/TagsSummary.component.tsx:72:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchTagAssetsDetails'. Either include it or remove the dependency array.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@open-metadata open-metadata deleted a comment from github-actions Bot Oct 12, 2026
@anuj-kumary
anuj-kumary enabled auto-merge October 12, 2026 12:44
@anuj-kumary
anuj-kumary added this pull request to the merge queue Oct 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — merge_conflict (2026-10-12T22:42:50Z)

The entry left the queue before it was built, so no checks ran against it.

@anuj-kumary
anuj-kumary enabled auto-merge October 13, 2026 01:21
Resolve the antd suppression ratchet: main dropped 12 suppressed symbols
(723 -> 711), this branch dropped 5 (723 -> 718), so the merged baseline
is 706.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@anuj-kumary
anuj-kumary added this pull request to the merge queue Oct 13, 2026
@anuj-kumary
anuj-kumary removed this pull request from the merge queue due to a manual request Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-10-13T01:57:06Z)

The entry left the queue before it was built, so no checks ran against it.

@anuj-kumary
anuj-kumary enabled auto-merge October 13, 2026 03:01
Both sides migrated a different component off antd, which git resolved as
an either/or on adjacent hunks in eslint-suppressions.json. Re-merged the
baseline per key instead: main dropped AddDataContract.tsx, this branch
dropped AssetSelectionContentBody.tsx, so both entries go. 711 - 5 - 169
leaves the ratchet at 537.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Replacing asset-selection controls and cards could mis-handle selections in domain, data-product, glossary, and tag updates.

Migrates the Add Assets selection drawer and modal onto @openmetadata/ui-core-components, replacing antd components and LESS overrides with core Card, Alert, Checkbox and Button, and removes asset-selection-model.style.less and TableDataCardV2.less. It also keeps the redirect icon visible on long asset names in EntityHeaderTitle. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@anuj-kumary
anuj-kumary added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit efe22bf Oct 13, 2026
71 checks passed
@anuj-kumary
anuj-kumary deleted the ui/add-assets-core-components branch October 13, 2026 04:17
shah-harshit added a commit that referenced this pull request Oct 13, 2026
Resolve conflicts with the Modal/Button freeze (#35226), the Data Contract
(#35217), Add Assets (#35242) and Applications settings (#35179) migrations.
Where main already migrated a file, keep main's version and drop this
branch's duplicate (DataContract SLA/view switch, AssetSelectionContentBody,
TableDataCardV2, AppLogsViewer, ReindexFailures). Elsewhere keep this
branch's migration and port main's core Button changes onto it.
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.

Add Assets drawer/modal: migrate from Ant Design to core components; redirect icon hidden on long asset names

2 participants