Skip to content

feat: display user roles in team switch dropdown - #934

Open
DinuniWork wants to merge 2 commits into
developmentfrom
772-improvement-display-user-roles-in-the-team-switch-dropdown
Open

DinuniWork wants to merge 2 commits into
developmentfrom
772-improvement-display-user-roles-in-the-team-switch-dropdown

Conversation

@DinuniWork

@DinuniWork DinuniWork commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Team switcher cards now show your role for each team, with translated labels for common roles.
    • Team details now include role information, showing “Owner” when applicable.

@DinuniWork
DinuniWork requested a review from chamikaJ as a code owner November 11, 2026 10:53
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related issues

Possibly related PRs

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: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: displaying user roles in the team switch dropdown.
Docstring Coverage Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b495053 and b369e65.

Files selected for processing: 3

  • worklenz-backend/src/controllers/teams-controller.ts
  • worklenz-frontend/src/features/navbar/switch-team/SwitchTeamButton.tsx
  • worklenz-frontend/src/types/teams/team.type.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

…to 772-improvement-display-user-roles-in-the-team-switch-dropdown

@chamikaJ chamikaJ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants