Repository navigation
Fixes #35212: Migrate the Data Contract tab from Ant Design to core components - #35217
Conversation
Migrate the contract forms (details, SLA, security, semantics) from antd Form to the react-hook-form + core field stack, and the tab shell, view switch, buttons and icons to @openmetadata/ui-core-components. Each form still reports the same partial-contract payload, and only user edits are reported so seeding a form does not mark untouched fields as changed. Share the step panel and Previous/Next footer through ContractFormStep, drop the dead antd LESS overrides, prune the matching antd and positional ESLint suppressions, and update the Playwright helpers and specs to drive the core controls.
Saving through form.trigger() left the form unsubmitted, so react-hook-form never re-validated afterwards and "Rule is required" stayed on screen after the rule was completed. Save through handleSubmit so later changes clear or re-show each error, as the antd form did.
…xport spec The contract title and SLA number fields keep their test id on the field wrapper, and the SLA units are core Selects, so fill the inner input and pick units through selectDropdownOption, as the other contract specs do.
…e impact map Route components/DataContract and utils/DataContract to the contract and ODCS specs, and map eslint-suppressions.json to no specs, so a change to either no longer escalates the planner to a full-suite run.
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
|
| Count | Rule |
|---|---|
| 26 | react-hooks/exhaustive-deps |
| 13 | openmetadata-ui-patterns/no-non-adaptive-palette |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/DataContract/AddDataContract/AddDataContract.tsx:315:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'onSave' and 't'. Either include them or remove the dependency array. If 'onSave' changes too often, find the p |
| 🟡 | src/components/DataContract/AddDataContract/AddDataContract.tsx:530:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx:104:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'form' and 'toFormValues'. Either include them or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:179:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:197:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:213:9 |
react-hooks/exhaustive-deps |
The 'handleRunNow' function makes the dependencies of useCallback Hook (at line 280) change on every render. To fix this, wrap the definition of 'handleRunNow' |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:392:41 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-gray-700" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-gray-700) or a semant |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:442:41 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-error-600" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-error-600) or a sema |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:446:41 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-error-600" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-error-600) or a sema |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:546:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has unnecessary dependencies: 'handleRunNow' and 'validateLoading'. Either exclude them or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:563:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchLatestContractResults'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:598:42 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-gray-500" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-gray-500) or a semant |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:632:33 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-gray-700" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-gray-700) or a semant |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:648:33 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-gray-700" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-gray-700) or a semant |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:669:30 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:686:30 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:705:30 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:724:30 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:804:42 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:858:44 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:876:40 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractQualityCard/ContractQualityCard.component.tsx:117:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'fetchTestCaseSummary' and 'fetchTestCases'. Either include them or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractQualityFormTab/ContractQualityFormTab.tsx:93:9 |
react-hooks/exhaustive-deps |
The 'fetchAllTests' function makes the dependencies of useCallback Hook (at line 127) change on every render. To fix this, wrap the definition of 'fetchAllTests |
| 🟡 | src/components/DataContract/ContractQualityFormTab/ContractQualityFormTab.tsx:93:9 |
react-hooks/exhaustive-deps |
The 'fetchAllTests' function makes the dependencies of useCallback Hook (at line 141) change on every render. To fix this, wrap the definition of 'fetchAllTests |
| 🟡 | src/components/DataContract/ContractQualityFormTab/ContractQualityFormTab.tsx:166:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractQualityFormTab/ContractQualityFormTab.tsx:210:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchAllTests'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSLACard/ContractSLA.component.tsx:186:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSLAFormTab/ContractSLAFormTab.tsx:202:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'form' and 'toFormValues'. Either include them or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx:158:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'entityType'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx:199:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx:241:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'oldRemovedColumns' and 'selectedSchema'. Either include them or remove the dependency array. If 'setAllColumns |
| 🟡 | src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx:269:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'oldRemovedColumns' and 'selectedSchema'. Either include them or remove the dependency array. If 'setAllColumns |
| 🟡 | src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx:271:9 |
react-hooks/exhaustive-deps |
The 'fetchApiEndPointColumns' function makes the dependencies of useCallback Hook (at line 327) change on every render. Move it inside the useCallback callback. |
| 🟡 | src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx:493:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx:533:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchColumnsBasedOnEntity'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSchemaTable/ContractSchemaTable.component.tsx:135:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSecurityFormTab/ContractSecurityFormTab.tsx:365:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'columnItems' and 'form'. Either include them or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSemanticFormTab/ContractSemanticFormTab.tsx:114:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'form'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractSemanticFormTab/ContractSemanticFormTab.tsx:118:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'onChange'. Either include it or remove the dependency array. If 'onChange' changes too often, find the parent co |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changedtw-guard rejects new imports of raw SVGs from assets/svg; the step footer's Previous and Next arrows now come from @openmetadata/ui-core-components/icons.
…rom bundle boot list
chirag-madlani
left a comment
There was a problem hiding this comment.
@anuj-kumary drop custom style from core-components
Adds a secondary colour and an optional header divider to core Card so the step panel needs no local style overrides.
…re-components # Conflicts: # openmetadata-ui/src/main/resources/ui/eslint-rules/openmetadata-antd.test.mjs # openmetadata-ui/src/main/resources/ui/eslint-suppressions.json # openmetadata-ui/src/main/resources/ui/src/components/DataContract/AddDataContract/AddDataContract.tsx # openmetadata-ui/src/main/resources/ui/src/components/DataContract/AddDataContract/add-data-contract.less # openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx # openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractQualityFormTab/ContractQualityFormTab.tsx # openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSLAFormTab/ContractSLAFormTab.tsx # openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx # openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSecurityFormTab/ContractSecurityFormTab.tsx # openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSemanticFormTab/ContractSemanticFormTab.tsx # openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSemanticFormTab/contract-semantic-form-tab.less # openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractTermOfService/ContractTermsOfService.component.tsx
Also drops a dead RAQB selector block and names the schema tab's default import after the component it actually imports.
🚦 Removed from the merge queue —
|
Both conflicts were lint-suppression baselines. Resolved to the counts the merged eslint-suppressions.json actually holds (antd 674, positional locators 585), not to either side's number. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
🚦 Removed from the merge queue —
|
main's #35226 migrated antd Button to core components in the same Data Contract files this branch rewrites, so the DataContract conflicts resolve to this branch's version, which supersedes it (main's new aria-labels are already present here). The lint-suppression baselines were regenerated with --prune-suppressions from the merge-base copy rather than hand-merged: both sides only removed entries, so the base is a strict superset and pruning yields the exact counts for the merged tree (antd 514, positional locators 584). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
🚦 Removed from the merge queue —
|
Only the antd suppression baseline conflicted. Both sides again only removed entries, so the merge base is a strict superset: restored it and regenerated with --prune-suppressions, giving 509 antd symbols for the merged tree. The playwright counts are unchanged at 584. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · Migrating contract forms to react-hook-form changes how security, SLA, and semantic values are collected and serialized, which could save incomplete or altered contract metadata. Migrates the Data Contract tab from Ant Design to ✅ 1 closedClosed: Quality: Card move changes contract step panel padding from 20px
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledOptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Resolve conflicts with the Modal/Button freeze (#35226), the Data Contract (#35217), Add Assets (#35242) and Applications settings (#35179) migrations. Where main already migrated a file, keep main's version and drop this branch's duplicate (DataContract SLA/view switch, AssetSelectionContentBody, TableDataCardV2, AppLogsViewer, ReindexFailures). Elsewhere keep this branch's migration and port main's core Button changes onto it.



Describe your changes:
Fixes #35212
Moves the Data Contract tab (on data assets and on Data Products) off Ant Design and onto
@openmetadata/ui-core-components. After this PR no file undercomponents/DataContractimports antd, and the tab's.ant-*LESS overrides are gone.Form/Form.Listwith core fields.InputNumber, tag-modeSelect,TimePicker,Input,TextArea.AddDataContract.ContractFormStepcomponent.CardandButton.ButtonGroup.Iconwrappers are replaced by plain SVGs..ant-*/.anticonLESS rules and two LESS files.no-antd-importsuppressions and twono-positional-locatorsuppressions.RuleObjecttype fromDataContractUtils.Type of change:
High-level design:
Approach. Each tab keeps its public props (
initialValues,onChange,onNext,onPrev,buttonProps), soAddDataContract's orchestration and save logic are unchanged. Inside, each tab owns auseFormand maps between form values and the contract shape with small pure functions.Rules the forms keep:
watchsubscription forwards changes withtype === 'change'only. Seeding or resetting a form frominitialValuesreports nothing, which preserves the fix covered byDisplayNameOverwriteBug.test.tsx: antd'ssetFieldsValuenever firedonValuesChange.form.handleSubmit, so each later change clears or re-shows its error, as the antd form did.Inputtrims its value on blur, so numbers are converted when the SLA object is built.useUserTeamOptionssearch and owner-rule check as the Glossary form.#semantics_<n>_name,#timezoneand#columnName-select.User-visible differences (intentional):
.anticonCSS that no longer applies.Kept as is:
AddDataContract: nothing renders a mode switch there, so it is unreachable. It is kept and only its card migrated.TableUtils.getTableExpandableConfig) and the sharedQueryBuilderstyles stay; both are used app-wide.Visual parity. The old (antd,
main) and new forms were measured side by side in the same browser:Card:ContractFormStepis built onCard+Card.Header+Card.Content, so the oldtw:p-5 tw:gap-5(20px all round, 20px between header and body) becomes themdsizetw:px-6 tw:py-3(24px sides, 12px top/bottom, 24px between). This is deliberate and not overridden at the call site, per ADR:2026-10-11-migrated-antd-components-adopt-core-styling. The two gaps the core API could not express are fixed in the core component instead:Cardgains asecondarycolour andCard.HeaderahasDividerprop.Autocompleteis fixed at 36px (antd used 40px), and the core label-to-input gap is 6px (antd used 8px).Playwright impact map. Adds a hand-authored entry routing
components/DataContract/**andutils/DataContract/**to the six contract/ODCS specs. It also mapseslint-suppressions.jsonto no specs, as is already done foropenmetadata-integration-tests/**, so pruning the lint baseline no longer escalates to a full-suite run.Tests:
Use cases covered
displayName.0).Unit tests
npx jest src/components/DataContract src/utils/DataContract: 22 suites, 442 tests passed.Rewritten suites: tests that asserted antd internals now assert behaviour.
ContractDetailFormTab,ContractSLAFormTab,ContractViewSwitchTab.ContractSecurityFormTab,ContractSemanticFormTab,ContractSemanticsandContractSLA.Regression tests added:
onChangeis reported on mount.0.trigger()implementation.Line coverage on changed components (
--coverage): 88.6% overall.ContractFormStepContractViewSwitchTabContractSemanticsContractQualityCardContractSchemaTableContractSLAFormTabContractDetailContractSLAContractSecurityFormTabContractDetailFormTabContractQualityFormTabContractSemanticFormTabAddDataContractContractTermsOfServiceContractScehmaFormTabContractScehmaFormTabonly had its panel and buttons swapped; its untested table logic is unchanged and was uncovered before this PR.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
playwright/utils/dataContracts.tswith helpers for the core fields:fillContractName,selectContractStatus,selectContractOwners.pickContractAutocompleteOption,fillContractAvailabilityTime,expectContractAvailabilityTime.DataContracts.spec.ts,DataContractInheritance.spec.tsandODCSImportExport.spec.ts. Two data bugs in the Inheritance spec, previously hidden because the antd select ignored them, are fixed:GMT+00:00 (UTC)timezone that is not aTimezonevalue;CI: Postgresql PR Playwright E2E Tests, run 38160895854 passed on
e370f77a364.Local (upstream dev server for this branch, against a local backend):
DataContractInheritance.spec.ts: 8/8 passed.ODCSImportExport.spec.ts: 49/49 passed.DataContractSLAValidation.spec.ts: 1/1 passed.DataContracts.spec.ts(selected tests), all passed:@ingestionquality step, which needs a pipeline runner that the local stack does not have.DataContractsSemanticRules.spec.tsplus the semantic tests inDataContracts.spec.ts: 44/47 passed.assignTier, the entity-page tier picker this PR does not touch, because of leftover tier tags in the local database. Both pass in the CI run above.Manual testing performed
npx vite) against a local backend on:8585and signed in as admin.main) and a deployed environment, and matched fonts and spacing as described under High-level design.UI screen recording:
Screen.Recording.2026-10-11.at.6.29.23.PM.mov
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code