Add a new UserDetailsProvider interface, with badge support.
Review Request #14283 — Created Jan. 2, 2025 and updated
This introduces a new concept for extensions and users, User Details
Providers, implemented as subclasses ofUserDetailsProvider
. This is
a class that can build upon to let exetnsions provide additional
information about users without needing to worry about extendingUser
,
Profile
, or implementing whole new hooks.
UserDetailsProvider
subclasses can be registered in a central registry
and then implement methods to provide certain kinds of details that
Review Board can then query for additional functionality.Right now, these can provide badges for users. Badges are shown
alongside a user's name in certain parts of the UI (infoboxes and
discussions, currently). They contain text and may contain custom CSS or
even custom HTML.This is purely built for extension authors to take advantage of, giving
companies greater control over Review Board.
Unit tests passed.
Tested with an extension that added some hard-coded badges. Verified these
showed up in reviews, discussions, and infoboxes.
Summary | ID |
---|---|
18ea34617edd8f9ba378bbbb14124f84c2aaf54a |
Description | From | Last Updated |
---|---|---|
'io.StringIO' imported but unused Column: 1 Error code: F401 |
reviewbot | |
'reviewboard.accounts.user_details.UserBadge' imported but unused Column: 1 Error code: F401 |
reviewbot | |
'reviewboard.extensions.hooks.users.UserBadgeInfo' imported but unused Column: 5 Error code: F401 |
reviewbot | |
line too long (82 > 79 characters) Column: 80 Error code: E501 |
reviewbot | |
This looks like it's out of date/copy-pasted from elsewhere. Should say it returns a SafeString of the HTML for all … |
david | |
Can we move the definition of css_class down so it's right above its use? |
david |
- Change Summary:
-
- Removed unused imports.
- Fixed a line length issue.
- Commits:
-
Summary ID 70f647b787a24926709d67a021e20d6ff372c85e 18ea34617edd8f9ba378bbbb14124f84c2aaf54a - Diff:
-
Revision 2 (+1224 -26)