The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Merge branch 'main' into link-folders
Tim Wilson4dbc6add72db
diff --cc apps/web/lib/api/links/process-link.tsindex fa4909bdd9,e95e0d3689..6a6625ece3--- a/apps/web/lib/api/links/process-link.ts+++ b/apps/web/lib/api/links/process-link.ts@@@ -1,10 -1,4 +1,6 @@@- import {- getFeatureFlags,- isBlacklistedDomain,- updateConfig,- } from "@/lib/edge-config";+ import { isBlacklistedDomain, updateConfig } from "@/lib/edge-config";+import { getFolder } from "@/lib/folder/get-folder";+import { canPerformActionOnFolder } from "@/lib/folder/permissions";import { getPangeaDomainIntel } from "@/lib/pangea";import { checkIfUserExists, getRandomKey } from "@/lib/planetscale";import { prisma } from "@/lib/prisma";diff --cc apps/web/lib/edge-config/get-feature-flags.tsindex bf0d54da3c,e6d0be8cf4..b25e5db911--- a/apps/web/lib/edge-config/get-feature-flags.ts+++ b/apps/web/lib/edge-config/get-feature-flags.ts@@@ -17,10 -17,8 +17,9 @@@ export const getFeatureFlags = async (}const workspaceFeatures: Record<BetaFeatures, boolean> = {- callink: false,referrals: false,webhooks: false,+ linkFolders: false,};if (!process.env.NEXT_PUBLIC_IS_DUB || !process.env.EDGE_CONFIG) {diff --cc apps/web/lib/types.tsindex 481834293c,b0e8fbffe5..b3957fe3d4--- a/apps/web/lib/types.ts+++ b/apps/web/lib/types.ts@@@ -71,7 -71,7 +71,7 @@@ export type PlanProps = (typeof plans)[export type RoleProps = (typeof roles)[number];- export type BetaFeatures = "callink" | "linkFolders" | "referrals" | "webhooks";-export type BetaFeatures = "referrals" | "webhooks";++export type BetaFeatures = "linkFolders" | "referrals" | "webhooks";export type AddOns = "conversion" | "sso";diff --cc apps/web/ui/links/link-controls.tsxindex b508303488,a65bc33459..6ad73e31a5--- a/apps/web/ui/links/link-controls.tsx+++ b/apps/web/ui/links/link-controls.tsx@@@ -82,8 -78,32 +82,32 @@@ export function LinkControls({ link }:},});+ const handleBanLink = () => {+ window.confirm(+ "Are you sure you want to ban this link? It will blacklist the domain and prevent any links from that domain from being created.",+ ) &&+ (setOpenPopover(false),+ toast.promise(+ fetch(`/api/admin/links/ban?key=${link.key}`, {+ method: "DELETE",+ }).then(async () => {+ await mutate(+ (key) =>+ typeof key === "string" && key.startsWith("/api/admin/links/ban"),+ undefined,+ { revalidate: true },+ );+ }),+ {+ loading: "Banning link...",+ success: "Link banned!",+ error: "Error banning link.",+ },+ ));+ };+useKeyboardShortcut(- ["e", "d", "q", "m", "a", "t", "i", "x"],- ["e", "d", "q", "a", "t", "i", "x", "b"],++ ["e", "d", "q", "m", "a", "t", "i", "x", "b"],(e) => {setOpenPopover(false);switch (e.key) {