diff --git a/valhalla/jawn/src/managers/organization/OrganizationManager.ts b/valhalla/jawn/src/managers/organization/OrganizationManager.ts index 625e43d724..93333fd3d0 100644 --- a/valhalla/jawn/src/managers/organization/OrganizationManager.ts +++ b/valhalla/jawn/src/managers/organization/OrganizationManager.ts @@ -358,7 +358,9 @@ export class OrganizationManager extends BaseManager { return ok(layout); } - async getMemberCount(): Promise> { + async getMemberCount( + filterHeliconeEmails: boolean = false + ): Promise> { const { data: members, error: membersError } = await this.organizationStore.getOrganizationMembers( this.authParams.organizationId @@ -367,7 +369,12 @@ export class OrganizationManager extends BaseManager { if (membersError !== null) { return err(membersError); } - return ok(members.length); + return ok( + members.filter( + (member) => + !filterHeliconeEmails || !member.email.endsWith("@helicone.ai") + ).length + ); } async getOrganizationMembers( diff --git a/valhalla/jawn/src/managers/stripe/StripeManager.ts b/valhalla/jawn/src/managers/stripe/StripeManager.ts index 3eda09ce1a..7655541b54 100644 --- a/valhalla/jawn/src/managers/stripe/StripeManager.ts +++ b/valhalla/jawn/src/managers/stripe/StripeManager.ts @@ -8,15 +8,16 @@ import { dbExecute } from "../../lib/shared/db/dbExecute"; import { clickhouseDb } from "../../lib/db/ClickhouseWrapper"; import { buildFilterWithAuthClickHouse } from "../../lib/shared/filters/filters"; import { UpgradeToProRequest } from "../../controllers/public/stripeController"; +import { OrganizationManager } from "../organization/OrganizationManager"; const proProductPrices = { - "request-volume": process.env.PRICE_PROD_REQUEST_VOLUME_ID!, + "request-volume": process.env.PRICE_PROD_REQUEST_VOLUME_ID!, //(This is just growth) "pro-users": process.env.PRICE_PROD_PRO_USERS_ID!, prompts: process.env.PRICE_PROD_PROMPTS_ID!, alerts: process.env.PRICE_PROD_ALERTS_ID!, }; -const EARLY_ADOPTER_COUPON = "WlDg28Kf"; // WlDg28Kf | prod: 9ca5IeEs +const EARLY_ADOPTER_COUPON = "9ca5IeEs"; // WlDg28Kf | prod: 9ca5IeEs export class StripeManager extends BaseManager { private stripe: Stripe; @@ -45,10 +46,6 @@ export class StripeManager extends BaseManager { return err("User does not have an email"); } - const getStripeCustomer = await this.stripe.customers.list({ - email: user.data?.user?.email ?? "", - }); - console.log(getStripeCustomer); const customer = await this.stripe.customers.create({ email: user.data.user.email, }); @@ -201,17 +198,8 @@ WHERE (${builtFilter.filter})`, } } private async getOrgMemberCount(): Promise> { - const members = await supabaseServer.client - .from("organization_member") - .select("*", { count: "exact" }) - .eq("organization", this.authParams.organizationId); - - if (members.error) { - console.log(members.error); - return err("Error getting organization members"); - } - - return ok(members.count!); + const organizationManager = new OrganizationManager(this.authParams); + return await organizationManager.getMemberCount(true); } private shouldApplyCoupon(): boolean { diff --git a/web/components/layout/auth/DesktopSidebar.tsx b/web/components/layout/auth/DesktopSidebar.tsx index 494141daf0..8454967f77 100644 --- a/web/components/layout/auth/DesktopSidebar.tsx +++ b/web/components/layout/auth/DesktopSidebar.tsx @@ -109,7 +109,7 @@ const DesktopSidebar = ({ NAVIGATION }: SidebarProps) => { >
-
+
{!isCollapsed && }
@@ -276,7 +276,7 @@ const DesktopSidebar = ({ NAVIGATION }: SidebarProps) => { )}
- {tier === "free" && + {/* {tier === "free" && org?.currentOrg?.organization_type !== "customer" && (
@@ -294,7 +294,7 @@ const DesktopSidebar = ({ NAVIGATION }: SidebarProps) => {
- )} + )} */}
diff --git a/web/components/layout/orgDropdown.tsx b/web/components/layout/orgDropdown.tsx index b171d46843..3112e0edde 100644 --- a/web/components/layout/orgDropdown.tsx +++ b/web/components/layout/orgDropdown.tsx @@ -89,7 +89,7 @@ export default function OrgDropdown({}: OrgDropdownProps) { + + + + + +
+ + window.open( + "https://cal.com/team/helicone/helicone-discovery", + "_blank" + ) + } + /> + + + window.open( + "https://docs.helicone.ai/advanced-usage/enterprise-features", + "_blank" + ) + } + /> +
+
+ ); +}; diff --git a/web/components/templates/organization/plan/billingPage.tsx b/web/components/templates/organization/plan/billingPage.tsx index a5adcfc544..3a34070f72 100644 --- a/web/components/templates/organization/plan/billingPage.tsx +++ b/web/components/templates/organization/plan/billingPage.tsx @@ -5,6 +5,7 @@ import { FreePlanCard } from "./freeBillingPage"; import { ProPlanCard } from "./proBillingPage"; import { MigrateGrowthToPro } from "./MigrateGrowthToPro"; import { UnknownTierCard } from "./UnknownTierCard"; +import { EnterprisePlanCard } from "./EnterprisePlanCard"; interface OrgPlanPageProps {} @@ -26,6 +27,7 @@ const BillingPlanPage = (props: OrgPlanPageProps) => { !knownTiers.includes(org?.currentOrg?.tier) && ( )} + {org?.currentOrg?.tier === "enterprise" && } {/*
Looking for something else? diff --git a/web/components/templates/pricing/upgradeToProCTA.tsx b/web/components/templates/pricing/upgradeToProCTA.tsx index 87eb333424..62a4872a67 100644 --- a/web/components/templates/pricing/upgradeToProCTA.tsx +++ b/web/components/templates/pricing/upgradeToProCTA.tsx @@ -4,7 +4,7 @@ import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { getJawnClient } from "@/lib/clients/jawn"; import { useMutation, useQuery } from "@tanstack/react-query"; -import { useState } from "react"; +import { useMemo, useState } from "react"; export const UpgradeToProCTA = ({ defaultPrompts = false, @@ -43,6 +43,10 @@ export const UpgradeToProCTA = ({ }, }); + const isPro = useMemo(() => { + return org?.currentOrg?.tier === "pro-20240913"; + }, [org?.currentOrg?.tier]); + return (
{showAddons && ( @@ -88,17 +92,25 @@ export const UpgradeToProCTA = ({
); diff --git a/web/components/templates/prompts/promptsPage.tsx b/web/components/templates/prompts/promptsPage.tsx index f360ece8c6..f4d15ea267 100644 --- a/web/components/templates/prompts/promptsPage.tsx +++ b/web/components/templates/prompts/promptsPage.tsx @@ -144,10 +144,10 @@ const PromptsPage = (props: PromptsPageProps) => { const hasAccess = useMemo(() => { return ( - org?.currentOrg?.tier === "pro-20240913" || org?.currentOrg?.tier === "growth" || - (org?.currentOrg?.stripe_metadata as { addons?: { prompts?: boolean } }) - ?.addons?.prompts + (org?.currentOrg?.tier === "pro-20240913" && + (org?.currentOrg?.stripe_metadata as { addons?: { prompts?: boolean } }) + ?.addons?.prompts) ); }, [org?.currentOrg?.tier, org?.currentOrg?.stripe_metadata]); @@ -204,17 +204,26 @@ const PromptsPage = (props: PromptsPageProps) => { - + {hasAccess ? ( - + ) : ( + + + + )}