fix(#679): prevent showing input errors when starting new submissions#683
fix(#679): prevent showing input errors when starting new submissions#683latin-panda merged 6 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 010f786 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| const showValidationError = ref(false); | ||
| const geolocationErrorMessage = ref<string | null>(null); | ||
|
|
||
| const resetComponentState = () => { |
There was a problem hiding this comment.
I didn't include isFormEditMode from L70, it should be fine 🤔
There was a problem hiding this comment.
I'm not convinced it's fine - if you edit a submission and hit submit you don't want the form to stay in edit mode when submitting the next form. In Central it redirects after edit, but that's not guaranteed for other users of the component, so it's safer to reset it IMO.
There was a problem hiding this comment.
I thought about it more. The isFormEditMode depends on the state.value. I've moved it to a watch so it's always updated based on state.
I've added a video testing geopoint with maps again to ensure no regressions.
And also tested the case where the host doesnt redirect, the state is in create mode
garethbowen
left a comment
There was a problem hiding this comment.
One suggestion, but nice fix otherwise!
| const showValidationError = ref(false); | ||
| const geolocationErrorMessage = ref<string | null>(null); | ||
|
|
||
| const resetComponentState = () => { |
There was a problem hiding this comment.
I'm not convinced it's fine - if you edit a submission and hit submit you don't want the form to stay in edit mode when submitting the next form. In Central it redirects after edit, but that's not guaranteed for other users of the component, so it's safer to reset it IMO.
…-component-state-on-form-reset
|
@garethbowen this is ready for another look :) |
garethbowen
left a comment
There was a problem hiding this comment.
Great work.
CI is warning about a formatting issue that would be good to fix, but approving to unblock.
Closes #679
I have verified this PR works in these browsers (latest versions):
What else has been done to verify that this works as intended?
Regression testing of geopoint in edit mode - All geopoint are placement-map
regression-geopoint.mp4
Second round of testing form errors after latest changes
no-errors-fillout-again.mp4
First round of testing
no-errors-when-restart-form.mp4
Why is this the best possible solution? Were any other approaches considered?
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Do we need any specific form for testing your changes? If so, please attach one.
What's changed