Repository navigation
refactor(ui): split CommonUtils.tsx into domain-specific utility modules - #28389
Conversation
Split the 900-line CommonUtils.tsx catch-all into 7 focused modules: - FqnUtils.ts (FQN parsing) - NumberUtils.ts (math/formatting) - ColorUtils.ts (color operations) - RecentActivityUtils.ts (recently viewed/searched) - StringUtils.ts (string transforms) - EntityDisplayUtils.tsx (JSX entity display helpers) - FilterQueryUtils.ts (ES query builders + filters) Re-exports maintained in CommonUtils.tsx for backward compatibility. Updated ~150 import paths across openmetadata-ui. Ref: open-metadata/openmetadata-collate#4230 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Code Review ✅ ApprovedRefactors the 900-line CommonUtils.tsx into seven domain-specific utility modules to improve maintainability while maintaining backward compatibility via re-exports. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
Code Review 👍 Approved with suggestions 1 resolved / 2 findingsRefactors the 900-line CommonUtils.tsx into seven focused domain-specific modules, improving maintainability and type safety. Note that a redundant conditional check remains in DatabaseDetailsPage that should be cleaned up. 💡 Quality: Redundant
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Gitar



Summary
CommonUtils.tsxinto 7 focused utility modules:FqnUtils,NumberUtils,ColorUtils,RecentActivityUtils,StringUtils,EntityDisplayUtils,FilterQueryUtilsopenmetadata-uiCommonUtils.tsxfor backward compatibilityLoadercomponent inEntityDisplayUtils.tsxNew Modules
FqnUtils.tsgetPartialNameFromTableFQN,getNameFromFQN, etc.)NumberUtils.tsformatNumberWithComma,calculatePercentage, etc.)ColorUtils.tsgetRandomColor,entityChartColor, etc.)RecentActivityUtils.tsStringUtils.tspluralize,removeOuterEscapes, etc.)EntityDisplayUtils.tsxgetCountBadge,getServiceLogo, etc.)FilterQueryUtils.tsRef
https://github.com/open-metadata/openmetadata-collate/issues/4230
Test plan
npx tsc --noEmit)yarn ui-checkstyle:changed)🤖 Generated with Claude Code
Summary by Gitar
CommonUtils.tsxinto domain-specific modules:FqnUtils,NumberUtils,ColorUtils,RecentActivityUtils,StringUtils,EntityDisplayUtils, andFilterQueryUtils.getTagValuetoTagsUtils.tsxand updated import paths across affected components.prepareLabelutility toEntityDisplayUtils.tsxfor consistent entity FQN-to-label parsing.getEntityMissingErrorandentityChartColorto point to their new modular locations.DataAssetsHeaderto restrict the 'Request Data Access' button rendering for admin users.TagClassBaseto manage classification filters inKnowledgePageDetailComponentfor better tag state control.ADMONITION_TYPESdefinition inregex.constants.tsand refactoredBlockEditor.constants.tsto consume the shared constant.This will update automatically on new commits.