diff --git a/apps/web/components/settings/platform/dashboard/oauth-client-dropdown/index.tsx b/apps/web/components/settings/platform/dashboard/oauth-client-dropdown/index.tsx index 50311691e6..17ec4c366a 100644 --- a/apps/web/components/settings/platform/dashboard/oauth-client-dropdown/index.tsx +++ b/apps/web/components/settings/platform/dashboard/oauth-client-dropdown/index.tsx @@ -24,7 +24,9 @@ export const OAuthClientsDropdown = ({ {Array.isArray(oauthClients) && oauthClients.length > 0 ? ( - + {oauthClients.map((client) => { diff --git a/apps/web/modules/settings/platform/billing/billing-view.tsx b/apps/web/modules/settings/platform/billing/billing-view.tsx index 8882ede63a..d7e1b7864d 100644 --- a/apps/web/modules/settings/platform/billing/billing-view.tsx +++ b/apps/web/modules/settings/platform/billing/billing-view.tsx @@ -7,6 +7,7 @@ import Shell from "@calcom/features/shell/Shell"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button } from "@calcom/ui"; +import { PlatformPricing } from "@calcom/web/components/settings/platform/pricing/platform-pricing/index"; import NoPlatformPlan from "@components/settings/platform/dashboard/NoPlatformPlan"; import { useGetUserAttributes } from "@components/settings/platform/hooks/useGetUserAttributes"; @@ -23,13 +24,33 @@ export default function PlatformBillingUpgrade() { const onContactSupportClick = async () => { await open(); }; - const { isUserLoading, isUserBillingDataLoading, isPlatformUser, userBillingData } = useGetUserAttributes(); + const { isUserLoading, isUserBillingDataLoading, isPlatformUser, userBillingData, isPaidUser, userOrgId } = + useGetUserAttributes(); if (isUserLoading || (isUserBillingDataLoading && !userBillingData)) { return
Loading...
; } - if (!isPlatformUser) return ; + if (isPlatformUser && !isPaidUser) + return ( + +

Subscribe to Platform

+ + } + /> + ); + + if (!isPlatformUser) + return ( +
+ }> + + +
+ ); return (
diff --git a/apps/web/pages/settings/platform/members/index.tsx b/apps/web/pages/settings/platform/members/index.tsx new file mode 100644 index 0000000000..dad151765a --- /dev/null +++ b/apps/web/pages/settings/platform/members/index.tsx @@ -0,0 +1,9 @@ +import PlatformMembersView from "@calcom/features/ee/platform/pages/settings/members"; + +import PageWrapper from "@components/PageWrapper"; + +const Page = () => ; + +Page.PageWrapper = PageWrapper; + +export default Page; diff --git a/packages/features/ee/platform/pages/settings/members.tsx b/packages/features/ee/platform/pages/settings/members.tsx new file mode 100644 index 0000000000..3f90e1c2b2 --- /dev/null +++ b/packages/features/ee/platform/pages/settings/members.tsx @@ -0,0 +1,74 @@ +"use client"; + +import Shell from "@calcom/features/shell/Shell"; +import { UserListTable } from "@calcom/features/users/components/UserTable/UserListTable"; +import { MembershipRole } from "@calcom/prisma/enums"; +import { trpc } from "@calcom/trpc/react"; +import { Button } from "@calcom/ui"; +import NoPlatformPlan from "@calcom/web/components/settings/platform/dashboard/NoPlatformPlan"; +import { useGetUserAttributes } from "@calcom/web/components/settings/platform/hooks/useGetUserAttributes"; +import { PlatformPricing } from "@calcom/web/components/settings/platform/pricing/platform-pricing/index"; + +const PlatformMembersView = () => { + const { isUserLoading, isUserBillingDataLoading, isPlatformUser, isPaidUser, userBillingData, userOrgId } = + useGetUserAttributes(); + const { data: currentOrg, isPending } = trpc.viewer.organizations.listCurrent.useQuery(); + + const isOrgAdminOrOwner = + currentOrg && + (currentOrg.user.role === MembershipRole.OWNER || currentOrg.user.role === MembershipRole.ADMIN); + + const canLoggedInUserSeeMembers = + (currentOrg?.isPrivate && isOrgAdminOrOwner) || isOrgAdminOrOwner || !currentOrg?.isPrivate; + + if (isUserLoading || (isUserBillingDataLoading && !userBillingData)) { + return
Loading...
; + } + + if (isPlatformUser && !isPaidUser) + return ( + +

Subscribe to Platform

+
+ } + /> + ); + + if (!isPlatformUser) + return ( +
+ }> + + +
+ ); + + return ( + +

Member management

+