Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

more updates

Steven Teyaca0c09f5dc0
diff --git a/apps/web/app/(ee)/admin.dub.co/(dashboard)/components/user-info.tsx b/apps/web/app/(ee)/admin.dub.co/(dashboard)/components/user-info.tsx
index 7ba654e22d..11fa0863ad 100644
--- a/apps/web/app/(ee)/admin.dub.co/(dashboard)/components/user-info.tsx
+++ b/apps/web/app/(ee)/admin.dub.co/(dashboard)/components/user-info.tsx
@@ -1,6 +1,6 @@
"use client";
import { Badge, Copy, Tick, useCopyToClipboard } from "@dub/ui";
-import { capitalize, currencyFormatter, nFormatter } from "@dub/utils";
+import { capitalize, nFormatter } from "@dub/utils";
import { toast } from "sonner";
export interface UserInfoProps {
@@ -12,8 +12,8 @@ export interface UserInfoProps {
plan: string;
clicks: number;
links: number;
- sales: number;
- folders: number;
+ totalClicks: number;
+ totalLinks: number;
}[];
impersonateUrl: {
app: string;
@@ -21,6 +21,13 @@ export interface UserInfoProps {
};
}
+const items = [
+ { id: "clicks", label: "Clicks" },
+ { id: "links", label: "Links" },
+ { id: "totalClicks", label: "Total Clicks" },
+ { id: "totalLinks", label: "Total Links" },
+];
+
export default function UserInfo({ data }: { data: UserInfoProps }) {
return (
<div className="grid gap-2">
@@ -53,30 +60,16 @@ export default function UserInfo({ data }: { data: UserInfoProps }) {
{capitalize(workspace.plan)}
</span>
</div>
- <div className="flex justify-between text-sm">
- <span className="font-medium text-neutral-700">Folders</span>
- <span className="text-neutral-500">
- {nFormatter(workspace.folders, { full: true })}
- </span>
- </div>
- <div className="flex justify-between text-sm">
- <span className="font-medium text-neutral-700">Links</span>
- <span className="text-neutral-500">
- {nFormatter(workspace.links, { full: true })}
- </span>
- </div>
- <div className="flex justify-between text-sm">
- <span className="font-medium text-neutral-700">Clicks</span>
- <span className="text-neutral-500">
- {nFormatter(workspace.clicks, { full: true })}
- </span>
- </div>
- <div className="flex justify-between text-sm">
- <span className="font-medium text-neutral-700">Sales</span>
- <span className="text-neutral-500">
- {currencyFormatter(workspace.sales / 100)}
- </span>
- </div>
+ {items.map((item) => (
+ <div className="flex justify-between text-sm">
+ <span className="font-medium text-neutral-700">
+ {item.label}
+ </span>
+ <span className="text-neutral-500">
+ {nFormatter(workspace[item.id], { full: true })}
+ </span>
+ </div>
+ ))}
</div>
))}
</div>
diff --git a/apps/web/app/(ee)/api/admin/impersonate/route.ts b/apps/web/app/(ee)/api/admin/impersonate/route.ts
index 64c0be5fb7..8b493abe73 100644
--- a/apps/web/app/(ee)/api/admin/impersonate/route.ts
+++ b/apps/web/app/(ee)/api/admin/impersonate/route.ts
@@ -32,10 +32,10 @@ export const POST = withAdmin(async ({ req }) => {
name: true,
slug: true,
plan: true,
+ usage: true,
+ linksUsage: true,
totalClicks: true,
totalLinks: true,
- salesUsage: true,
- foldersUsage: true,
},
},
},
@@ -52,10 +52,10 @@ export const POST = withAdmin(async ({ req }) => {
workspaces: response.projects.map(({ project }) => ({
...project,
id: prefixWorkspaceId(project.id),
- clicks: project.totalClicks,
- links: project.totalLinks,
- sales: project.salesUsage,
- folders: project.foldersUsage,
+ clicks: project.usage,
+ links: project.linksUsage,
+ totalClicks: project.totalClicks,
+ totalLinks: project.totalLinks,
})),
impersonateUrl: await getImpersonateUrl(response.email),
};
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx
index e8e6aa4b42..31e0fe6e7b 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx
@@ -286,7 +286,7 @@ function UsageTabCard({
: [usageProp, limitProp];
const loading = usage === undefined || limit === undefined;
- const unlimited = limit !== undefined && limit >= INFINITY_NUMBER;
+ const unlimited = limitProp !== undefined && limitProp >= INFINITY_NUMBER; // using limitProp here cause payouts is divided by 100
const warning = !loading && !unlimited && usage >= limit * 0.9;
const remaining = !loading && !unlimited ? Math.max(0, limit - usage) : 0;
diff --git a/apps/web/scripts/update-payouts-limits.ts b/apps/web/scripts/update-payouts-limits.ts
index fdaa36904d..2f02538c40 100644
--- a/apps/web/scripts/update-payouts-limits.ts
+++ b/apps/web/scripts/update-payouts-limits.ts
@@ -4,10 +4,12 @@ import "dotenv-flow/config";
async function main() {
const workspaces = await prisma.project.updateMany({
where: {
- plan: "business",
+ plan: {
+ startsWith: "business",
+ },
},
data: {
- payoutsLimit: 2500_00,
+ payoutsLimit: 2_500_00,
},
});
diff --git a/packages/utils/src/constants/pricing.tsx b/packages/utils/src/constants/pricing.tsx
index 85a4dced0e..56f583d638 100644
--- a/packages/utils/src/constants/pricing.tsx
+++ b/packages/utils/src/constants/pricing.tsx
@@ -165,13 +165,13 @@ export const PLANS = [
text: "3-year analytics retention",
},
{
- id: "sales",
- text: "$25K tracked sales/mo",
+ id: "payouts",
+ text: "$2.5K partner payouts/mo",
tooltip: {
title:
- "Use Dub Conversions to track how your link clicks are converting to signups and sales. Limits are based on the total sale amount tracked within a given month.",
+ "Send payouts to your partners with 1-click (or automate it completely) – all across the world.",
cta: "Learn more.",
- href: "https://d.to/conversions",
+ href: "https://dub.co/help/article/partner-payouts",
},
},
{
@@ -229,7 +229,6 @@ export const PLANS = [
monthly: 300,
yearly: 250,
ids: [
- // 2025 pricing
"price_1R8Xw4AlJJEpqkPV6nwdink9", // yearly
"price_1R3j0qAlJJEpqkPVkfGNXRwb", // monthly
"price_1R8XztAlJJEpqkPVnHmIU2tf", // yearly (test),
@@ -263,13 +262,13 @@ export const PLANS = [
text: "5-year analytics retention",
},
{
- id: "sales",
- text: "$100K tracked sales/mo",
+ id: "payouts",
+ text: "$15K partner payouts/mo",
tooltip: {
title:
- "Use Dub Conversions to track how your link clicks are converting to signups and sales. Limits are based on the total sale amount tracked within a given month.",
+ "Send payouts to your partners with 1-click (or automate it completely) – all across the world.",
cta: "Learn more.",
- href: "https://d.to/conversions",
+ href: "https://dub.co/help/article/partner-payouts",
},
},
{
@@ -286,15 +285,6 @@ export const PLANS = [
href: "https://dub.co/docs/partners/white-labeling",
},
},
- {
- id: "volume",
- text: "Lower payout fees",
- tooltip: {
- title: "Lower fees associated with Partner payouts.",
- cta: "Learn more.",
- href: "https://dub.co/help/article/partner-payouts",
- },
- },
{
id: "api",
text: "Partners API",
@@ -320,7 +310,7 @@ export const PLANS = [
limits: {
links: 250000,
clicks: 5000000,
- payouts: 1000000_00,
+ payouts: INFINITY_NUMBER,
domains: 1000,
tags: INFINITY_NUMBER,
folders: INFINITY_NUMBER,