Add front-end support for inline forms and the change form in the admin UI.

Review Request #10826 — Created Jan. 15, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

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.

Summary ID
Add front-end support for inline forms and the change form in the admin UI.
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.
ecbdb85fd60eb6305a263fa9a586b88eaad537e5
Description From Last Updated

Maybe add an assertion that this.inlineGroupViews is empty?

daviddavid

Can we use jQuery's each method here instead of underscore?

daviddavid

We should definitely use jQuery's each method here.

daviddavid
david
  1. 
      
  2. Show all issues

    Maybe add an assertion that this.inlineGroupViews is empty?

  3. Show all issues

    Can we use jQuery's each method here instead of underscore?

  4. Show all issues

    We should definitely use jQuery's each method here.

  5. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (ae3b2a8)
Loading...