Repository navigation
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 <[email protected]>
❌ 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 <[email protected]>
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 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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 <[email protected]>
|
🟡 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 |
* feat(ui): extract remaining pure utils (PR #12) 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 <[email protected]> * fix checkstyle * fix: drop dead duplicate code from BlockEditorPureUtils 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 <[email protected]> * fix(test): update DataAssetSummaryPanelUtils test to mock TablePureUtils 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 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
* feat(ui): extract form/search etc pure utils (#28704) * feat(ui): extract form/search/query/advanced-search/explore/classification/tags/glossary/knowledge-page pure utils Create *PureUtils.ts files for framework-independent logic extracted from: - formUtils.tsx → formPureUtils.ts (transformErrors, getPopupContainer, etc.) - SearchUtils.tsx → SearchPureUtils.ts (getEntityTypeFromSearchIndex, parseBucketsData, getTermQuery) - QueryBuilderUtils.tsx → QueryBuilderPureUtils.ts (all non-JSX query builder logic) - AdvancedSearchUtils.tsx → AdvancedSearchPureUtils.ts (filter/option builders) - ExploreUtils.tsx → ExplorePureUtils.ts (URL parsing, tree/filter utils) - ClassificationUtils.tsx → ClassificationPureUtils.ts (getDeleteButtonData, getClassificationInfo) - TagsUtils.tsx → TagsPureUtils.ts (tag creation/query/redirect helpers) - GlossaryUtils.tsx → GlossaryPureUtils.ts (tree builders, breadcrumbs, validators) - KnowledgePageUtils.tsx → KnowledgePagePureUtils.ts (page hierarchy/path/tree utils) Original files retain JSX/singleton functions and re-export all pure symbols for backward compat. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(ui): import getTermQuery from SearchPureUtils and getQueryFilterToIncludeApprovedTerm from GlossaryPureUtils TagsPureUtils was importing from SearchUtils.tsx (React/SVG-heavy) and TagsUtils.tsx from GlossaryUtils instead of their pure counterparts, defeating the purity goal. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]> * feat(ui): extract EntitySort/Permission/Column/Breadcrumb/SummaryPanel etc pure utils (#28740) * feat(ui): extract EntitySortUtils, EntityPermissionUtils, EntityVoteUtils, 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 <[email protected]> * feat(ui): extract EntitySortUtils, EntityPermissionUtils, EntityVoteUtils, 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 <[email protected]> * fix: remove unused EntityLinkUtils.ts (all exports are duplicates of EntityPureUtils/EntityBreadcrumbPureUtils) No consumers anywhere in the codebase. 7 of 10 exports already exist in EntityPureUtils.ts, getEntityLinkFromType already in EntityBreadcrumbPureUtils.ts. Deleting avoids dual-copy maintenance hazard. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]> * feat(ui): lazy-load all SettingsRouter, EntityRouter, and EntityImportRouter pages (PR #14) (#28797) Convert 47 eager page/component imports in SettingsRouter.tsx to React.lazy() + withSuspenseFallback() so the settings chunk is not part of the main bundle. Also lazify EntityVersionPage in EntityRouter and BulkEntityImportPage in EntityImportRouter. - SettingsRouter.tsx: 47 imports → React.lazy() with webpack chunk splitting - EntityRouter.tsx: EntityVersionPage → lazy - EntityImportRouter.tsx: BulkEntityImportPage → lazy - Named exports use .then((m) => ({ default: m.X })) pattern Co-authored-by: Claude Sonnet 4.6 <[email protected]> * feat(ui): extract database/schema/table tab utils and config utils (#28792) * feat(ui): extract database/schema/table/ingestion tab and config utils (PR #13) Extract tab components and config utils from large source files into dedicated modules. Original files re-export all moved symbols for backward compatibility. New files: - Database/DatabaseDropdownOptions.tsx (database dropdown option builders) - Database/DatabaseTabsUtils.tsx (database page tab definitions) - DatabaseSchemaDropdownOptions.tsx (schema dropdown option builders) - DatabaseSchemaTabsUtils.tsx (schema page tab definitions) - TableDropdownOptions.tsx (table dropdown option builders) - TableTabsUtils.tsx (table page tab definitions) - IngestionConfigUtils.ts (ingestion configuration pure utils) - CronExpressionUtils.ts (cron schedule/expression utils) - DomainFilterUtils.ts (domain filter query builders) Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix: import getDayCron from CronExpressionUtils instead of SchedularUtils Removes transitive React/antd dependency from pure util IngestionConfigUtils.ts. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix checkstyle --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]> * feat(ui): extract remaining pure utils (#28791) * feat(ui): extract remaining pure utils (PR #12) 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 <[email protected]> * fix checkstyle * fix: drop dead duplicate code from BlockEditorPureUtils 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 <[email protected]> * fix(test): update DataAssetSummaryPanelUtils test to mock TablePureUtils 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 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]> * fix(ui): run checkstyle for group 3 backport * fix(ui): preserve glossary approval task threads in 1.13 * fix(ui): preserve assignee priority for glossary approvals --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>



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