ref(forms): Migrate CreateTeamForm to TanStack form system#115991
Draft
priscilawebdev wants to merge 1 commit into
Draft
ref(forms): Migrate CreateTeamForm to TanStack form system#115991priscilawebdev wants to merge 1 commit into
priscilawebdev wants to merge 1 commit into
Conversation
Replace the legacy Form/TextField with useScrapsForm and field.Input. The form now drives validation via a zod schema and the SubmitButton handles busy/disabled state through the form context. Simplify the onSubmit prop signature — the legacy (data, onSuccess, onError) callbacks were FormModel-internal hooks for state tracking, which the new form handles itself. The createTeam action creator already surfaces success/error toasts, so the modal just awaits the mutation and closes on success. The unused organization prop on CreateTeamForm is dropped along with it. Refs DE-1256 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.61% |
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.
Migrate
CreateTeamFormfrom the legacyForm/TextFieldtouseScrapsFormwithfield.Inputandform.SubmitButton. Validation moves to a zod schema, and the busy/disabled state is driven by the form rather than the legacyFormModel.While here, simplify the
onSubmitprop. The legacy(data, onSuccess, onError) => voidsignature exposed FormModel-internal completion hooks; the new form tracks submitting/error state itself, so the prop becomes a plain(data) => Promise<…>.createTeamalready surfaces success/error toasts, so the modal just awaits and closes on success. The unusedorganizationprop onCreateTeamFormdrops out at the same time.slugifystill runs on every keystroke, just viaonChange={value => field.handleChange(slugify(value))}instead of the legacytransformInputprop.Refs DE-1256