Repository navigation
feat(ui): extract pure service utils and widget components - #28692
Conversation
Extract 26 pure functions from ServiceUtils.tsx, ServiceInsightsTabUtils.tsx, and DatabaseServiceUtils.tsx into dedicated pure util modules. Promote getServiceInsightsWidgetPlaceholder to standalone component file. All original files re-export moved symbols for backward compatibility. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
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! |
8bb24f1 to
0d8b2e9
Compare
🟡 Playwright Results — all passed (16 flaky)✅ 4264 passed · ❌ 0 failed · 🟡 16 flaky · ⏭️ 88 skipped
🟡 16 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 |
|
Code Review ✅ ApprovedRefactors service utilities and widgets into pure modules to improve code maintainability. No issues were found and backward compatibility is maintained via existing file re-exports. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
* feat(ui): extract pure service utils and widget components Extract 26 pure functions from ServiceUtils.tsx, ServiceInsightsTabUtils.tsx, and DatabaseServiceUtils.tsx into dedicated pure util modules. Promote getServiceInsightsWidgetPlaceholder to standalone component file. All original files re-export moved symbols for backward compatibility. Co-Authored-By: Claude Opus 4.6 <[email protected]> * Fix checkstyle --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
* feat(ui): extract FeedUtilsPure from FeedUtils (#28672) * feat(ui): extract FeedUtilsPure from FeedUtils Move 31 non-JSX functions from FeedUtils.tsx to FeedUtilsPure.ts. FeedUtils.tsx re-exports all moved symbols for backward compatibility. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix checkstyle --------- Co-authored-by: Claude Opus 4.6 <[email protected]> * feat(ui): extract TablePureUtils and TagsPureUtils (#28673) * feat(ui): extract TablePureUtils and TagsPureUtils Move 43 pure functions from TableUtils.tsx to TablePureUtils.ts and 5 functions from TagsUtils.tsx to TagsPureUtils.ts. Both original files re-export all moved symbols for backward compatibility. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix checkstyle --------- Co-authored-by: Claude Opus 4.6 <[email protected]> * feat(ui): extract DataProductPureUtils, DataInsightPureUtils, DataQualityPureUtils (#28701) * feat(ui): extract DataProductPureUtils, DataInsightPureUtils, DataQualityPureUtils Move pure (no-JSX, no-API, no-singleton) functions from DataProductUtils.tsx, DataInsightUtils.tsx, and DataQualityUtils.tsx into dedicated *PureUtils.ts files. Originals re-export all moved symbols for backward compat. - DataProductPureUtils.ts: convertDataProductsToEntityReferences, convertEntityReferencesToDataProducts, getQueryFilterForDataProductPorts - DataInsightPureUtils.ts: getEntryFormattedValue, getGraphDataByEntityType, getFormattedActiveUsersData, getDisabledDates, getDataInsightPathWithFqn, getOptionalDataInsightTabFlag, sortEntityByValue, getRandomHexColor, isPercentageSystemGraph, getQueryFilterForDataInsightChart (+ 3 private helpers) - DataQualityPureUtils.ts: 27 symbols including buildTestCaseParams, createUpdatedTestCasePatch, buildDataQualityDashboardFilters, getDimensionIcon, calculateTestCaseStatusCounts, transformToTestCaseStatusByDimension, etc. All type-only imports use import type. 78 existing tests still pass. Co-Authored-By: Claude Opus 4.6 <[email protected]> * chore(ui): apply prettier formatting to PR7 pure utils files Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]> * feat(ui): extract pure service utils and widget components (#28692) * feat(ui): extract pure service utils and widget components Extract 26 pure functions from ServiceUtils.tsx, ServiceInsightsTabUtils.tsx, and DatabaseServiceUtils.tsx into dedicated pure util modules. Promote getServiceInsightsWidgetPlaceholder to standalone component file. All original files re-export moved symbols for backward compatibility. Co-Authored-By: Claude Opus 4.6 <[email protected]> * Fix checkstyle --------- Co-authored-by: Claude Opus 4.6 <[email protected]> * feat(ui): extract EntityVersion/Diff pure utils and lazy-load version components (#28687) * feat(ui): extract EntityVersion/Diff pure utils and lazy-load version components Split monolithic EntityVersionUtils.tsx (~1420 lines) into focused modules: - EntityDiffPureUtils.ts: pure diff accessor functions (no React deps) - EntityDiffUtils.tsx: JSX diff rendering functions - EntityVersionUtilsPure.ts: pure version processing logic - EntityVersionClassBase.ts: lazy-load registry for version components EntityVersionUtils.tsx re-exports all symbols for backward compatibility. EntityVersionPage now uses lazy-loaded components via EntityVersionClassBase. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(ui): replace ComponentType<any> with typed VersionComponentType in EntityVersionClassBase Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix checkstyle * fix(pr5): convert type-only imports to import type across all changed files Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix checkstyle --------- Co-authored-by: Claude Opus 4.6 <[email protected]> * fix(ui): adapt feed utils backport to 1.13 APIs * fix(ui): preserve 1.13 utility contracts * fix(ui): align feed utils test mock with split helper * fix(ui): scope feed count helpers for 1.13 --------- Co-authored-by: Claude Opus 4.6 <[email protected]>



Summary
ServiceUtils.tsx→ServicePureUtils.tsServiceInsightsTabUtils.tsx→ServiceInsightsTabPureUtils.tsgetServiceInsightsWidgetPlaceholdercomponent →ServiceInsightsWidgets.tsxgetDatabaseConfig+ schema loaders fromDatabaseServiceUtils.tsx→DatabaseServicePureUtils.tsExtracted Modules
ServicePureUtils.ts (16 functions)
getIngestionName,shouldTestConnection,getServiceType,getServiceTypesFromServiceCategory,getServiceRouteFromServiceType,getSearchIndexForService,getResourceEntityFromServiceCategory,getCountLabel,getTestConnectionName,getServiceCategoryFromEntityType,getEntityTypeFromServiceCategory,getServiceDisplayNameQueryFilter,getServiceNameQueryFilter,getActiveFieldNameForAppDocs,getReadableCountString,getSearchIndexFromServiceServiceInsightsTabPureUtils.ts (7 functions)
getAssetsByServiceType,getTitleByChartType,getChartTypeForWidget,getPlatformInsightsChartDataFormattingMethod,filterDistributionChartItem,getChartsDataFromWidgetName,getAutoPilotIngestionPipelinesServiceInsightsWidgets.tsx (1 component)
getServiceInsightsWidgetPlaceholderDatabaseServicePureUtils.ts (1 export + private helpers)
getDatabaseConfig,databaseSchemaLoaders,resolveSchemaModuleRetained (impure/JSX)
getOptionalFieldsgetLinkForFqngetAddServiceEntityBreadcrumbsearchServiceByExactNamevalidateServiceNameprocessDocMarkdowngetFormattedTotalAssetsDataFromSocketDataExtraDatabaseServiceDropdownOptionsRef: https://github.com/open-metadata/openmetadata-collate/issues/4230
Test plan
npx tsc --noEmit— 0 errors in changed files🤖 Generated with Claude Code