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.

Merge branch 'main' into link-folders

Kiran K28256f05dff8
diff --cc apps/web/lib/analytics/get-analytics.ts
index 7e7afc41b8,f8f4f106e2..74e0072250
--- a/apps/web/lib/analytics/get-analytics.ts
+++ b/apps/web/lib/analytics/get-analytics.ts
@@@ -24,14 -25,10 +25,16 @@@ export const getAnalytics = async (para
timezone = "UTC",
isDemo,
isDeprecatedClicksEndpoint = false,
+ allowedFolderIds,
+ folderId,
} = params;
+ if (folderId) {
+ allowedFolderIds = [folderId];
+ }
+
+ const tagIds = combineTagIds(params);
+
// get all-time clicks count if:
// 1. type is count
// 2. linkId is defined
diff --cc apps/web/lib/analytics/types.ts
index 64cd06fd68,a0d2285541..d48118f72c
--- a/apps/web/lib/analytics/types.ts
+++ b/apps/web/lib/analytics/types.ts
@@@ -40,5 -39,33 +40,34 @@@ export type AnalyticsFilters = z.infer<
export type EventsFilters = z.infer<typeof eventsQuerySchema> & {
workspaceId?: string;
isDemo?: boolean;
+ obfuscateData?: boolean;
+ allowedFolderIds?: string[];
};
+
+ const partnerAnalyticsSchema = analyticsQuerySchema
+ .pick({
+ event: true,
+ interval: true,
+ start: true,
+ end: true,
+ groupBy: true,
+ })
+ .partial();
+
+ export type PartnerAnalyticsFilters = z.infer<typeof partnerAnalyticsSchema>;
+
+ const partnerEventsSchema = eventsQuerySchema
+ .pick({
+ event: true,
+ interval: true,
+ start: true,
+ end: true,
+ groupBy: true,
+ page: true,
+ limit: true,
+ order: true,
+ sortBy: true,
+ })
+ .partial();
+
+ export type PartnerEventsFilters = z.infer<typeof partnerEventsSchema>;
diff --cc apps/web/lib/api/links/get-links-for-workspace.ts
index 9dd9c712ba,bf0075eb64..a1d5b514da
--- a/apps/web/lib/api/links/get-links-for-workspace.ts
+++ b/apps/web/lib/api/links/get-links-for-workspace.ts
@@@ -16,10 -17,10 +17,11 @@@ export async function getLinksForWorksp
userId,
showArchived,
withTags,
+ folderId,
+ linkIds,
includeUser,
includeWebhooks,
+ includeDashboard,
- linkIds,
}: z.infer<typeof getLinksQuerySchemaExtended> & {
workspaceId: string;
}) {
diff --cc apps/web/lib/edge-config/get-feature-flags.ts
index b25e5db911,6b213b45d5..729b26add7
--- a/apps/web/lib/edge-config/get-feature-flags.ts
+++ b/apps/web/lib/edge-config/get-feature-flags.ts
@@@ -19,7 -19,7 +19,8 @@@ export const getFeatureFlags = async (
const workspaceFeatures: Record<BetaFeatures, boolean> = {
referrals: false,
webhooks: false,
+ noDubLink: false,
+ linkFolders: false,
};
if (!process.env.NEXT_PUBLIC_IS_DUB || !process.env.EDGE_CONFIG) {
diff --cc apps/web/lib/types.ts
index b3957fe3d4,e1cdafb694..ed955f4aec
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@@ -71,7 -77,7 +77,11 @@@ export type PlanProps = (typeof plans)[
export type RoleProps = (typeof roles)[number];
- export type BetaFeatures = "linkFolders" | "referrals" | "webhooks";
-export type BetaFeatures = "referrals" | "webhooks" | "noDubLink";
++export type BetaFeatures =
++ | "referrals"
++ | "webhooks"
++ | "noDubLink"
++ | "linkFolders";
export type AddOns = "conversion" | "sso";
diff --cc apps/web/prisma/schema/workspace.prisma
index 27f23d3e63,ba6b7bd77b..34c0654764
--- a/apps/web/prisma/schema/workspace.prisma
+++ b/apps/web/prisma/schema/workspace.prisma
@@@ -51,8 -51,8 +52,9 @@@ model Project
integrations Integration[] // Integrations workspace published
installedIntegrations InstalledIntegration[] // Integrations workspace installed
webhooks Webhook[]
+ folders Folder[]
registeredDomains RegisteredDomain[]
+ dashboards Dashboard[]
utmTemplates UtmTemplate[]
@@index(usageLastChecked(sort: Asc))
diff --cc apps/web/ui/analytics/analytics-provider.tsx
index 9c40954f2b,664d7ead62..c231f1e2b0
--- a/apps/web/ui/analytics/analytics-provider.tsx
+++ b/apps/web/ui/analytics/analytics-provider.tsx
@@@ -77,17 -99,21 +99,23 @@@ export default function AnalyticsProvid
const { id: workspaceId, slug, conversionEnabled } = useWorkspace();
const [requiresUpgrade, setRequiresUpgrade] = useState(false);
- let { key } = useParams() as {
- key?: string;
+ let { dashboardId } = useParams() as {
+ dashboardId?: string;
};
const domainSlug = searchParams?.get("domain");
- // key can be a path param (public stats pages) or a query param (stats pages in app)
- key = searchParams?.get("key") || key;
+ // key can be a query param (stats pages in app) or passed as a staticKey (shared analytics dashboards)
+ const key = searchParams?.get("key") || dashboardProps?.key;
+
+ // Whether to show conversions in shared analytics dashboards
+ const showConversions = dashboardProps?.showConversions;
- const tagId = searchParams?.get("tagId") ?? undefined;
+ const tagIds = combineTagIds({
+ tagId: searchParams?.get("tagId"),
+ tagIds: searchParams?.get("tagIds")?.split(","),
+ })?.join(",");
+ const folderId = searchParams?.get("folderId") ?? undefined;
+
// Default to last 24 hours
const { start, end } = useMemo(() => {
const hasRange = searchParams?.has("start") && searchParams?.has("end");
@@@ -185,22 -223,11 +225,22 @@@
...(start &&
end && { start: start.toISOString(), end: end.toISOString() }),
...(interval && { interval }),
- ...(tagId && { tagId }),
+ ...(tagIds && { tagIds }),
...(root && { root: root.toString() }),
event: selectedTab,
+ ...(folderId && { folderId }),
}).toString();
- }, [workspaceId, domain, key, searchParams, start, end, tagIds, selectedTab]);
+ }, [
+ workspaceId,
+ domain,
+ key,
+ searchParams,
+ start,
+ end,
- tagId,
++ tagIds,
+ selectedTab,
+ folderId,
+ ]);
// Reset requiresUpgrade when query changes
useEffect(() => setRequiresUpgrade(false), [queryString]);
diff --cc apps/web/ui/layout/page-content/index.tsx
index e8659e41e1,ba16e07af8..e3bbc87b8c
--- a/apps/web/ui/layout/page-content/index.tsx
+++ b/apps/web/ui/layout/page-content/index.tsx
@@@ -14,14 -15,28 +15,28 @@@ export function PageContent(
return (
<div className="bg-neutral-100 md:bg-white">
- <MaxWidthWrapper className={cn("mt-3", hasTitle && "md:mt-6 md:py-3")}>
+ <MaxWidthWrapper
+ className={cn(
+ "mt-3",
+ (hasTitle || hasDescription) && "md:mt-6 md:py-3",
+ )}
+ >
<div className="flex items-center justify-between gap-4">
- <div className="flex items-center gap-4">
+ <div className="flex min-w-0 items-center gap-4">
<NavButton />
- {hasTitle && (
- <TitleComponent className="min-w-0 text-xl font-semibold leading-7 text-neutral-900 md:text-2xl">
- {title}
- </TitleComponent>
+ {(hasTitle || hasDescription) && (
+ <div>
+ {hasTitle && (
+ <h1 className="text-xl font-semibold leading-7 text-neutral-900 md:text-2xl">
+ {title}
+ </h1>
+ )}
+ {hasDescription && (
+ <p className="mt-1 hidden text-base text-neutral-500 md:block">
+ {description}
+ </p>
+ )}
+ </div>
)}
</div>
<div className="flex items-center gap-4 md:hidden">
diff --cc packages/ui/src/icons/nucleo/index.ts
index fd4cda4d01,a5d91c60a4..8b31c03163
--- a/packages/ui/src/icons/nucleo/index.ts
+++ b/packages/ui/src/icons/nucleo/index.ts
@@@ -48,11 -55,8 +55,12 @@@ export * from "./flag-wavy"
export * from "./flag2";
export * from "./flag6";
export * from "./folder";
+export * from "./folder-bookmark";
+export * from "./folder-lock";
+export * from "./folder-plus";
+export * from "./folder-shield";
export * from "./gaming-console";
+ export * from "./gauge6";
export * from "./gear";
export * from "./gear2";
export * from "./gift";
diff --cc packages/utils/src/constants/pricing.tsx
index 5b18edd9f9,03002932ba..1c1ec10d3b
--- a/packages/utils/src/constants/pricing.tsx
+++ b/packages/utils/src/constants/pricing.tsx
@@@ -35,8 -32,7 +33,8 @@@ const BUSINESS_PLAN_MODIFIER = (
links,
clicks,
domains,
- tags,
- folders,
+ tags: 1000000000,
++ folders: 1000000000,
users,
ai: 1000,
api: 3000,