-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error handling on nested create modals #1286
Merged
Merged
Conversation
This file contains 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
Contributor
nas-tabchiche
commented
Dec 31, 2024
- Remove obsolete workaround
- chore: Remove dead code
This is actually an issue on some nested create forms that still use an old workaround that we implemented a while back to fix modals not closing and success toasts not being dispatched, at the expense of backend validation errors being displayed. I do not remember how this was solved, however this workaround is definitely not longer needed, and can just be YEETed on sight.
nas-tabchiche
changed the title
CA 737 error handling on nested modals
Fix error handling on nested create modals
Dec 31, 2024
nas-tabchiche
requested review from
Mohamed-Hacene,
eric-intuitem and
ab-smith
December 31, 2024 00:56
nas-tabchiche
commented
Dec 31, 2024
Comment on lines
-56
to
-78
let { form: deleteForm, message: deleteMessage } = { | ||
form: {}, | ||
message: {} | ||
}; | ||
|
||
let { form: createForm, message: createMessage } = { | ||
form: {}, | ||
message: {} | ||
}; | ||
|
||
// NOTE: This is a workaround for an issue we had with getting the return value from the form actions after switching pages in route /[model=urlmodel]/ without a full page reload. | ||
// invalidateAll() did not work. | ||
$: { | ||
({ form: createForm, message: createMessage } = superForm(data.scenarioCreateForm, { | ||
onUpdated: ({ form }) => | ||
handleFormUpdated({ form, pageStatus: $page.status, closeModal: true }) | ||
})); | ||
({ form: deleteForm, message: deleteMessage } = superForm(data.scenarioDeleteForm, { | ||
onUpdated: ({ form }) => | ||
handleFormUpdated({ form, pageStatus: $page.status, closeModal: true }) | ||
})); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important changes are these, the remainder of the PR is dead code removal.
Mohamed-Hacene
approved these changes
Jan 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0k
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.