Make it easier to create integrations config pages outside the admin UI.
Review Request #10432 — Created Feb. 26, 2019 and submitted — Latest diff uploaded
The integrations list and configuration pages were always intended to be
usable outside of the Django admin UI, but it was never fully ready for
this. The URL definitions were still built for the admin UI, and so were
This change makes the integration pages embeddable elsewhere in a
website. A new mixin,
IntegrationListContextViewMixin, provides all
the page state needed for rendering the integration configuration list,
and the base views are no longer using the admin templates by default.
Those templates themselves have moved into an
directory, helping to distinguish them from more reusable templates.
build_integration_urlpatterns()has been updated to take a namespace
for the URLs, allowing for a site to include all the integrations pages
in a way where links will reference the correct places without any risk
of clashing with the admin UI.
There's also a fix for saving integration forms, where the integration
ID could end up unset or could be changed depending on the subclass of
the form. We now force the correct integration ID during saving.
Tested that the admin UI's integration list and all related config pages
Built a version of the list embedded in another page in its own URL
namespace, and verified that all links work.