Refactor the actions system
Review Request #9131 — Created Aug. 11, 2017 and discarded — Latest diff uploaded
This is a large patch that refactors the action registry system
implemented by a past student to use a proper registry. Much refactoring
has been done:
- Action base classes now live in
reviewboard.actions. This package
also includes header dropdown actions. - Review request-specific action classes now live in
reviewboard.reviews.actions. - ALL action hooks support new-style action classes and old-style
dicts. Previously, there was a discrepancy betweeen which hooks
supported which type of action. ActionHookis now deprecated in favour ofReviewRequestActionHook.
The behaviour was the previously the same, except ActionHook supported
old-style dicts instead of classes. Now that the behaviour of all
hooks has been unified, we no longer need this distinction.- The
{% child_actions %}templatetag has been moved fromreviewtags
to a newactionstemplate tag library. It now takes the action it
should list the child actions of. - The
_DictActionand_DictMenuActionclasses have been turned into
theDictActionMixin. - There are now two action registries: one for review request actions
and one for header actions. This allows us to keep them seperate. - We now store instances of dict actions instead of the dicts
themselves. This is because you cannot store adictin aset(as
it is unhashable) and therefore cannot be put into aRegistry. - Generic action templates now live in
templates/actions.
- Ran unit tests.
- Built the docs and looked through them.