-
Notifications
You must be signed in to change notification settings - Fork 11.6k
feat(teams): show org upgrade tip for one team and add singular copy on /teams #23367
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
Conversation
…on /teams Co-Authored-By: [email protected] <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
WalkthroughThis change updates organization self-serve helper behavior and related copy. A constants update renames usage to ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUE and lowers its threshold from 2 to 1. TeamList.tsx adjusts the first helper Card to render singular vs. plural messaging based on team count (exactly one team vs. multiple). Two new English i18n keys are added: you_have_one_team and consider_consolidating_one_team_org. No logic beyond conditional text rendering and constant usage/value changes is modified. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
…756229864-teams-upgrade-tip-one-team
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/features/ee/teams/components/TeamList.tsx (1)
61-66: Bug: Card may not render if first array item is MEMBER.Current logic ties rendering to i === 0. If the first team is a MEMBER and a later team is admin/owner, the upgrade Card won’t show.
Apply this diff to render once for the first non-MEMBER team and fix UL semantics (li instead of div):
- props.teams.map( - (team, i) => - team.role !== "MEMBER" && - i === 0 && ( - <div className="bg-subtle p-4" key={team.id}> - <div className="grid-col-1 grid gap-2 md:grid-cols-3"> + (() => { + const ownerTeam = props.teams.find((t) => t.role !== "MEMBER"); + if (!ownerTeam) return null; + return ( + <li className="bg-subtle p-4" key={ownerTeam.id}> + <div className="grid-col-1 grid gap-2 md:grid-cols-3"> <Card - icon={<Icon name="building" className="h-5 w-5 text-red-700" />} + icon={<Icon name="building" className="h-5 w-5 text-red-700" />} variant="basic" - title={props.teams.length === 1 ? t("you_have_one_team") : t("You have a lot of teams")} + title={props.teams.length === 1 ? t("you_have_one_team") : t("You have a lot of teams")} description={ - props.teams.length === 1 - ? t("consider_consolidating_one_team_org") - : t( - "Consider consolidating your teams in an organisation, unify billing, admin tools and analytics." - ) + props.teams.length === 1 + ? t("consider_consolidating_one_team_org") + : t( + "Consider consolidating your teams in an organisation, unify billing, admin tools and analytics." + ) } actionButton={{ href: `/settings/organizations/new`, child: t("set_up_your_organization"), "data-testid": "setup_your_org_action_button", }} /> <Card icon={<Icon name="paintbrush" className="h-5 w-5 text-orange-700" />} variant="basic" title={t("Get a clean subdomain")} description={t( "Right now, team member URLs are all over the place. Get a beautiful link and turn every email address into a scheduling link: [email protected] → acme.cal.com/anna" )} actionButton={{ href: "https://www.youtube.com/watch?v=G0Jd2dp7064", child: t("learn_more"), }} /> <Card icon={<Icon name="chart-line" className="h-5 w-5 text-green-700" />} variant="basic" title={t("Admin tools and analytics")} description={t( "As an organization owner, you are in charge of every team account. You can make changes with admin-only tools and see organization wide analytics in one place." )} actionButton={{ href: "https://go.cal.com/quote", child: t("learn_more"), }} /> </div> - </div> - ) - )} + </li> + ); + })()}
🧹 Nitpick comments (1)
packages/features/ee/teams/components/TeamList.tsx (1)
71-78: Localize plural copy with keys and unify en-US spelling.Consider adding keys for the plural variants and switching “organisation” → “organization” to match en/common.json style.
Example:
- title={props.teams.length === 1 ? t("you_have_one_team") : t("You have a lot of teams")} + title={props.teams.length === 1 ? t("you_have_one_team") : t("you_have_many_teams")} ... - : t("Consider consolidating your teams in an organisation, unify billing, admin tools and analytics.") + : t("consider_consolidating_many_teams_org")Then add those keys to en/common.json near the sentinel.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
apps/web/public/static/locales/en/common.json(1 hunks)packages/features/ee/teams/components/TeamList.tsx(2 hunks)packages/lib/constants.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
**/*.ts: For Prisma queries, only select data you need; never useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
packages/lib/constants.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
packages/lib/constants.tspackages/features/ee/teams/components/TeamList.tsx
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
packages/lib/constants.tspackages/features/ee/teams/components/TeamList.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Always use
t()for text localization in frontend code; direct text embedding should trigger a warning
Files:
packages/features/ee/teams/components/TeamList.tsx
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
packages/lib/constants.ts (1)
181-181: No leftover usages of the old constant. The ripgrep search forORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_DIALOGUEreturned zero matches, confirming the rename is complete.packages/features/ee/teams/components/TeamList.tsx (1)
3-3: All usages migrated to HELPER constant
Search confirms only ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUE is imported/used; no legacy identifier remains.
| description={ | ||
| props.teams.length === 1 | ||
| ? t("consider_consolidating_one_team_org") | ||
| : t( |
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.
extract this? "Consider consolidating your teams in an organisation, unify billing, admin tools and analytics."
E2E results are ready! |
What does this PR do?
Updates the organization upgrade tip on the
/teamspage to show when users have one team instead of requiring two or more teams. Also adds conditional copy to use singular phrasing when there's exactly one team.Changes:
ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUE(≥2 teams) to≥1 teamyou_have_one_teamandconsider_consolidating_one_team_orgORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUELink to Devin run: https://app.devin.ai/sessions/6e2c14a347914f67ab75f116f38816d6
Requested by: Sean (@sean-brydon)
Visual Demo (For contributors especially)
Screenshots will be added after local testing to show the upgrade tip with 1 team vs multiple teams.
How should this be tested?
/teams/teamsChecklist
ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUEconstant isn't referenced elsewhereMandatory Tasks (DO NOT REMOVE)