Repository navigation
Migrate settings and admin forms from antd Form to core HookForm - #35285
shah-harshit wants to merge 32 commits into
Conversation
|
✅ SSO Login Nightly — PASSED View workflow run · Commit
Totals: 94 passed · 0 failed · 0 flaky · 0 skipped · duration 19m 28s |
…arch
The navbar search-index select is now the core Select, which renders a
hidden native <select> whose options (Table, Topic, Data Product, ...)
match the Customize UI card titles, so page-wide getByText(type, { exact })
lookups resolve to two elements. Give the CustomizeUI grid a test id and
scope the card lookups to it.
LineageControls still filled the antd .ant-select-selection-search-input;
fill the core combobox inside search-entity-select instead.
getByTitle('All').nth(1) relied on the antd navbar search-index select
contributing the first title="All"; with the core Select there is only
one, so nth(1) never resolved and the TestCase filters test timed out.
Scope the click to the open antd dropdown instead, and prune the now
unused positional-locator suppression.
ProfileEditModal, LineageConfigModal, TestEmail, ChangePasswordForm, ModalWithQueryEditor and ModalWithFunctionEditor now use react-hook-form with core FormFields/FormField and core Input/PasswordInput. Core: FieldPropsMap gains inputDataTestId so Input-based fields keep test ids on the inner input, and PasswordInput forwards inputDataTestId.
- Login/URL configuration pages use core FormFields/Input; numbers are converted on submit, and doc-panel focus tracking moves to a wrapper. - Add policy, add rule and edit rule reuse the core AccessControlRuleForm; the classic antd RuleForm is deleted. - Add role uses a core Input and an Autocomplete for policies. - Form.constants gains react-hook-form name/display-name rules. - Policies and Roles specs drive the core controls.
…okForm EmailConfigForm reuses the AI email-settings mappers; AddTeamForm, AuthMechanismForm and CreateUser move to react-hook-form with core Input/Select/Autocomplete/Toggle. getJWTTokenExpiryOptions now returns core select items. E2E helpers switch to role locators, and the antd/positional suppression baselines shrink accordingly.
…ost dialog AddEditPersonaForm moves to react-hook-form; its edit branch was unreachable (the page only opens it empty) and is dropped. The classic search settings pages now render the AI-mode FieldValueBoostDialog, so the antd FieldValueBoostModal is removed.
… with classic settings The add-custom-property fields move out of the AI CustomPropertiesAddPage into a shared CustomPropertyFormFields component plus payload utils, and the classic AddCustomProperty drawer/page now renders them on react-hook-form. The classic permission debugger page renders the AI AccessControlDebuggerPanel instead of its antd copy.
AppearanceConfigSettingsPage drives its fields through react-hook-form; a primary colour change regenerates the hover and selected shades via a watch subscription. The profile sample field loses its layout-only antd Form.Item.
…awer The AI learning-resource field list moves into useLearningResourceFields; the classic LearningResourceForm drawer now renders it on react-hook-form and reuses the AI payload mappers.
…Form validation HookForm now defaults to react-aria's aria validation, so native required attributes no longer block submit before react-hook-form can report inline errors. AddQueryPage and both KPI pages move to react-hook-form; the KPI pages share KPIFormFields. The semantics tab validates its editor by explicit field paths.
…Form TableConstraintsModal becomes react-hook-form with a foreign-key field array, core Autocomplete key pickers and an async ComboBox for the related column; its saved-constraints parsing moves to TableConstraintsModal.utils. Playwright helpers switch to role locators.
Only the general fields are form-managed (the designer keeps the schema state), so loading a template no longer risks spreading stale schema values. Builder, transition and stage editors use core Input/Select/TextArea/Autocomplete.
The rule condition combobox now allows custom values, so react-aria no longer resets the typed expression on blur and drops it from the saved rule. CreateUser's bot fields take control as a prop: HookForm's provider belongs to the core package's react-hook-form copy, so useFormContext() in the app returned null and crashed the add-bot page. AddRoleAndAssignToUser picks policies by role.
Core Toggle caps its width at the container so a long hint wraps instead of overflowing (the bot form's impersonation hint ran off the card). The table constraint modal's add button keeps its content width and the related-column combobox drops the shortcut hint. The task form grid span is escaped so LESS stops computing 1 / -1 into -1, which put Description in a third column.
Percentage KPI targets are validated to 0-100 again, as the antd InputNumber max did. Two decision records capture rules the PR description stated only in prose: classic forms reuse the AI-mode core form when one exists, and inside HookForm react-hook-form rules are the only validation that blocks submit.
🔄 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 |
Code Review ✅ Approved 3 closed / 3 findings🔴 High risk · Migrating role and policy forms changes authorization configuration, so value-mapping or validation differences could grant unintended access. Migrates settings and admin forms from antd ✅ 3 closed✅ Quality: Classic-reuses-AI-core-form rule exists only in the PR description
✅ Edge Case: Percentage KPI target no longer capped at 100
✅ Quality: HookForm now makes
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
|
|
Combined into #35280 to go through the merge queue once. All commits, review fixes, screenshots and test results from this PR are carried over there. |



Describe your changes:
Part of open-metadata/openmetadata-collate#6893 (epic open-metadata/openmetadata-collate#6884).
PR 2 of 3 for the Form / Select / Input migration: settings and admin forms move from antd
Formtoreact-hook-form+@openmetadata/ui-core-components(HookForm,FormField,FormFields,Input,Select,Autocomplete,TimePicker).Type of change:
High-level design:
Where AI mode already had a core version of a form, the classic page now reuses it instead of keeping a second antd copy:
AccessControlRuleFormfor add/edit rule (classicRuleFormdeleted)EmailConfigFormFieldValueBoostDialogin classic search settings (classicFieldValueBoostModaldeleted)AccessControlDebuggerPanelin the classic permission debugger pageCustomPropertyFormFields+ payload utils (extracted from the AI add page) for the classic add-custom-property drawer/pageuseLearningResourceFieldsfor the classic learning-resource drawerMigrated in place:
ProfileEditModal,LineageConfigModal,TestEmail,ChangePasswordForm,ModalWithQueryEditor,ModalWithFunctionEditorAppearanceConfigSettingsPage), data asset rulesCreateUser,AddTeamForm,AuthMechanismForm, team email + subscription,AddEditPersonaForm(its unreachable edit branch dropped)AddQueryPage,AddKPIPage/EditKPIPage(sharedKPIFormFields),LineageConfigPage,TableConstraintsModal(foreign-key field array; parsing inTableConstraintsModal.utils),TaskFormSettingsPage+TaskFormBuilderSectionCore:
inputDataTestIdadded toFieldPropsMap;PasswordInputforwards it.HookFormdefaults to react-ariavalidationBehavior="aria", so a nativerequiredno longer blocks submit before react-hook-form can show inline errors (covered byhook-form.test.tsx).Playwright helpers move from antd class selectors to role-based locators for the touched forms; antd/positional suppression baselines shrink accordingly.
Behaviour changes:
InputNumbermax used to clamp it).Screenshots (light, classic mode — before =
main, after = this branch):main)Testing:
yarn ui-checkstyle:changed,yarn lint:playwright,yarn test:eslint-rules, rule-table check: passjest --findRelatedTestson changed files: 883 suites / 11,393 tests passvitest run: 77 files / 797 tests passtscon changed files: clean (one pre-existing error inEntitySearchSettings.tsxuntouched)Checklist: