Split the rendering of JavaScript action models and views.

Review Request #14665 — Created Oct. 31, 2025 and updated — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

We now have enough support for multiple views for the same action. It's
time to separate out the registration of the models and the views so
there's no longer a one-to-one association.

The new BaseAction.render_model_js() is responsible for writing the
JavaScript to render an action model. Every registered action in Python
will be registered in JavaScript.

The existing BaseAction.render_js() (old name currently kept for
compatibility reasons) will render the view. This is now only called
when the attachment points used on the page, rather than all attachment
points. That's handled in the {% actions_html %} template tag.

The template tag renders the HTML for the attachment point where the
template tag is placed, and then sets up a page injection containing the
JavaScript views. Then, when rendering the JavaScript models, the
injected JavaScript views content will be included.

Some of the design of this change is here to facilitate the upcoming
improvements to attachment points.

Unit tests pass.

Tested that all the actions on the page displayed and worked correctly.

Commits

Files