Avoid the need to load window.chooserUrls globally in the shared _editor_js.html include.
Instead pass in the lazy URLs to the link chooser entity options.
Ensure that the JSON encoder can correctly handle lazy strings (such as reverse_lazy and gettext_lazy) so that there is better support for admin URLs and translations that may not be able to resolved when the application starts.
Instead of relying on global window.chooserUrls, add the support for also passing in entityType config objects that serve the same purpose.
Update JS unit tests to reflect that the future will no longer support the window.chooserUrls
The modal-workflow.js script is used across a wide range of views in the admin, it's simpler to include it globally instead of having to consider all places it may be used.
Also unblocks use cases that are outside of the core admin such as custom documents/user/image models that may want to leverage this functionality.
This can cause issues where e.g. stale permissions become the ones used
to render the checkboxes after a RenameModel operation (changing the
Python class name, not just the verbose_name).
A similar issue can also be triggered with custom permissions that share
the same codename action (first part of the codename before _) as the
built-in permissions.
Add missing select_related for content_type and batch the permission
queries for all content types instead of doing one query per model,
which can be a lot.
There are still duplicated queries due to the use of formsets, but there
isn't much we can do about it without some nasty hacks:
https://stackoverflow.com/questions/32082945
Ensure that versions are consistent between 1) what we specify in package.json; 2) the tag specified on the pre-commit mirror; 3) the package dependency line in the pre-commit config.
Change BaseTaskStateManager.reviewable_by() so that the specific tasks
are queried in bulk.
In GroupApprovalTask.get_task_states_user_can_moderate(), use
self.task_states reverse related manager so the resulting TaskStates
already have their task ForeignKey set to the current GroupApprovalTask
instance.
Remove 'task' from select_related as the reviewable_by() already fetches
the specific task in bulk.
The N+1 query may not happen during get_context_data() and instead happens during the rendering of the templates due to traversal of related fields.
This change to the test case makes it apparent that there are indeed N+1 queries.