From f755312ed769d396c6c6ab5024c313b0d10fc761 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Thu, 6 Jul 2023 15:25:12 +0530 Subject: [PATCH] feat: Make Team Private ## What does this PR do? Fixes https://github.com/calcom/cal.com/issues/8974 1) When user is admin 2) When user is not admin and team is private 3) ## Type of change - New feature (non-breaking change which adds functionality) ## How should this be tested? 1) go to Team members page and turn on switch Make Team Private. Now after making the team private only admin would be able to see all the members list in the settings. There will not be a button to Book a team member instead on the team page like before. ## Mandatory Tasks - [ ] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected. --- apps/web/pages/team/[slug].tsx | 17 ++++-- apps/web/public/static/locales/en/common.json | 3 + .../components/MakeTeamPrivateSwitch.tsx | 60 +++++++++++++++++++ .../ee/teams/pages/team-members-view.tsx | 19 +++++- packages/lib/server/queries/teams/index.ts | 1 + .../migration.sql | 2 + packages/prisma/schema.prisma | 1 + .../routers/viewer/teams/update.handler.ts | 1 + .../routers/viewer/teams/update.schema.ts | 1 + 9 files changed, 96 insertions(+), 9 deletions(-) create mode 100644 packages/features/ee/teams/components/MakeTeamPrivateSwitch.tsx create mode 100644 packages/prisma/migrations/20230701125542_add_is_private/migration.sql diff --git a/apps/web/pages/team/[slug].tsx b/apps/web/pages/team/[slug].tsx index a168a56c43..5250faf3ed 100644 --- a/apps/web/pages/team/[slug].tsx +++ b/apps/web/pages/team/[slug].tsx @@ -187,7 +187,7 @@ function TeamPage({ team, isUnpublished, markdownStrippedBio, isValidOrgDomain } {!isBioEmpty && ( <>
> @@ -197,21 +197,26 @@ function TeamPage({ team, isUnpublished, markdownStrippedBio, isValidOrgDomain }+ {t("make_team_private_description")} +
+