Add context parameter to actions JS data methods.

Review Request #13107 — Created June 14, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

It turns out that it will be useful to allow the get_js_*_data for
actions to have access to the rendering context. This change does that
by introducing some new template tags that call the methods with the
context.

This also allows improving the implementation of the menu view a bit,
removing non-rendering actions from the data sent to the JS model,
preventing some warnings about unknown IDs from popping up in the case
that an extension has hidden a menu-item action.

  • Implemented a custom action that used the context parameter.
  • Used HideActionHook to hide a menu item action and saw that I was no
    longer getting warnings in the JS console.
  • Ran js-tests.

Diff Revision 3 (Latest)

orig
1
2
3

Commits

First Last Summary ID Author
Add context parameter to actions JS data methods.
It turns out that it will be useful to allow the `get_js_*_data` for actions to have access to the rendering context. This change does that by introducing some new template tags that call the methods with the context. This also allows improving the implementation of the menu view a bit, removing non-rendering actions from the data sent to the JS model, preventing some warnings about unknown IDs from popping up in the case that an extension has hidden a menu-item action. Testing Done: - Implemented a custom action that used the context parameter. - Used `HideActionHook` to hide a menu item action and saw that I was no longer getting warnings in the JS console. - Ran js-tests.
f66baf5442821c071264a66cb56a4bbc49804137 David Trowbridge
reviewboard/actions/base.py
reviewboard/actions/templatetags/actions.py
reviewboard/templates/actions/action.js
Loading...