feat(ui): extract EntitySort/Permission/Column/Breadcrumb/SummaryPanel etc pure utils#28740
feat(ui): extract EntitySort/Permission/Column/Breadcrumb/SummaryPanel etc pure utils#28740shah-harshit wants to merge 2 commits into
Conversation
…tils, EntityTagUtils, EntitySearchUtils, EntityColumnUtils, EntityBreadcrumbPureUtils, EntitySummaryPanelPureUtils from EntityPureUtils/EntityUtils/EntityBreadcrumbUtils/EntitySummaryPanelUtils - Extract columnSorter/getColumnSorter → EntitySortUtils.ts - Extract hasSchemaTab/hasLineageTab/hasCustomPropertiesTab/hasEditAccess → EntityPermissionUtils.ts - Extract getEntityVoteStatus → EntityVoteUtils.ts - Extract getEntityTags → EntityTagUtils.ts - Extract searchInColumns/highlightEntityNameAndDescription/highlightSearchText/highlightSearchArrayElement → EntitySearchUtils.tsx - Extract getEntityReferenceFromEntity/getEntityReferenceListFromEntities → EntityReferenceUtils.ts - Extract getFrequentlyJoinedColumns → EntityColumnUtils.tsx (new file) - Move all pure breadcrumb functions → EntityBreadcrumbPureUtils.ts; EntityBreadcrumbUtils.tsx becomes re-export facade - Extract getSummaryListItemType/getSortedTagsWithHighlight/getMapOfListHighlights/getHighlightOfListItem/toEntityData → EntitySummaryPanelPureUtils.ts - Extract filterItemsBySearchText/filterNestedFields → EntitySummaryPanelPureUtilsV1.ts (imported instead of redefined) - Add backward-compat re-exports in all source files so existing imports continue to work Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tils, EntityTagUtils, EntitySearchUtils, EntityDetailComponentUtils, EntityBreadcrumbPureUtils, EntitySummaryPanelPureUtils from EntityPureUtils/EntityUtils/EntityBreadcrumbUtils Split EntityPureUtils.ts into domain-specific modules: - EntitySortUtils.ts: columnSorter, getColumnSorter - EntityPermissionUtils.ts: hasSchemaTab, hasLineageTab, hasCustomPropertiesTab, hasEditAccess - EntityVoteUtils.ts: getEntityVoteStatus - EntityTagUtils.ts: getEntityTags - EntitySearchUtils.tsx: searchInColumns, highlightEntityNameAndDescription, highlightSearchText, highlightSearchArrayElement - EntityColumnUtils.tsx: checkIfJoinsAvailable, getFrequentlyJoinedWithColumns, getFrequentlyJoinedColumns - EntityReferenceUtils.ts: getEntityReferenceFromEntity, getEntityReferenceListFromEntities - EntityDetailComponentUtils.tsx: getEntityDetailComponent - EntityBreadcrumbPureUtils.ts: pure breadcrumb builders from EntityBreadcrumbUtils.tsx - EntitySummaryPanelPureUtils.ts: pure summary panel helpers from EntitySummaryPanelUtils.tsx - EntitySummaryPanelPureUtilsV1.ts: pure v1 summary panel helpers All source files re-export moved symbols for backward compat. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
| return `<#E${ENTITY_LINK_SEPARATOR}user${ENTITY_LINK_SEPARATOR}${userName}>`; | ||
| }; | ||
|
|
||
| export const getEntityLinkFromType = ( |
There was a problem hiding this comment.
💡 Quality: New EntityLinkUtils.ts is unused and duplicates existing logic
The new file EntityLinkUtils.ts (+277 lines) is not imported anywhere in the codebase (grep for importers returns nothing). It re-implements logic that already exists elsewhere as part of this same PR/refactor:
getEntityLinkFromTypeis defined identically in bothEntityLinkUtils.ts:80andEntityBreadcrumbPureUtils.ts:561(the latter is the one actually wired up viaEntityBreadcrumbUtils.tsx→EntityUtils.tsx).getEntityFeedLink,getEntityUserLink,getColumnNameFromEntityLink,getEntityImportPath,getEntityBulkEditPath, andupdateNodeTypeduplicate definitions that still live inEntityPureUtils.ts.
Shipping a second, dead copy of routing/link logic creates a real maintenance hazard: future edits to one copy (e.g. adding a new EntityType case to getEntityLinkFromType) will silently diverge from the other, and the unused file adds to bundle/parse surface and reviewer confusion. For a refactor whose stated goal is to split files into single-source-of-truth modules, having two competing copies of getEntityLinkFromType undercuts that goal.
Suggested fix: either delete EntityLinkUtils.ts entirely if it is not intended to be the canonical home for these helpers, or — if it IS meant to be canonical — have EntityBreadcrumbPureUtils.ts and EntityPureUtils.ts re-export from it instead of redefining, and wire consumers accordingly. Pick one source of truth.
Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsRefactors monolithic entity utility files into domain-specific modules while maintaining backward compatibility via re-exports. Remove the unused, redundant EntityLinkUtils.ts file. 💡 Quality: New EntityLinkUtils.ts is unused and duplicates existing logic📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityLinkUtils.ts:80 📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityLinkUtils.ts:58 📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityLinkUtils.ts:76 📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityLinkUtils.ts:203 📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityLinkUtils.ts:207 📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityLinkUtils.ts:214 📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityLinkUtils.ts:228 📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityBreadcrumbPureUtils.ts:561 The new file
Shipping a second, dead copy of routing/link logic creates a real maintenance hazard: future edits to one copy (e.g. adding a new Suggested fix: either delete 🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
🟡 Playwright Results — all passed (15 flaky)✅ 4265 passed · ❌ 0 failed · 🟡 15 flaky · ⏭️ 88 skipped
🟡 15 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |



Summary
Splits
EntityPureUtils.ts,EntityUtils.tsx,EntityBreadcrumbUtils.tsx, andEntitySummaryPanelUtils.tsxinto domain-specific modules:columnSorter,getColumnSorterhasSchemaTab,hasLineageTab,hasCustomPropertiesTab,hasEditAccessgetEntityVoteStatusgetEntityTagssearchInColumns,highlightEntityNameAndDescription,highlightSearchText,highlightSearchArrayElementcheckIfJoinsAvailable,getFrequentlyJoinedWithColumns,getFrequentlyJoinedColumnsgetEntityReferenceFromEntity,getEntityReferenceListFromEntitiesgetEntityDetailComponentEntityBreadcrumbUtils.tsxAll source files re-export moved symbols for full backward compat — no consumer changes required.
Test plan
npx tsc --noEmit— 0 errors in changed filesyarn lint:fix— 0 new errors🤖 Generated with Claude Code