ENG-3552: Migrate AddNewSystemModal to antd Form#8195
Merged
Conversation
Mirrors the AddVendor migration from #8156. Drops Formik/Yup and the Chakra-bound CustomTextInput / DictSuggestionTextArea / ControlledSelect / FormGuard in favor of antd Form.Item, Input, Input.TextArea, and Select. Reuses VendorSelectorAnt and keeps ConfirmCloseModal with form.isFieldsTouched() for the dirty close-guard. Public props are unchanged so the three call sites (AssignSystemModal, action-center SystemCell, system-assets AssetSystemCell) don't need edits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Kelsey-Ethyca
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-3552
Description Of Changes
Follow-up to #8156. Migrates the "Add New System" modal off Formik + Yup + Chakra wrappers to antd
Form. Reuses theVendorSelectorAntand dirty-awareConfirmCloseModalthat #8156 already shipped.Two deliberate variances from #8156's
AddVendormigration:ConfirmCloseModalis preserved. The ticket explicitly calls for swappingformik.dirtyforform.isFieldsTouched()rather than dropping the guard. The modal is reachable from three call sites (AssignSystemModal, action-centerSystemCell, system-assetsAssetSystemCell) and the unsaved-changes UX is worth keeping.isOpen,onClose,onSuccessfulSubmit,toastOnSuccess), so none of the three call sites need edits.The legacy
features/system/VendorSelector.tsxstays in place; it's still consumed bySystemInformationForm, which will migrate in a separate ticket. After that lands the legacy selector can be deleted.Code Changes
clients/admin-ui/src/features/system/AddNewSystemModal.tsxuseFormik/FormikProvider/ Yup →Form.useForm<FormValues>()+FormRule[](async uniqueness rule mirrorsAddVendor.nameRules).VendorSelector→VendorSelectorAntwithnameRulesprop. Non-dictionary branch becomes a plainForm.Item name="name"+Input.DictSuggestionTextArea→Form.Item name="description"+Input.TextAreawith an inlineuseEffectwatchingvendor_id+ the dict-suggestion redux state; on"showing"it callsform.setFieldValue("description", dictEntry.description). The legacy component is untouched (still used bySystemInformationForm).ControlledSelect mode="tags"→ antdSelect mode="tags"insideForm.Item, witharia-labelto satisfyjsx-a11y/control-has-associated-label.ConfirmCloseModal'sfooterprop. Save is gated byForm.useWatch([], form)+validateFields({ validateOnly: true })driving asubmittableboolean (same pattern asAddVendor). Save callsform.submit().ConfirmCloseModalnow reads dirty via() => form.isFieldsTouched().FormGuarddropped (matches ENG-3178: Migrate vendor / configure-consent forms to antd #8156).Steps to Confirm
These exercise the dictionary path that matches a standard local dev setup. The non-dictionary path is covered by the same
Form.Item+Inputfallback used inAddVendorafter #8156.data-testid="add-modal-content".VendorSelectorAnt'snameFieldLockedForGVL.Pre-Merge Checklist
CHANGELOG.mdupdated