Improve instance form errors #173
No reviewers
Labels
No labels
API
Billing
UI/UX
dependencies
bug
change
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: servala/servala-portal#173
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "164-keep-values-on-error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ref #164
I was not able to reproduce the issue with the missing form values in either Firefox or Chrome by manually injecting an exception in the process, and from what I can tell, we are already doing the right thing in Django (using
form_invalid()in the view when errors occur). I improved the error placement and logic a bit while looking at this, but not sure where to begin to reproduce the actual problem.Created a liitle screencast of what I observed, even with this PR
f0b724f26ato5933352f5fThe screencast shows you saving the form after entering only the name, which should be impossible now that the required field detection is fixed, right?
The fact that required fields are now listed correctly makes pretty hard to reproduce the problem, but it will still occur if the instance creation or server-side validation fails.
The problem seems to be with the
spec.parameters.service.fqdnfield, which the browser displays with its previously entered value, but on form submission, the browser sends a"[", which the server correctly rejects – and then, of course on the second page render with errors, the previous user input is missing, as it never made its way back to the server.I think I have caught the bug – will require some hard reloads to make sure the new JavaScript is used. I may have gone a bit overboard in defending against it cropping up again, but better safe than sorry. Could you test the fix to see if it works for you aswell, @tobru ?
It looks much better now!