Conversation
Contributor
Author
|
@narcisonunez this pr is ready for review. |
3 tasks
This branch has not been deployed
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.
What is this PR about?
The Add user invitation form was resetting when a submission error occurred (e.g. "email already has an account"). This happened because the form reset logic relied on
isSubmitSuccessful, which triggered even when errors were caught.What has changed (Fixes):
Why this matters (Intent)
When a user selects the "Initial Credentials" flow, their clear intent is to create a new user using an email and password. If they enter an email that already exists, it is most likely a typo or mistake. While surfacing the error toast is helpful, but changing the form from "Initial Credentials" to "Invitation Link" creates a jarring experience and forces the user to re-select "Initial Credentials" before they can try again.
This fix respects the user's original intent by preserving the form state, allowing them to quickly correct the email address and retry the creation without having to start over.
Technical changes made:
!open) rather than onisSubmitSuccessful.value={field.value}instead ofdefaultValue={field.value}so their visual state stays fully controlled and in sync with the form.Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
closes #5497
Screenshots / Validation Proofs
2. Selector shows initial credentials.
3. But form changed to invite link.
2. Selector shows initial credentials.
3. Form stays in initial credentials state.
The PR appears safe to merge; the revised lifecycle preserves failed input while still resetting the form after successful submissions and other dialog closures.
Summary
This PR corrects the add-invitation dialog lifecycle so failed submissions retain the user's inputs while closing the dialog resets the form and clears its error state.
Reviews (1) · Last reviewed commit: "fix: correct add-invitation form reset l..."