Add a base class for groups of actions.
Review Request #14643 — Created Oct. 19, 2025 and updated
When actions were implemented, the only group of actions we needed were
menus. As we begin to use action for more purposes, we need other groups
of actions, meaning it's a good time to come up with a more general base
class for this.This change introduces
BaseGroupAction
, whichMenuAction
is built
upon. This manages a group of actions, allowing for explicit ordering
and--
just like menus (though it would be up to an implementation how
it wants to handle this).There's a JavaScript side as well, which is equivalent to what
MenuAction
was before.MenuAction
is now a very thin subclass over
GroupAction
.For testing, our formerly registry-specific set of test action classes
have been moved into a common module, along with some new actions for
groups.On top of this, actions now have a parent registry, assigned when
registering and unassigned when unregistering. This is primarily for
unit test purposes, but removes the assumption ofactions_registry
for
child actions.
Unit tests pass.
Tested all the actions in the UI to make sure they still work and
still show the menu items in the right order.
Summary | ID |
---|---|
1ad611e3e26f6695432ed73492a262c2068e70f0 |
Description | From | Last Updated |
---|---|---|
'typing.TYPE_CHECKING' imported but unused Column: 1 Error code: F401 |
![]() |
|
'django.http.HttpRequest' imported but unused Column: 1 Error code: F401 |
![]() |
|
'django.test.client.RequestFactory' imported but unused Column: 1 Error code: F401 |
![]() |
|
'reviewboard.actions.registry.ActionsRegistry' imported but unused Column: 1 Error code: F401 |
![]() |
|
'reviewboard.actions.tests.base.TestAction' imported but unused Column: 1 Error code: F401 |
![]() |
- Change Summary:
-
Removed unused imports.
- Commits:
-
Summary ID 8993d10740361db62dcb0d8ac4abc5cd8cf30f3b 1ad611e3e26f6695432ed73492a262c2068e70f0 - Diff:
-
Revision 2 (+886 -260)