feat(ui): update Domain & Glossary components for lazy-load utility pattern#29065
Conversation
…attern Updates Domain and Glossary components to import from extracted pure utility modules. Updates DomainUtils, GlossaryUtils, ClassificationUtils, TagsUtils imports. Updates Tag components and pages for consistent utility usage. Ref: open-metadata/openmetadata-collate#4230 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 |
|
🟡 Playwright Results — all passed (12 flaky)✅ 4286 passed · ❌ 0 failed · 🟡 12 flaky · ⏭️ 88 skipped
🟡 12 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 2 resolved / 2 findingsRefactors Domain and Glossary components to use pure utility modules but currently breaks the build due to broken imports in EntityTagUtils.ts and unresolved merge conflict markers in LazyDomainComponents.tsx. ✅ 2 resolved✅ Quality: New LazyDomainComponents.tsx is unused dead code
✅ Bug: Unresolved merge conflict markers in LazyDomainComponents.tsx
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |



Summary
Ref: open-metadata/openmetadata-collate#4230
Greptile Summary
This PR systematically removes barrel re-exports from
GlossaryUtils,TagsUtils,DomainUtils, andClassificationUtils, requiring callers to import pure utility functions directly from their*PureUtilssource modules. The change also updatesGenericProvider/GenericContextimport paths and corrects several test mocks to target the right modules.GlossaryPureUtils,TagsPureUtils,DomainFilterUtils,ClassificationPureUtils,FeedUtilsPure,SearchPureUtils, andEntityDiffPureUtilsinstead of their barrel counterparts.GlossaryTermTab.test.tsxnow spreadsjest.requireActual('GlossaryPureUtils'), restoringpermissionForApproveOrRejectand other previously missing symbols;GlossaryTermsV1.test.tsxand several others properly splitGenericContext/GenericProvidermocks.EntityTagUtils.ts(not in the PR) still importsgetTableTagsfromTagsUtilswhose re-export was removed here, causing a TypeScript compile error.Confidence Score: 4/5
Safe to merge once EntityTagUtils.ts is updated to import getTableTags from TagsPureUtils; without that fix the TypeScript build will fail.
The vast majority of the 89-file migration is correct and consistent. One file outside the PR's diff — EntityTagUtils.ts — still imports getTableTags from TagsUtils, whose re-export was deleted here. This will produce a TypeScript compile error at build time. Everything else, including the previously flagged missing permissionForApproveOrReject mock and the stale GlossaryUtils/TasksUtils imports, is properly addressed.
openmetadata-ui/src/main/resources/ui/src/utils/EntityTagUtils.ts — its getTableTags import from TagsUtils will break after this PR's re-export removal.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD subgraph Before["Before (barrel re-exports)"] GU["GlossaryUtils.tsx\n(re-exports GlossaryPureUtils)"] TU["TagsUtils.tsx\n(re-exports TagsPureUtils)"] DU["DomainUtils.tsx\n(re-exports DomainFilterUtils)"] CU["ClassificationUtils.tsx\n(re-exports ClassificationPureUtils)"] Callers1["Components / Pages"] --> GU & TU & DU & CU end subgraph After["After (direct imports)"] GPU["GlossaryPureUtils"] TPU["TagsPureUtils"] DFU["DomainFilterUtils"] CPU["ClassificationPureUtils"] GU2["GlossaryUtils.tsx\n(own exports only)"] TU2["TagsUtils.tsx\n(own exports only)"] Callers2["Components / Pages"] Callers2 --> GPU & TPU & DFU & CPU Callers2 --> GU2 & TU2 ETU["EntityTagUtils.ts\n❌ still imports getTableTags\nfrom TagsUtils"] ETU -. compile error .-> TU2 end%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD subgraph Before["Before (barrel re-exports)"] GU["GlossaryUtils.tsx\n(re-exports GlossaryPureUtils)"] TU["TagsUtils.tsx\n(re-exports TagsPureUtils)"] DU["DomainUtils.tsx\n(re-exports DomainFilterUtils)"] CU["ClassificationUtils.tsx\n(re-exports ClassificationPureUtils)"] Callers1["Components / Pages"] --> GU & TU & DU & CU end subgraph After["After (direct imports)"] GPU["GlossaryPureUtils"] TPU["TagsPureUtils"] DFU["DomainFilterUtils"] CPU["ClassificationPureUtils"] GU2["GlossaryUtils.tsx\n(own exports only)"] TU2["TagsUtils.tsx\n(own exports only)"] Callers2["Components / Pages"] Callers2 --> GPU & TPU & DFU & CPU Callers2 --> GU2 & TU2 ETU["EntityTagUtils.ts\n❌ still imports getTableTags\nfrom TagsUtils"] ETU -. compile error .-> TU2 endComments Outside Diff (1)
openmetadata-ui/src/main/resources/ui/src/utils/GlossaryUtils.tsx, line 33-50 (link)The re-exports removed from
GlossaryUtilsandTagsUtilsin this PR are still imported from the old modules by at least five files not touched here, causing a compile/runtime break:src/components/common/AsyncSelectList/TreeAsyncSelectList.tsximportsfilterTreeNodeOptionsandfindItemByFqnfromGlossaryUtils(line 53–57)src/utils/TasksUtils.tsimportsgetGlossaryBreadcrumbsfromGlossaryUtils(line 102)src/components/common/AsyncSelectList/AsyncSelectList.tsximportsgetTagDisplayfromTagsUtils(line 38)src/components/common/TagSuggestion/TagSuggestion.tsximportsgetTagDisplayfromTagsUtils(line 29)src/components/KnowledgeCenter/QuickLinkFormModal/QuickLinkFormModal.tsximportsgetTagDisplayfromTagsUtilsAll three of these symbols (
filterTreeNodeOptions,findItemByFqn,getTagDisplay) were among the re-exports removed in this PR. These callers need to be updated to import directly fromGlossaryPureUtils/TagsPureUtils, or the re-exports need to be kept until all consumers are migrated.Reviews (4): Last reviewed commit: "Fix conflicts" | Re-trigger Greptile
Summary by Gitar
GenericContextcreation fromGenericProviderby migrating to a dedicatedGenericContextmodule and removed unnecessaryoncewrappers.useGenericContextandGenericProviderfrom their new respective locations.This will update automatically on new commits.