Fix using admin widgets in non-ModelAdmin change forms.

Review Request #10957 — Created March 13, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

With the new admin UI, only change forms based on ModelAdmin ended up
having special widgets (like SelectFilter) set up. The form media
wasn't being referenced (since we were assuming it'd be passed to the
form as the media variable, which isn't true on normal forms) and we
weren't initializing them properly anyway.

We now check for both media and form.media, covering both cases, and
we initialize these widgets in RB.FormView. The latter also now houses
the logic for re-initializing these widgets, moving the functionality
out of RB.Admin.InlineFormGroupView and simplifying form management.

Tested various form pages with these widgets, making sure they worked
as expected.

Summary ID
Fix using admin widgets in non-ModelAdmin change forms.
With the new admin UI, only change forms based on `ModelAdmin` ended up having special widgets (like `SelectFilter`) set up. The form media wasn't being referenced (since we were assuming it'd be passed to the form as the `media` variable, which isn't true on normal forms) and we weren't initializing them properly anyway. We now check for both `media` and `form.media`, covering both cases, and we initialize these widgets in `RB.FormView`. The latter also now houses the logic for re-initializing these widgets, moving the functionality out of `RB.Admin.InlineFormGroupView` and simplifying form management.
6b44742125ec38b5f2ff3824395284b901589df2
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (8918962)