Add context parameter to actions JS data methods.

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

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.
Summary ID
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
Description From Last Updated

I think the description is meant to say get_js_*_data instead of get_*_model_data.

maubinmaubin

line break before binary operator Column: 9 Error code: W503

reviewbotreviewbot

Expected a string and instead saw %. Column: 2 Error code: W095

reviewbotreviewbot

Expected ':' and instead saw 'load'. Column: 4 Error code: E021

reviewbotreviewbot

Expected a JSON value. Column: 9 Error code: E003

reviewbotreviewbot

Expected '}' and instead saw 'actions'. Column: 9 Error code: E021

reviewbotreviewbot

Unrecoverable syntax error. (10% scanned). Column: 9 Error code: E041

reviewbotreviewbot

Should say "Render ths JS view data for an action"

maubinmaubin

Expected ':' and instead saw 'load'. Column: 4 Error code: E021

reviewbotreviewbot

Expected a JSON value. Column: 9 Error code: E003

reviewbotreviewbot

Expected a string and instead saw %. Column: 2 Error code: W095

reviewbotreviewbot

Expected '}' and instead saw 'actions'. Column: 9 Error code: E021

reviewbotreviewbot

Unrecoverable syntax error. (10% scanned). Column: 9 Error code: E041

reviewbotreviewbot

blank line at end of file Column: 1 Error code: W391

reviewbotreviewbot

Expected a string and instead saw %. Column: 2 Error code: W095

reviewbotreviewbot

Expected ':' and instead saw 'load'. Column: 4 Error code: E021

reviewbotreviewbot

Expected a JSON value. Column: 9 Error code: E003

reviewbotreviewbot

Expected '}' and instead saw 'actions'. Column: 9 Error code: E021

reviewbotreviewbot

Unrecoverable syntax error. (10% scanned). Column: 9 Error code: E041

reviewbotreviewbot
Checks run (2 failed)
flake8 failed.
JSHint failed.

flake8

JSHint

david
Review request changed

Commits:

Summary ID
Add context parameter to actions JS data methods.
It turns out that it will be useful to allow the `get_*_model_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.
2028a02f8c6884e1f8ca9d279356aec5d28d6293
Add context parameter to actions JS data methods.
It turns out that it will be useful to allow the `get_*_model_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.
b1c43b809d0f0f3238b9d3243723b8f51816bd11

Diff:

Revision 2 (+180 -18)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 passed.
JSHint failed.

JSHint

maubin
  1. 
      
  2. Show all issues

    I think the description is meant to say get_js_*_data instead of get_*_model_data.

  3. Show all issues

    Should say "Render ths JS view data for an action"

  4. 
      
david
Review request changed

Description:

~  

It turns out that it will be useful to allow the get_*_model_data for

  ~

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.

Commits:

Summary ID
Add context parameter to actions JS data methods.
It turns out that it will be useful to allow the `get_*_model_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.
b1c43b809d0f0f3238b9d3243723b8f51816bd11
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

Diff:

Revision 3 (+188 -18)

Show changes

Checks run (2 failed)

flake8 failed.
JSHint failed.

flake8

JSHint

maubin
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-6.x (4280e6b)
Loading...