-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add notifications when a badge is awarded #3442
base: main
Are you sure you want to change the base?
Conversation
In this state, there is still an issue with differentiating between demotions and promotions for the Community Builder Badge, and awarding badges accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
As mentioned inline, I'd use a popup when the badge is awarded.
Looking into the Permission promotions bug.
Is this not working as expected then? Lines 125 to 136 in 8a16a65
|
Changed the confetti file to be the unminified version instead. This commit also has a broken implementation of the permissions count bug, where I attempted to self-correct permissions counts inside of user.py
This patch fixes the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I didn't actually test the code yet, but left some notes on things that stood out.
It seems like the badge popup HTML and CSS are not the same in preference page and the translate view?
STATICFILES_DIRS = [ | ||
|
||
STATICFILES_DIRS = ( | ||
("badges", "pontoon/contributors/static/img"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand it, Django currently only serves static files from base/static
. I believe adding this change allows the 3 badge svg files to also be served in our app.
The tuple is just to for better readability.
Is there a better way of doing this?
Fix #3412
This PR adds notifications to signal to a user that they received a new badge/badge level. Notifications will appear in both the "Notifications Menu" in the header (first image), and as a notification banner across the top of the page. Notification banners for new badge levels will trigger a confetti animation, imported from https://github.com/catdad/canvas-confetti.
The initial commit for this PR has a noticeable bug, in that demotions and promotions will both count towards the Community Builder Badge. This issue stems from how
assign_users_to_groups
will always update translators then managers, in that order. Thus, there is no way to distinguish if an action is promoting a user from Contributor -> Translator or if an action is demoting a user from Manager -> Translator, especially since multiple users can be demoted/promoted in the same action.