feat(ui): extract remaining pure utils #28791
Conversation
Extract pure functions from 12 utility files into dedicated *PureUtils.ts files. Original files re-export all moved symbols for backward compatibility. New pure util files: - AgentsStatusWidgetPureUtils.ts (getAgentLabelFromType, getAgentStatusLabelFromStatus, getAgentStatusSummary) - Alerts/AlertsUtilPure.ts (20 pure alert helpers) - BlockEditorPureUtils.ts (pure block editor utils) - ContainerDetailPureUtils.ts (pure container detail utils) - ContextCenterPureUtils.ts (pure context center utils) - CuratedAssetsPureUtils.ts (pure curated assets utils) - CustomizableLandingPagePureUtils.ts (pure landing page utils) - CustomizePage/CustomizePagePureUtils.ts (pure customize page utils) - DataAssetSummaryPanelPureUtils.ts (pure data asset summary utils) - CSV/CSVPureUtils.ts (pure CSV processing utils) - Lineage/LineagePureUtils.ts (pure lineage utils) - MetricEntityUtils/MetricPureUtils.ts (pure metric utils) - UsersPureUtils.ts (pure user utils) 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! |
Remove isHTMLString, _convertMarkdownFormatToHtmlString, formatContentForClient from BlockEditorPureUtils.ts — all three are duplicates of code in BlockEditorUtils.ts, none were re-exported or consumed anywhere. Pure file now contains only isDescriptionContentEmpty and getTextFromHtmlString. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getTierTags moved to TablePureUtils.ts; test was mocking TableUtils (old path) causing the mock to be ignored and the assertion to fail. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolved conflict in ContextCenterUtils.tsx: main added functions that our branch already moved to ContextCenterPureUtils.ts — kept re-export facade. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
🟡 Playwright Results — all passed (13 flaky)✅ 4270 passed · ❌ 0 failed · 🟡 13 flaky · ⏭️ 88 skipped
🟡 13 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 ✅ Approved 1 resolved / 1 findingsRefactors 13 utility files by extracting pure logic into dedicated modules with backward-compatible re-exports. Address the duplicate and dead code introduced in ✅ 1 resolved✅ Quality: BlockEditorPureUtils adds duplicate/divergent + dead code
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |



Summary
Extract pure (no-React, no-side-effects) functions from 12 large utility files into dedicated
*PureUtils.tsmodules. All original files re-export every moved symbol for full backward compatibility.New pure util files
AgentsStatusWidgetPureUtils.tsAgentsStatusWidgetUtils.tsxgetAgentLabelFromType,getAgentStatusLabelFromStatus,getAgentStatusSummaryAlerts/AlertsUtilPure.tsAlerts/AlertsUtil.tsxBlockEditorPureUtils.tsBlockEditorUtils.tsContainerDetailPureUtils.tsContainerDetailUtils.tsxContextCenterPureUtils.tsContextCenterUtils.tsxCuratedAssetsPureUtils.tsCuratedAssetsUtils.tsxCustomizableLandingPagePureUtils.tsCustomizableLandingPageUtils.tsxCustomizePage/CustomizePagePureUtils.tsCustomizePage/CustomizePageUtils.tsDataAssetSummaryPanelPureUtils.tsDataAssetSummaryPanelUtils.tsxgetTableFieldsFromTableDetails,getUsageDataCSV/CSVPureUtils.tsCSV/CSV.utils.tsxLineage/LineagePureUtils.tsLineage/LineageUtils.tsxMetricEntityUtils/MetricPureUtils.tsMetricEntityUtils/MetricUtils.tsxUsersPureUtils.tsUsers.util.tsxGuidelines followed
export { fn } from './XxxPureUtils')import typeused for all type-only importsTest plan
npx tsc --noEmitpasses (no new errors in changed files)🤖 Generated with Claude Code