-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: nested error discovery in check form #868
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
…eact-hook-form states
…tion.tsx Co-authored-by: Virginia Cepeda <[email protected]>
…tion.tsx Co-authored-by: Virginia Cepeda <[email protected]>
Co-authored-by: Virginia Cepeda <[email protected]>
…nitoring-app into feat/zod-validation
…rev buttons in actions bar
Merged
VikaCep
reviewed
Jul 17, 2024
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.
👏 👏 👏 👏
src/components/CheckEditor/FormComponents/MultiHttpCheckRequests.tsx
Outdated
Show resolved
Hide resolved
VikaCep
previously approved these changes
Jul 18, 2024
VikaCep
approved these changes
Jul 18, 2024
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.
Problem
As noted in the check form redesign work, this is required to help with error discovery: #847
With the wizard form pattern and now with the request components, it means that users may have difficulty finding errors to correct when submitting check creation / updates.
Solution
Add methods and event listeners which respond to an invalid check form submission. Because of the nature of the individual components which need to respond to the invalid submission it doesn't make sense to rearchitect them to respond via prop drilling or some overarching context. I have chosen to do this a little bit more vanilla with dispatching a custom event, setting up event listeners for the custom event and utilising
useImperativeHandle
where appropriate.I have added test coverage for each of the check types which is doing a single spot check that the field with an error is being navigated to. I did have checks ensuring the input field was receiving focus but I have had to remove them as they were proving a little flaky in the CI/CD. I have left two specific focus checks for the script and probe fields as they are special and need to handled differently to all other form inputs.
Http check error discovery
Screen.Recording.2024-07-17.at.11.39.48.mov
Multihttp check error discovery
Screen.Recording.2024-07-17.at.11.44.00.mov
Script check error discovery, redirecting back to script tab from examples
Screen.Recording.2024-07-17.at.11.45.25.mov
Focussing probes select correctly when it has an error and is the first field
Screen.Recording.2024-07-17.at.11.46.59.mov