Add front-end support for inline forms and the change form in the admin UI.
Review Request #10826 — Created Jan. 15, 2020 and submitted
The administration UI's Change Form, which is responsible for adding or
modifying objects in the database, is complex and has a lot of custom
JavaScript that can be fragile when we update our version of Django and
can interact poorly with our own logic and styling.This change introduces the beginning of a view for managing the Change
Form, which currently just sets up the biggest part of this change, the
new Inline Forms classes.Inline Forms are a Django admin UI concept that makes it easy to add or
modify related objects all in the same Change Form page.This change provides custom code for managing these forms, allowing us
to control any initialization of form elements, maintain styles that
won't conflict with other parts of the page (unlike current inline
support), and check for regressions through unit tests.This is a big chunk of the client-side work for this page, which is why
we're starting here. Upcoming changes will improve upon the styling and
component structure of the page.
JavaScript unit tests pass.
Tested the inline forms on several different models, verifying that
adding and removing work as expected and that state on the forms are
correct.
- Change Summary:
-
- Switched from
_.each($(...))
to$(...).each
. - Added an assertion for some initial state on
ChangeFormPageView
. - Fixed a comment to remove a reference to some code that no longer exists.
- Switched from
- Commits:
-
Summary ID 34801f3ccc331b261ce09997c8732bbdc5f7cd45 ecbdb85fd60eb6305a263fa9a586b88eaad537e5 - Diff:
-
Revision 2 (+2304 -2)