Extension Hooks¶
Extension Hooks are the primary way that your extension will modify behavior or user interfaces. There are many hooks available that allow changing different aspects of the tool.
Python Extension Hooks¶
General Hooks¶
- TemplateHook:
This hook allows you to inject your own content into Review Board’s main templates at predefined locations.
- URLHook
Defines new URLs in Review Board, which can map to your own custom views.
- NavigationBarHook:
Adds new links to the very top navigation bar (alongside “My Dashboard”, “All Review Requests”, etc.)
- SignalHook:
Connects to signals. There are many signals built in to Review Board and Django, allowing your extension to run code when certain events occur.
Review Request Hooks¶
- ReviewRequestFieldsHook:
Creates new fields for a review request.
- ReviewRequestFieldSetsHook:
Creates a new fieldset for a review request, containing multiple fields.
Review Hooks¶
- CommentDetailDisplayHook:
Adds additional information to the display of comments on the review request page and in e-mails.
Review Workflow Hooks¶
- ReviewRequestApprovalHook:
Review Requests have a concept of “approval.” This is a flag exposed in the API on Review Request Resource that indicates if the change has met the necessary requirements to be committed to the codebase. This hook allows you to create your own custom policy for how the approved flag is set.
- FileDiffACLHook:
This hook allows you to create ACL rules for diffs. This can be used to mirror your repository ACLs or organizational rules into access control for associated review requests.
- ReviewRequestConditionChoicesHook:
Adds new condition choices (for defining rules in integration configurations).
File Type Review Hooks¶
- ReviewUIHook:
Adds a new Review UI for reviewing file attachments with matching file types.
- FileAttachmentThumbnailHook:
Adds a thumbnail renderer for file attachments with matching file types.
Integration With Third-Party Tools Hooks¶
- IntegrationHook:
Adds a new integration (for use in Admin > Integrations)
- HostingServiceHook:
Adds support for new source code or bug tracker hosting services.
- SCMToolHook:
Adds a new version control system implementation.
- AvatarServiceHook:
Adds a new avar service, which can be used to provide profile pictures for user accounts.
- AuthBackendHook:
Adds a new authentication backend for logging in to Review Board.
Action Hooks¶
- ActionHook:
Adds new actions for review requests, the diff viewer, and the account/support header at the top of the page.
- HideActionHook:
Hides built-in actions (if you want to disable or replace behavior).
Miscellaneous User Interface Hooks¶
- AdminWidgetHook:
This hook creates a new widget for use in the main administration UI dashboard.
- AccountPagesHook:
This hook adds a new sub-page in the My Account page.
- AccountPageFormsHook:
This hook adds a new form in the My Account page.
- UserDetailsProviderHook:
This hook adds a new user details provider, for providing extra information about users.
- UserInfoboxHook:
This hook adds new information to user infoboxes (shown when hovering the mouse over a username).
Datagrid Hooks¶
- DashboardColumnsHook:
This hook adds new columns to the dashboard.
- DataGridColumnsHook:
This hook adds new columns to other datagrids (such as Users, Groups, and All Review Requests pages).
- DashboardSidebarItemsHook:
This hook adds new sections and items to the dashboard sidebar.
- UserPageSidebarItemsHook:
This hook adds sections and items to the user page’s sidebar.
API Hooks¶
- WebAPICapabilitiesHook:
This hook adds new capability flags no the root API resource. Clients can use this to determine whether particular features are available.
- APIExtraDataAccessHook:
This hook allows customizing the visibility and mutability of keys in
extra_datafields. This allows you to make certain data private or read-only.
E-mail Hooks¶
- EmailHook:
Allows modifying recipient lists for outgoing e-mails. This is a generic hook which allows handling all notification e-mails.
- ReviewRequestPublishedEmailHook:
Updates information for e-mails about publishing review requests.
- ReviewRequestClosedEmailHook:
Updates information for e-mails about closing review requests.
- ReviewPublishedEmailHook:
Updates information for e-mails about new reviews.
- ReviewReplyPublishedEmailHook:
Updates information for e-mails about new replies.
JavaScript Extension Hooks¶
When writing a JavaScript extension, you can make use of some special hooks to augment behavior in Review Board’s UI. These work very similar to Python hooks.
- CommentDialogHook:
Adds new fields or content to the comment dialog.
- ReviewDialogHook:
Adds new fields or content to the top of the review dialog.
- ReviewDialogCommentHook:
Adds new fields or content to comments within the review dialog.
- FileAttachmentThumbnailContainerHook:
Adds new content or file actions to file attachment thumbnails.
Deprecated Hooks¶
DiffViewerActionHook:Deprecated hook for adding actions to the diff viewer’s review request actions bar.
HeaderActionHook:Deprecated hook for adding actions to the top-right of the page.
HeaderDropdownActionHook:Deprecated hook for adding drop-down actions to the top-right of the page.
ReviewRequestActionHook:Deprecated hook for adding actions to the review request actions bar.
ReviewRequestDropdownActionHook:Deprecated hook for adding drop-down actions to the review request actions bar.