You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: display user roles in team switch dropdown - #934
Reviewing files that changed from the base of the PR and between b369e65 and 5d577d0.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The team response now includes the requester’s role for each team. The team switcher displays that role beside the team name, using translated labels for recognized roles.
Changes: Team Role Labels
Layer / File(s)
Summary
Add role to team response worklenz-backend/src/controllers/teams-controller.ts, worklenz-frontend/src/types/teams/team.type.ts
The team query returns the active membership role, or Owner when the requester owns the team. The response type adds the optional role_name property.
Display role in team switcher worklenz-frontend/src/features/navbar/switch-team/SwitchTeamButton.tsx
The team card displays the owner label or the team role beside the team name. Recognized roles use translated labels; other role names remain unchanged.
Worklenz/worklenz#727: This PR also uses the CustomAvatar contract in SwitchTeamButton.
Merge Risk: Minimal · previous review b369e
The change adds role labels to the team switcher. No concrete merge-blocking risk was found in the reviewed changes.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: displaying user roles in the team switch dropdown.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The changes to display user roles in the team switcher dropdown are clean, safe, and well-scoped:
Proper query subquery in TeamsController with fallback to 'Owner'.
Uses existing i18n keys with localized default fallbacks.
Correct type definitions in team.type.ts.
All automated checks pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit