diff --git a/components/links/link-sheet/index.tsx b/components/links/link-sheet/index.tsx index 987a92f80..c5776a972 100644 --- a/components/links/link-sheet/index.tsx +++ b/components/links/link-sheet/index.tsx @@ -265,6 +265,7 @@ export default function LinkSheet({ enableScreenshotProtection: preset.enableScreenshotProtection || prev.enableScreenshotProtection, enableNotification: !!preset.enableNotification, + showBanner: preset.showBanner ?? prev.showBanner, }; }); diff --git a/ee/features/permissions/components/dataroom-link-sheet.tsx b/ee/features/permissions/components/dataroom-link-sheet.tsx index e2396be0f..bdd25e7f7 100644 --- a/ee/features/permissions/components/dataroom-link-sheet.tsx +++ b/ee/features/permissions/components/dataroom-link-sheet.tsx @@ -217,6 +217,7 @@ export function DataroomLinkSheet({ enableScreenshotProtection: preset.enableScreenshotProtection || prev.enableScreenshotProtection, enableNotification: !!preset.enableNotification, + showBanner: preset.showBanner ?? prev.showBanner, }; }); diff --git a/lib/zod/schemas/presets.ts b/lib/zod/schemas/presets.ts index 8da7e07fc..b3dbbbf66 100644 --- a/lib/zod/schemas/presets.ts +++ b/lib/zod/schemas/presets.ts @@ -61,6 +61,9 @@ export const presetDataSchema = z.object({ // Agreement enableAgreement: z.boolean().optional(), agreementId: z.string().nullable().optional(), + + // Banner + showBanner: z.boolean().optional(), }); export type PresetDataSchema = z.infer; diff --git a/pages/api/webhooks/services/[...path]/index.ts b/pages/api/webhooks/services/[...path]/index.ts index 1777fa6d7..519cfee52 100644 --- a/pages/api/webhooks/services/[...path]/index.ts +++ b/pages/api/webhooks/services/[...path]/index.ts @@ -488,7 +488,7 @@ async function handleDocumentCreate( enableNotification: link.enableNotification, enableFeedback: link.enableFeedback, enableScreenshotProtection: link.enableScreenshotProtection, - showBanner: link.showBanner, + showBanner: link.showBanner ?? preset?.showBanner ?? false, audienceType: link.audienceType, groupId: isGroupAudience ? link.groupId : null, // For group links, ignore allow/deny lists from presets as access is controlled by group membership @@ -700,7 +700,7 @@ async function handleLinkCreate( enableNotification: link.enableNotification, enableFeedback: link.enableFeedback, enableScreenshotProtection: link.enableScreenshotProtection, - showBanner: link.showBanner, + showBanner: link.showBanner ?? preset?.showBanner ?? false, audienceType: link.audienceType, groupId: isGroupAudience ? link.groupId : null, // For group links, ignore allow/deny lists from presets as access is controlled by group membership @@ -877,7 +877,7 @@ async function handleDataroomCreate( enableNotification: link.enableNotification, enableFeedback: link.enableFeedback, enableScreenshotProtection: link.enableScreenshotProtection, - showBanner: link.showBanner, + showBanner: link.showBanner ?? preset?.showBanner ?? false, audienceType: link.audienceType, groupId: isGroupAudience ? link.groupId : null, allowList: link.allowList || preset?.allowList, diff --git a/pages/settings/presets/[id].tsx b/pages/settings/presets/[id].tsx index 75ae1b080..701a1fd25 100644 --- a/pages/settings/presets/[id].tsx +++ b/pages/settings/presets/[id].tsx @@ -31,6 +31,7 @@ import ExpirationInSection from "@/components/links/link-sheet/expirationIn-sect import { LinkUpgradeOptions } from "@/components/links/link-sheet/link-options"; import OGSection from "@/components/links/link-sheet/og-section"; import PasswordSection from "@/components/links/link-sheet/password-section"; +import { ProBannerSection } from "@/components/links/link-sheet/pro-banner-section"; import ScreenshotProtectionSection from "@/components/links/link-sheet/screenshot-protection-section"; import WatermarkSection from "@/components/links/link-sheet/watermark-section"; import Preview from "@/components/settings/og-preview"; @@ -138,6 +139,7 @@ export default function EditPreset() { enableCustomFields: customFields.length > 0, customFields: customFields, enableNotification: preset.enableNotification ?? false, + showBanner: preset.showBanner ?? false, }); } }, [preset]); @@ -188,6 +190,7 @@ export default function EditPreset() { enableCustomFields: data.enableCustomFields, customFields: data.customFields, enableNotification: data.enableNotification, + showBanner: data.showBanner, }), }); @@ -476,6 +479,22 @@ export default function EditPreset() { presets={null} /> + +
+

Branding

+ +
diff --git a/pages/settings/presets/new.tsx b/pages/settings/presets/new.tsx index 969edd1c3..fd6d7bbee 100644 --- a/pages/settings/presets/new.tsx +++ b/pages/settings/presets/new.tsx @@ -32,6 +32,7 @@ import ExpirationInSection from "@/components/links/link-sheet/expirationIn-sect import { LinkUpgradeOptions } from "@/components/links/link-sheet/link-options"; import OGSection from "@/components/links/link-sheet/og-section"; import PasswordSection from "@/components/links/link-sheet/password-section"; +import { ProBannerSection } from "@/components/links/link-sheet/pro-banner-section"; import ScreenshotProtectionSection from "@/components/links/link-sheet/screenshot-protection-section"; import WatermarkSection from "@/components/links/link-sheet/watermark-section"; import Preview from "@/components/settings/og-preview"; @@ -137,6 +138,7 @@ export default function NewPreset() { : false, customFields: data.customFields, enableNotification: data.enableNotification, + showBanner: data.showBanner, }), }); @@ -313,6 +315,22 @@ export default function NewPreset() { presets={null} />
+ +
+

Branding

+ +
diff --git a/prisma/migrations/20251017000000_add_show_banner_to_presets/migration.sql b/prisma/migrations/20251017000000_add_show_banner_to_presets/migration.sql new file mode 100644 index 000000000..481e9cfee --- /dev/null +++ b/prisma/migrations/20251017000000_add_show_banner_to_presets/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "LinkPreset" ADD COLUMN "showBanner" BOOLEAN DEFAULT false; diff --git a/prisma/schema/link.prisma b/prisma/schema/link.prisma index 8182eebef..940d65883 100644 --- a/prisma/schema/link.prisma +++ b/prisma/schema/link.prisma @@ -125,6 +125,8 @@ model LinkPreset { enableCustomFields Boolean? @default(false) customFields Json? //[{type: "SHORT_TEXT", identifier: "name", label: "Name", required: true}] + showBanner Boolean? @default(false) // Optional give user a option to show the "Powered by Papermark" banner + isDefault Boolean @default(false) createdAt DateTime @default(now())