Skip to content

feat(ui): extract DataProductPureUtils, DataInsightPureUtils, DataQualityPureUtils - #28701

Merged
shah-harshit merged 2 commits into
mainfrom
feat/extract-data-domain-pure-utils
Jun 5, 2026
Merged

shah-harshit merged 2 commits into
mainfrom
feat/extract-data-domain-pure-utils

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Extract pure (no-JSX, no-API, no-singleton) functions from DataProductUtils.tsx, DataInsightUtils.tsx, and DataQuality/DataQualityUtils.tsx into dedicated *PureUtils.ts files
  • Originals re-export all moved symbols for backward compat (no breaking changes)
  • All type-only imports use import type per project convention

DataProductPureUtils.ts

convertDataProductsToEntityReferences, convertEntityReferencesToDataProducts, getQueryFilterForDataProductPorts

DataInsightPureUtils.ts

getEntryFormattedValue, getGraphDataByEntityType, getFormattedActiveUsersData, getDisabledDates, getDataInsightPathWithFqn, getOptionalDataInsightTabFlag, sortEntityByValue, getRandomHexColor, isPercentageSystemGraph, getQueryFilterForDataInsightChart (+ 3 private helpers)

DataQuality/DataQualityPureUtils.ts

27 symbols: buildTestCaseParams, createUpdatedTestCasePatch, buildDataQualityDashboardFilters, getDimensionIcon, calculateTestCaseStatusCounts, transformToTestCaseStatusByDimension, and more

Ref: https://github.com/open-metadata/openmetadata-collate/issues/4230

Test plan

  • npx tsc --noEmit — zero errors in touched files
  • yarn test --testPathPattern="DataQualityUtils|DataInsightUtils|DataProductUtils" — 78/78 tests pass
  • yarn ui-checkstyle:changed — passes, prettier applied

🤖 Generated with Claude Code

shah-harshit and others added 2 commits June 4, 2026 17:25
…lityPureUtils

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]>
@shah-harshit
shah-harshit requested a review from a team as a code owner June 4, 2026 11:58
@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Jun 4, 2026
@shah-harshit shah-harshit self-assigned this Jun 4, 2026
@gitar-bot

gitar-bot Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

Refactors business logic by extracting pure functions into dedicated utility files while maintaining backward compatibility through re-exports. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.35% (67214/106083) 44.21% (36893/83437) 46.59% (11024/23658)

@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (14 flaky)

✅ 4259 passed · ❌ 0 failed · 🟡 14 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 298 0 1 4
🟡 Shard 2 801 0 2 9
🟡 Shard 3 801 0 3 8
🟡 Shard 4 851 0 3 12
🟡 Shard 5 718 0 2 47
🟡 Shard 6 790 0 3 8
🟡 14 flaky test(s) (passed on retry)
  • Pages/Policies.spec.ts › Add new policy with invalid condition (shard 1, 1 retry)
  • Features/Glossary/GlossaryHierarchy.spec.ts › should cancel move operation (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should display correct status badge color and icon (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/Workflows/WorkflowOssRestrictions.spec.ts › execution history tab loads and API call succeeds (shard 3, 1 retry)
  • Flow/ExploreAggregationCountsMatching.spec.ts › should verify left panel counts and tab search results for normal search (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Email (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Set & Update all CP types on glossaryTerm (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Tier Add, Update and Remove (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should verify deleted user not visible in owner selection for table (shard 5, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for topic -> apiEndpoint (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@shah-harshit
shah-harshit merged commit 931cb16 into main Jun 5, 2026
55 of 90 checks passed
@shah-harshit
shah-harshit deleted the feat/extract-data-domain-pure-utils branch June 5, 2026 04:42
shah-harshit added a commit that referenced this pull request Jul 14, 2026
…lityPureUtils (#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]>
shah-harshit added a commit that referenced this pull request Jul 14, 2026
* 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]>

This branch was previously deployed

1 inactive deployment
test — 94a354cd Deployed Jun 4, 2026 by shah-harshit via playwright-ci-postgresql (3, 6) #49796
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants