-
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 banner for project managers, give priority to roles within locale #3422
Conversation
Deleted the previous comment because I realize I was testing the same code 🤦🏼 Follow-up on conversation, I tested with
|
The second commit fixes #3425 |
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!
Added a few suggestions for minor improvements, and suggested a couple of ways forward for the PM status.
EDIT: (solved) The suggest code returns a
EDIT: removed the diff, because after putting some logging, I realize I was completely off. |
This adds a banner for users defined as "Project Manager" within a project. To reduce the space for confusion, I changed the tooltip of MNGR from "Manager" to "Team Manager". This also makes the priority of roles consistent between front-end and back-end: - If a user as a role within the locale (translator, manager), we use that for the banner. - If a user is set as PM, we use that even if the user is an Admin. Finally, this adds CSS variables for users, instead of reusing the ones for translation status.
…retrieving specific fields from a queryset
@flodolo Could you please take it for a spin on stage? In addition to addressing the review comments, I've also fix the color for the MNGR status, which was broken and simplified the logic behind it. |
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.
I think we have a problem with admins in the front-end: they always show up as "MNGR" when writing a comment, because apparently managerForLocales
is the full list of Pontoon locales (same for translatorForLocales
).
Is that needed to enable/disable editing?
(I'm testing locally because it's easier to mess with projects and users) Another inconsistency: new user that is not set up as PM for the project, but it's part of project_managers. When commenting (front-end) it shows up as ADMIN, after commenting it shows up as NEW. |
Yeah, we have inconsistent definitions of user statuses between: Line 860 in da0c8ec
pontoon/pontoon/base/models/user.py Line 197 in da0c8ec
|
… canTranslateLocales
…erStatus instead of canManageLocales and canTranslateLocales
Stage updated with the new code. |
This works great for me locally. Thanks for taking over, so much larger than I expected |
Could you please also take a look at the code? I can't flag you for a review, since you're the author of the PR. |
I should have called out that I did review the various commits 👍🏼 |
This adds a banner for users defined as "Project Manager" within a project. To reduce the space for confusion, I changed the tooltip of MNGR from "Manager" to "Team Manager".
This also makes the priority of roles consistent between front-end and back-end:
Finally, this adds CSS variables for users, instead of reusing the ones for translation status.
Fixes #3418
Fixes #3425
TODO: