-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Remove dependency on jquery-form #35240
Conversation
…ue + SolTech feature request)
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.
Thanks for removing this! Left a couple of questions.
let formData = new FormData($createForm.get(0)); | ||
formData.set("action", "create"); | ||
$.ajax({ | ||
method: 'POST', | ||
dataType: 'json', |
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.
I don't quite follow why we keep dataType: 'json'
in this request but remove it in the other modified request in this file? Same goes for the b5 version.
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.
Those are spurious changes, I must have made them while troubleshooting and then not changed them back. Reading the docs now, it'd be fine to leave off dataType
altogether in this code (for a default value, the docs say it makes an intelligent guess).
Technical Summary
This dependency isn't really pulling its weight. I've thought about removing it before, and this morning @gherceg and I ran into an issue integrating it with webpack, so now seemed like a good time to kill it.
The API is pretty small: https://github.com/jquery-form/form
We primarily use
ajaxSubmit
, and also useresetForm
in a couple of places. I imagine this library was more useful when we started using it, but now we can use native js functionality that's approximately as concise.https://dimagi.atlassian.net/browse/SAAS-16090
Safety Assurance
Safety story
These are fairly minor changes on ~5 areas in HQ (although the CRUD view is used in a couple of places). I tested each of them locally.
Automated test coverage
Unlikely
QA Plan
Not requesting QA
Rollback instructions
Labels & Review