diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/billing/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/billing/page.tsx index 695144979f..cc97c5a210 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/billing/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/billing/page.tsx @@ -2,8 +2,11 @@ import { getServerSession } from "next-auth"; import { notFound } from "next/navigation"; import { authOptions } from "@formbricks/lib/authOptions"; -import { IS_FORMBRICKS_CLOUD, PRICING_APPSURVEYS_FREE_RESPONSES } from "@formbricks/lib/constants"; -import { PRICING_USERTARGETING_FREE_MTU } from "@formbricks/lib/constants"; +import { + IS_FORMBRICKS_CLOUD, + PRICING_APPSURVEYS_FREE_RESPONSES, + PRICING_USERTARGETING_FREE_MTU, +} from "@formbricks/lib/constants"; import { getMembershipByUserIdTeamId } from "@formbricks/lib/membership/service"; import { getAccessFlags } from "@formbricks/lib/membership/utils"; import { @@ -16,7 +19,7 @@ import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import SettingsTitle from "../components/SettingsTitle"; import PricingTable from "./components/PricingTable"; -export default async function ProfileSettingsPage({ params }) { +export default async function BillingPage({ params }) { if (!IS_FORMBRICKS_CLOUD) { notFound(); } diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/components/SettingsNavbar.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/components/SettingsNavbar.tsx index c826fa36cd..ec18ef592e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/components/SettingsNavbar.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/components/SettingsNavbar.tsx @@ -4,6 +4,7 @@ import { ChevronDownIcon } from "@heroicons/react/20/solid"; import { AdjustmentsVerticalIcon, BellAlertIcon, + BoltIcon, CreditCardIcon, DocumentCheckIcon, DocumentMagnifyingGlassIcon, @@ -133,6 +134,13 @@ export default function SettingsNavbar({ hidden: !isFormbricksCloud || isPricingDisabled, current: pathname?.includes("/billing"), }, + { + name: "Enterprise License", + href: `/environments/${environmentId}/settings/enterprise`, + icon: BoltIcon, + hidden: isFormbricksCloud || isPricingDisabled, + current: pathname?.includes("/enterprise"), + }, ], hidden: false, }, diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/enterprise/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/enterprise/loading.tsx new file mode 100644 index 0000000000..0b9c2babc0 --- /dev/null +++ b/apps/web/app/(app)/environments/[environmentId]/settings/enterprise/loading.tsx @@ -0,0 +1,12 @@ +export default function Loading() { + return ( +
+

Enterprise License

+
+
+
+
+
+
+ ); +} diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/enterprise/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/enterprise/page.tsx new file mode 100644 index 0000000000..6177ac4a43 --- /dev/null +++ b/apps/web/app/(app)/environments/[environmentId]/settings/enterprise/page.tsx @@ -0,0 +1,195 @@ +import { CheckIcon } from "lucide-react"; +import { getServerSession } from "next-auth"; +import { notFound } from "next/navigation"; + +import { getIsEnterpriseEdition } from "@formbricks/ee/lib/service"; +import { authOptions } from "@formbricks/lib/authOptions"; +import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; +import { getMembershipByUserIdTeamId } from "@formbricks/lib/membership/service"; +import { getAccessFlags } from "@formbricks/lib/membership/utils"; +import { getTeamByEnvironmentId } from "@formbricks/lib/team/service"; +import { Button } from "@formbricks/ui/Button"; + +import SettingsTitle from "../components/SettingsTitle"; + +export default async function EnterpriseLicensePage({ params }) { + if (IS_FORMBRICKS_CLOUD) { + notFound(); + } + + const session = await getServerSession(authOptions); + + const team = await getTeamByEnvironmentId(params.environmentId); + + if (!session) { + throw new Error("Unauthorized"); + } + + if (!team) { + throw new Error("Team not found"); + } + + const currentUserMembership = await getMembershipByUserIdTeamId(session?.user.id, team.id); + const { isAdmin, isOwner } = getAccessFlags(currentUserMembership?.role); + const isPricingDisabled = !isOwner && !isAdmin; + + if (isPricingDisabled) { + notFound(); + } + + const isEnterpriseEdition = getIsEnterpriseEdition(); + + const paidFeatures = [ + { + title: "Remove Formbricks Branding on In-app and Website Surveys", + comingSoon: false, + onRequest: false, + }, + { + title: "Team Roles (Admin, Editor, Developer, etc.)", + comingSoon: false, + onRequest: false, + }, + { + title: "Advanced Targeting and Segmentation (In-app Surveys)", + comingSoon: false, + onRequest: false, + }, + { + title: "Multi-Language Surveys", + comingSoon: true, + onRequest: false, + }, + { + title: "Audit Logs", + comingSoon: false, + onRequest: true, + }, + { + title: "SAML SSO", + comingSoon: false, + onRequest: true, + }, + { + title: "Service Level Agreement", + comingSoon: false, + onRequest: true, + }, + { + title: "SOC2, HIPAA, ISO 27001 Compliance check", + comingSoon: false, + onRequest: true, + }, + { + title: "Extensive Whitelabeling", + comingSoon: false, + onRequest: true, + }, + { + title: "Custom Feature Development", + comingSoon: false, + onRequest: true, + }, + ]; + + return ( + <> +
+ +
+ {isEnterpriseEdition ? ( +
+
+
+
+
+ +
+

+ Your Enterprise License is active. All features unlocked 🚀 +

+
+

+ Questions? Please reach out to{" "} + + hola@formbricks.com + +

+
+
+
+ ) : ( +
+
+ +
+

+ Unlock the full power of Formbricks. +

+

+ Keep full control over your data privacy and security. +
+ Get an Enterprise license to get access to all features. +

+
+
+
+
+

Enterprise Features

+
    + {paidFeatures.map((feature, index) => ( +
  • +
    + +
    + + {feature.title} + + {feature.comingSoon && ( + + coming soon + + )} + {feature.onRequest && ( + + on request + + )} +
  • + ))} +
+

+ You can request all Enterprise License info incl. Pricing via this form: +

+ +
+
+
+ )} +
+
+ + ); +}