Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: fixes

Marc Seitz39922b1d7048
diff --git a/components/datarooms/dataroom-items-list.tsx b/components/datarooms/dataroom-items-list.tsx
index 9e6a503d..53561cd2 100644
--- a/components/datarooms/dataroom-items-list.tsx
+++ b/components/datarooms/dataroom-items-list.tsx
@@ -632,7 +632,7 @@ export function DataroomItemsList({
</Portal>
{mixedItems.length === 0 && (
<div className="flex h-full justify-center">
- <EmptyDocuments />
+ <EmptyDocuments isDataroom={true} />
</div>
)}
</div>
@@ -701,7 +701,7 @@ export function DataroomItemsList({
{mixedItems.length === 0 && (
<div className="flex h-full justify-center">
- <EmptyDocuments />
+ <EmptyDocuments isDataroom={true} />
</div>
)}
</DndContext>
diff --git a/components/documents/empty-document.tsx b/components/documents/empty-document.tsx
index 8b78de09..c8302734 100644
--- a/components/documents/empty-document.tsx
+++ b/components/documents/empty-document.tsx
@@ -1,9 +1,34 @@
-import { FilePlusIcon, PlusIcon } from "lucide-react";
+import { FilePlusIcon, PlusIcon, UploadIcon } from "lucide-react";
import { Button } from "../ui/button";
import { AddDocumentModal } from "./add-document-modal";
-export function EmptyDocuments() {
+export function EmptyDocuments({
+ isDataroom = false,
+}: {
+ isDataroom?: boolean;
+}) {
+ if (isDataroom) {
+ return (
+ <div className="flex w-full items-center justify-center py-8">
+ <div className="flex min-h-[300px] w-full max-w-2xl items-center justify-center rounded-lg border border-dashed border-black/25 dark:border-white/25">
+ <div className="text-center">
+ <UploadIcon
+ className="mx-auto h-10 w-10 text-gray-500"
+ aria-hidden="true"
+ />
+ <h3 className="mt-4 text-sm font-semibold leading-6 text-gray-500">
+ Drag and Drop for Bulk Upload
+ </h3>
+ <p className="mt-1 text-xs leading-5 text-gray-500">
+ No documents. Get started by uploading document.
+ </p>
+ </div>
+ </div>
+ </div>
+ );
+ }
+
return (
<div className="text-center">
<FilePlusIcon
diff --git a/components/links/link-sheet/custom-fields-section.tsx b/components/links/link-sheet/custom-fields-section.tsx
index d840075d..f3cc87c7 100644
--- a/components/links/link-sheet/custom-fields-section.tsx
+++ b/components/links/link-sheet/custom-fields-section.tsx
@@ -91,6 +91,7 @@ export default function CustomFieldsSection({
<LinkItem
title="Custom Fields"
tooltipContent="Add custom fields to collect additional information from viewers"
+ link="https://www.papermark.com/help/article/custom-fields"
enabled={enabled}
action={handleCustomFieldsToggle}
isAllowed={isAllowed}
diff --git a/components/links/link-sheet/index.tsx b/components/links/link-sheet/index.tsx
index c5776a97..78513d40 100644
--- a/components/links/link-sheet/index.tsx
+++ b/components/links/link-sheet/index.tsx
@@ -72,6 +72,7 @@ export const DEFAULT_LINK_PROPS = (
metaDescription: null,
metaImage: null,
metaFavicon: null,
+ welcomeMessage: null,
enabledQuestion: false,
questionText: null,
questionType: null,
@@ -114,6 +115,7 @@ export type DEFAULT_LINK_TYPE = {
metaDescription: string | null; // metatags
metaImage: string | null; // metatags
metaFavicon: string | null; // metaFavicon
+ welcomeMessage: string | null; // custom welcome message
enableQuestion?: boolean; // feedback question
questionText: string | null;
questionType: string | null;
@@ -259,6 +261,7 @@ export default function LinkSheet({
metaDescription: preset.metaDescription || prev.metaDescription,
metaImage: preset.metaImage || prev.metaImage,
metaFavicon: preset.metaFavicon || prev.metaFavicon,
+ welcomeMessage: preset.welcomeMessage || prev.welcomeMessage,
allowDownload: preset.allowDownload || prev.allowDownload,
enableAgreement: preset.enableAgreement || prev.enableAgreement,
agreementId: preset.agreementId || prev.agreementId,
diff --git a/components/links/link-sheet/link-options.tsx b/components/links/link-sheet/link-options.tsx
index 4117d82c..08db241d 100644
--- a/components/links/link-sheet/link-options.tsx
+++ b/components/links/link-sheet/link-options.tsx
@@ -36,6 +36,7 @@ import QuestionSection from "./question-section";
import ScreenshotProtectionSection from "./screenshot-protection-section";
import UploadSection from "./upload-section";
import WatermarkSection from "./watermark-section";
+import { WelcomeMessageSection } from "./welcome-message-section";
export type LinkUpgradeOptions = {
state: boolean;
@@ -170,21 +171,6 @@ export const LinkOptions = ({
</>
) : null}
- {/* OG Section */}
- <OGSection
- {...{ data, setData }}
- isAllowed={
- isTrial ||
- (isPro && allowAdvancedLinkControls) ||
- isBusiness ||
- isDatarooms ||
- isDataroomsPlus
- }
- handleUpgradeStateChange={handleUpgradeStateChange}
- editLink={editLink ?? false}
- presets={currentPreset}
- />
-
{/* Security Section */}
<CollapsibleSection title="Security Controls" defaultOpen={true}>
<div>
@@ -222,85 +208,91 @@ export const LinkOptions = ({
}
handleUpgradeStateChange={handleUpgradeStateChange}
/>
- </div>
- </CollapsibleSection>
-
- {/* Advanced Section */}
- <CollapsibleSection title="Advanced Controls" defaultOpen={true}>
- <div>
- {linkType === LinkType.DATAROOM_LINK && targetId ? (
- <UploadSection
+ {linkType === LinkType.DOCUMENT_LINK ? (
+ <CustomFieldsSection
{...{ data, setData }}
- isAllowed={
- isTrial ||
- isDataroomsPlus ||
- (isDatarooms && limits?.dataroomUpload === true)
- }
+ isAllowed={isTrial || isBusiness || isDatarooms || isDataroomsPlus}
handleUpgradeStateChange={handleUpgradeStateChange}
- targetId={targetId}
+ presets={currentPreset}
/>
) : null}
+ </div>
+ </CollapsibleSection>
+
+ {/* Custom Branding Section */}
+ <CollapsibleSection title="Custom Branding" defaultOpen={true}>
+ <div>
+ <WelcomeMessageSection {...{ data, setData }} />
+ <OGSection
+ {...{ data, setData }}
+ isAllowed={
+ isTrial ||
+ (isPro && allowAdvancedLinkControls) ||
+ isBusiness ||
+ isDatarooms ||
+ isDataroomsPlus
+ }
+ handleUpgradeStateChange={handleUpgradeStateChange}
+ editLink={editLink ?? false}
+ presets={currentPreset}
+ />
+ <ProBannerSection
+ {...{ data, setData }}
+ isAllowed={
+ isTrial ||
+ isPro ||
+ isBusiness ||
+ isDatarooms ||
+ isDataroomsPlus ||
+ isStarter
+ }
+ handleUpgradeStateChange={handleUpgradeStateChange}
+ />
+ </div>
+ </CollapsibleSection>
+
+ {/* Advanced Section - Only for Datarooms */}
+ {linkType === LinkType.DATAROOM_LINK ? (
+ <CollapsibleSection title="Advanced Controls" defaultOpen={true}>
+ <div>
+ {targetId ? (
+ <UploadSection
+ {...{ data, setData }}
+ isAllowed={
+ isTrial ||
+ isDataroomsPlus ||
+ (isDatarooms && limits?.dataroomUpload === true)
+ }
+ handleUpgradeStateChange={handleUpgradeStateChange}
+ targetId={targetId}
+ />
+ ) : null}
- {linkType === LinkType.DATAROOM_LINK ? (
<IndexFileSection
{...{ data, setData }}
isAllowed={isTrial || isDataroomsPlus}
handleUpgradeStateChange={handleUpgradeStateChange}
/>
- ) : null}
- {linkType === LinkType.DATAROOM_LINK &&
- limits?.conversationsInDataroom ? (
- <ConversationSection
- {...{ data, setData }}
- isAllowed={
- isDataroomsPlus ||
- ((isBusiness || isDatarooms) && limits?.conversationsInDataroom)
- }
- handleUpgradeStateChange={handleUpgradeStateChange}
- />
- ) : null}
-
- {linkType === LinkType.DOCUMENT_LINK ? (
- <FeedbackSection {...{ data, setData }} />
- ) : null}
+ {limits?.conversationsInDataroom ? (
+ <ConversationSection
+ {...{ data, setData }}
+ isAllowed={
+ isDataroomsPlus ||
+ ((isBusiness || isDatarooms) && limits?.conversationsInDataroom)
+ }
+ handleUpgradeStateChange={handleUpgradeStateChange}
+ />
+ ) : null}
- {linkType === LinkType.DOCUMENT_LINK ? (
- <QuestionSection
+ <CustomFieldsSection
{...{ data, setData }}
- isAllowed={
- isTrial ||
- (isPro && allowAdvancedLinkControls) ||
- isBusiness ||
- isDatarooms ||
- isDataroomsPlus
- }
+ isAllowed={isTrial || isBusiness || isDatarooms || isDataroomsPlus}
handleUpgradeStateChange={handleUpgradeStateChange}
+ presets={currentPreset}
/>
- ) : null}
-
- <CustomFieldsSection
- {...{ data, setData }}
- isAllowed={isTrial || isBusiness || isDatarooms || isDataroomsPlus}
- handleUpgradeStateChange={handleUpgradeStateChange}
- presets={currentPreset}
- />
- </div>
- </CollapsibleSection>
-
- {linkType === LinkType.DOCUMENT_LINK ? (
- <ProBannerSection
- {...{ data, setData }}
- isAllowed={
- isTrial ||
- isPro ||
- isBusiness ||
- isDatarooms ||
- isDataroomsPlus ||
- isStarter
- }
- handleUpgradeStateChange={handleUpgradeStateChange}
- />
+ </div>
+ </CollapsibleSection>
) : null}
<UpgradePlanModal
diff --git a/components/links/link-sheet/password-section.tsx b/components/links/link-sheet/password-section.tsx
index 1566b652..c4826787 100644
--- a/components/links/link-sheet/password-section.tsx
+++ b/components/links/link-sheet/password-section.tsx
@@ -41,6 +41,7 @@ export default function PasswordSection({
enabled={enabled}
action={handleEnablePassword}
tooltipContent="Users must enter a password to access the content."
+ link="https://www.papermark.com/password-protection"
/>
{enabled && (
diff --git a/components/links/link-sheet/pro-banner-section.tsx b/components/links/link-sheet/pro-banner-section.tsx
index 505db116..0c5556fd 100644
--- a/components/links/link-sheet/pro-banner-section.tsx
+++ b/components/links/link-sheet/pro-banner-section.tsx
@@ -36,7 +36,9 @@ export function ProBannerSection({
return (
<div className="pb-5">
<LinkItem
- title="Show Visitor Statistics & Papermark Branding"
+ title="Show Secured by Papermark"
+ tooltipContent="Display 'Secured by Papermark' branding on your shared documents"
+ link="https://www.papermark.com/help/article/remove-papermark-branding"
enabled={enabled}
action={handleShowBanner}
isAllowed={isAllowed}
diff --git a/components/links/link-sheet/screenshot-protection-section.tsx b/components/links/link-sheet/screenshot-protection-section.tsx
index 03b827c2..73d069cb 100644
--- a/components/links/link-sheet/screenshot-protection-section.tsx
+++ b/components/links/link-sheet/screenshot-protection-section.tsx
@@ -41,6 +41,7 @@ export default function ScreenshotProtectionSection({
<LinkItem
title="Enable screenshot protection"
tooltipContent="Prevent users from taking screenshots of your content."
+ link="https://www.papermark.com/screenshot-protection"
enabled={enabled}
action={handleEnableScreenshotProtection}
isAllowed={isAllowed}
diff --git a/components/links/link-sheet/tags/tag-section.tsx b/components/links/link-sheet/tags/tag-section.tsx
index e7484f10..b8ca02f3 100644
--- a/components/links/link-sheet/tags/tag-section.tsx
+++ b/components/links/link-sheet/tags/tag-section.tsx
@@ -3,7 +3,7 @@ import Link from "next/link";
import { Dispatch, SetStateAction, useMemo, useState } from "react";
import { PlanEnum } from "@/ee/stripe/constants";
-import { Tag } from "lucide-react";
+import { CircleHelpIcon, Tag } from "lucide-react";
import { toast } from "sonner";
import { mutate } from "swr";
@@ -14,6 +14,7 @@ import { TagProps } from "@/lib/types";
import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";
import { Label } from "@/components/ui/label";
import { MultiSelect } from "@/components/ui/multi-select-v2";
+import { BadgeTooltip } from "@/components/ui/tooltip";
import { DEFAULT_LINK_TYPE } from "..";
@@ -113,7 +114,15 @@ export default function TagSection({
return (
<>
<div className="flex justify-between">
- <Label htmlFor="link-domain">Tags</Label>
+ <div className="flex items-center gap-2">
+ <Label htmlFor="link-domain">Tags</Label>
+ <BadgeTooltip
+ content="Group links by tags to organize and track performance"
+ link="https://www.papermark.com/help/article/tag-links"
+ >
+ <CircleHelpIcon className="h-4 w-4 shrink-0 text-muted-foreground hover:text-foreground" />
+ </BadgeTooltip>
+ </div>
<Link
href={`/settings/tags`}
className="text-xs text-muted-foreground hover:text-foreground hover:underline"
diff --git a/components/links/link-sheet/welcome-message-section.tsx b/components/links/link-sheet/welcome-message-section.tsx
new file mode 100644
index 00000000..9673b3ba
--- /dev/null
+++ b/components/links/link-sheet/welcome-message-section.tsx
@@ -0,0 +1,113 @@
+import { useEffect, useState } from "react";
+
+import { Label } from "@radix-ui/react-label";
+import { motion } from "motion/react";
+
+import { FADE_IN_ANIMATION_SETTINGS } from "@/lib/constants";
+import { cn } from "@/lib/utils";
+
+import { Textarea } from "@/components/ui/textarea";
+
+import { DEFAULT_LINK_TYPE } from ".";
+import LinkItem from "./link-item";
+
+const MAX_WELCOME_MESSAGE_LENGTH = 80;
+
+export function WelcomeMessageSection({
+ data,
+ setData,
+}: {
+ data: DEFAULT_LINK_TYPE;
+ setData: React.Dispatch<React.SetStateAction<DEFAULT_LINK_TYPE>>;
+}) {
+ const { welcomeMessage } = data;
+ const [enabled, setEnabled] = useState<boolean>(!!welcomeMessage);
+ const [welcomeMessageError, setWelcomeMessageError] = useState<
+ string | null
+ >(null);
+
+ useEffect(() => {
+ setEnabled(!!welcomeMessage);
+ }, [welcomeMessage]);
+
+ const handleWelcomeMessageToggle = () => {
+ const updatedEnabled = !enabled;
+ setEnabled(updatedEnabled);
+
+ if (!updatedEnabled) {
+ // Clear the welcome message when disabled
+ setData({ ...data, welcomeMessage: null });
+ setWelcomeMessageError(null);
+ }
+ };
+
+ const validateWelcomeMessage = (message: string): boolean => {
+ if (message.length > MAX_WELCOME_MESSAGE_LENGTH) {
+ setWelcomeMessageError(
+ `Message is too long. Maximum ${MAX_WELCOME_MESSAGE_LENGTH} characters allowed.`,
+ );
+ return false;
+ }
+ setWelcomeMessageError(null);
+ return true;
+ };
+
+ const handleWelcomeMessageChange = (message: string) => {
+ validateWelcomeMessage(message);
+ setData({ ...data, welcomeMessage: message || null });
+ };
+
+ return (
+ <div className="pb-5">
+ <LinkItem
+ title="Custom Welcome Message"
+ tooltipContent="Override the default welcome message for this link"
+ enabled={enabled}
+ action={handleWelcomeMessageToggle}
+ />
+
+ {enabled && (
+ <motion.div
+ className="relative mt-4 space-y-3"
+ {...FADE_IN_ANIMATION_SETTINGS}
+ >
+ <div className="space-y-3">
+ <div className="flex items-center justify-between">
+ <Label htmlFor="welcome-message">
+ <p className="block text-sm font-medium text-foreground">
+ Welcome Message
+ </p>
+ </Label>
+ <span className="text-sm text-muted-foreground">
+ <span className={cn(welcomeMessageError && "text-red-500")}>
+ {welcomeMessage?.length || 0}
+ </span>
+ /{MAX_WELCOME_MESSAGE_LENGTH}
+ </span>
+ </div>
+ <Textarea
+ id="welcome-message"
+ value={welcomeMessage || ""}
+ onChange={(e) => handleWelcomeMessageChange(e.target.value)}
+ placeholder="Your action is requested to continue"
+ className={cn(
+ "min-h-24 resize-none",
+ welcomeMessageError &&
+ "border-red-500 focus:border-red-500 focus:ring-red-500",
+ )}
+ maxLength={MAX_WELCOME_MESSAGE_LENGTH}
+ />
+ {welcomeMessageError && (
+ <p className="text-xs text-red-500">{welcomeMessageError}</p>
+ )}
+ <p className="text-xs text-muted-foreground">
+ This message will override the default welcome message from your
+ branding settings for this specific link.
+ </p>
+ </div>
+ </motion.div>
+ )}
+ </div>
+ );
+}
+
diff --git a/components/ui/form.tsx b/components/ui/form.tsx
index bf2df534..682cf7eb 100644
--- a/components/ui/form.tsx
+++ b/components/ui/form.tsx
@@ -36,6 +36,7 @@ export function Form({
validate,
defaultValue,
plan,
+ allowEmpty = false,
}: {
title: string;
description: string;
@@ -47,12 +48,13 @@ export function Form({
validate?: (data: string) => boolean;
defaultValue?: string;
plan?: string;
+ allowEmpty?: boolean;
}) {
const [saving, setSaving] = useState(false);
const [value, setValue] = useState(defaultValue);
useEffect(() => {
- if (defaultValue) setValue(defaultValue);
+ if (defaultValue !== undefined) setValue(defaultValue);
}, [defaultValue]);
const saveDisabled = useMemo(() => {
@@ -62,8 +64,12 @@ export function Form({
const defaultVal = defaultValue === "true";
return currentValue === defaultVal;
}
+ // Allow empty values if allowEmpty is true
+ if (allowEmpty) {
+ return value === defaultValue;
+ }
return !value || value === defaultValue;
- }, [saving, value, defaultValue, inputAttrs.type]);
+ }, [saving, value, defaultValue, inputAttrs.type, allowEmpty]);
const renderInput = () => {
if (inputAttrs.type === "checkbox") {
@@ -90,7 +96,7 @@ export function Form({
{...inputAttrs}
value={value}
type={inputAttrs.type || "text"}
- required
+ required={!allowEmpty}
disabled={!!disabledTooltip}
onChange={(e) => setValue(e.target.value)}
onBlur={(e) => setValue(e.target.value.trim())}
diff --git a/components/view/access-form/index.tsx b/components/view/access-form/index.tsx
index 4ce40cf2..387cc7a0 100644
--- a/components/view/access-form/index.tsx
+++ b/components/view/access-form/index.tsx
@@ -45,6 +45,7 @@ export default function AccessForm({
useCustomAccessForm,
customFields,
logoOnAccessForm,
+ linkWelcomeMessage,
}: {
data: DEFAULT_ACCESS_FORM_TYPE;
email: string | null | undefined;
@@ -64,6 +65,7 @@ export default function AccessForm({
useCustomAccessForm?: boolean;
customFields?: Partial<CustomField>[];
logoOnAccessForm?: boolean;
+ linkWelcomeMessage?: string | null;
}) {
const [isEmailValid, setIsEmailValid] = useState(true);
@@ -135,9 +137,9 @@ export default function AccessForm({
color: determineTextColor(brand?.accentColor),
}}
>
- {brand && "welcomeMessage" in brand && brand.welcomeMessage
- ? brand.welcomeMessage
- : "Your action is requested to continue"}
+ {linkWelcomeMessage ||
+ (brand && "welcomeMessage" in brand && brand.welcomeMessage) ||
+ "Your action is requested to continue"}
</h1>
</div>
diff --git a/components/view/dataroom/dataroom-view.tsx b/components/view/dataroom/dataroom-view.tsx
index 54269adc..9ef0101d 100644
--- a/components/view/dataroom/dataroom-view.tsx
+++ b/components/view/dataroom/dataroom-view.tsx
@@ -257,6 +257,7 @@ export default function DataroomView({
brand={brand}
customFields={link.customFields}
logoOnAccessForm={logoOnAccessForm}
+ linkWelcomeMessage={link.welcomeMessage}
/>
);
}
diff --git a/components/view/dataroom/nav-dataroom.tsx b/components/view/dataroom/nav-dataroom.tsx
index fe884793..c23e2df8 100644
--- a/components/view/dataroom/nav-dataroom.tsx
+++ b/components/view/dataroom/nav-dataroom.tsx
@@ -205,12 +205,17 @@ export default function DataroomNav({
<div className="absolute bottom-5 w-fit rounded-r-md bg-white/30 backdrop-blur-md">
<div className="px-5 py-2 sm:px-10">
<div className="text-3xl">{dataroom.name}</div>
- <time
- className="text-sm"
- dateTime={new Date(dataroom.lastUpdatedAt).toISOString()}
- >
- {`Last updated ${formatDate(dataroom.lastUpdatedAt)}`}
- </time>
+ {dataroom.description && (
+ <p className="mt-1 text-sm">{dataroom.description}</p>
+ )}
+ {dataroom.showLastUpdated !== false && (
+ <time
+ className="mt-1 block text-sm"
+ dateTime={new Date(dataroom.lastUpdatedAt).toISOString()}
+ >
+ {`Last updated ${formatDate(dataroom.lastUpdatedAt)}`}
+ </time>
+ )}
</div>
</div>
</div>
diff --git a/components/view/document-view.tsx b/components/view/document-view.tsx
index 29879427..8d82a6d1 100644
--- a/components/view/document-view.tsx
+++ b/components/view/document-view.tsx
@@ -272,6 +272,7 @@ export default function DocumentView({
useCustomAccessForm={useCustomAccessForm}
customFields={link.customFields}
logoOnAccessForm={logoOnAccessForm}
+ linkWelcomeMessage={link.welcomeMessage}
/>
);
}
diff --git a/ee/features/billing/cancellation/api/retention-route.ts b/ee/features/billing/cancellation/api/retention-route.ts
index 6ecc75f1..afd92c5c 100644
--- a/ee/features/billing/cancellation/api/retention-route.ts
+++ b/ee/features/billing/cancellation/api/retention-route.ts
@@ -83,7 +83,7 @@ export async function handleRoute(req: NextApiRequest, res: NextApiResponse) {
waitUntil(
log({
- message: `Retention offer applied to team ${teamId}: 50% off for ${
+ message: `Retention offer applied to team ${teamId}: 30% off for ${
isAnnualPlan ? "12 months" : "3 months"
}`,
type: "info",
diff --git a/ee/features/billing/cancellation/components/retention-offer-modal.tsx b/ee/features/billing/cancellation/components/retention-offer-modal.tsx
index 176878f1..f3dc81f6 100644
--- a/ee/features/billing/cancellation/components/retention-offer-modal.tsx
+++ b/ee/features/billing/cancellation/components/retention-offer-modal.tsx
@@ -51,8 +51,8 @@ export function RetentionOfferModal({
const monthlyPrice = currentPlan.price.monthly.unitPrice;
const yearlyPrice = currentPlan.price.yearly.unitPrice;
- // Simple logic: 50% discount for 3 months (monthly) or 12 months (annual)
- const discountPercent = 0.5;
+ // Simple logic: 30% discount for 3 months (monthly) or 12 months (annual)
+ const discountPercent = 0.3;
const durationMonths = isAnnualPlan ? 12 : 3;
const basePrice = isAnnualPlan ? yearlyPrice : monthlyPrice;
@@ -71,7 +71,7 @@ export function RetentionOfferModal({
return {
title: "Special offer just for you",
subtitle: "Let us make this work for your budget",
- discount: "50% off your next year",
+ discount: "30% off your next year",
savings,
duration: "12 months",
};
@@ -79,7 +79,7 @@ export function RetentionOfferModal({
return {
title: "Special offer just for you",
subtitle: "Let us make this work for your budget",
- discount: "50% off for the next 3 months",
+ discount: "30% off for the next 3 months",
savings,
duration: "3 months",
};
@@ -109,7 +109,7 @@ export function RetentionOfferModal({
mutate(`/api/teams/${currentTeamId}/billing/plan?withDiscount=true`);
onClose();
toast.success(
- `50% discount applied for ${isAnnualPlan ? "12 months" : "3 months"}!`,
+ `30% discount applied for ${isAnnualPlan ? "12 months" : "3 months"}!`,
);
}
})
diff --git a/lib/api/links/link-data.ts b/lib/api/links/link-data.ts
index 71c62127..a6407de7 100644
--- a/lib/api/links/link-data.ts
+++ b/lib/api/links/link-data.ts
@@ -109,8 +109,10 @@ export async function fetchDataroomLinkData({
select: {
id: true,
name: true,
+ description: true,
teamId: true,
allowBulkDownload: true,
+ showLastUpdated: true,
createdAt: true,
documents: {
where:
@@ -296,7 +298,9 @@ export async function fetchDataroomDocumentLinkData({
select: {
id: true,
name: true,
+ description: true,
allowBulkDownload: true,
+ showLastUpdated: true,
documents: {
where: { id: dataroomDocumentId },
select: {
diff --git a/pages/api/links/[id]/documents/[documentId].ts b/pages/api/links/[id]/documents/[documentId].ts
index 60fe0cd2..f29c646c 100644
--- a/pages/api/links/[id]/documents/[documentId].ts
+++ b/pages/api/links/[id]/documents/[documentId].ts
@@ -41,6 +41,7 @@ export default async function handle(
metaDescription: true,
metaImage: true,
metaFavicon: true,
+ welcomeMessage: true,
enableQuestion: true,
linkType: true,
feedback: {
diff --git a/pages/api/links/[id]/index.ts b/pages/api/links/[id]/index.ts
index 04de8af1..639dba4e 100644
--- a/pages/api/links/[id]/index.ts
+++ b/pages/api/links/[id]/index.ts
@@ -49,6 +49,7 @@ export default async function handle(
metaDescription: true,
metaImage: true,
metaFavicon: true,
+ welcomeMessage: true,
enableQuestion: true,
linkType: true,
feedback: {
@@ -330,6 +331,7 @@ export default async function handle(
metaDescription: linkData.metaDescription || null,
metaImage: linkData.metaImage || null,
metaFavicon: linkData.metaFavicon || null,
+ welcomeMessage: linkData.welcomeMessage || null,
...(linkData.customFields && {
customFields: {
deleteMany: {}, // Delete all existing custom fields
diff --git a/pages/api/links/domains/[...domainSlug].ts b/pages/api/links/domains/[...domainSlug].ts
index 96594055..b1d46305 100644
--- a/pages/api/links/domains/[...domainSlug].ts
+++ b/pages/api/links/domains/[...domainSlug].ts
@@ -58,6 +58,7 @@ export default async function handle(
metaDescription: true,
metaImage: true,
metaFavicon: true,
+ welcomeMessage: true,
enableQuestion: true,
dataroomId: true,
linkType: true,
diff --git a/pages/api/links/index.ts b/pages/api/links/index.ts
index c503fae7..378a0c4b 100644
--- a/pages/api/links/index.ts
+++ b/pages/api/links/index.ts
@@ -174,6 +174,7 @@ export default async function handler(
metaDescription: linkData.metaDescription || null,
metaImage: linkData.metaImage || null,
metaFavicon: linkData.metaFavicon || null,
+ welcomeMessage: linkData.welcomeMessage || null,
allowList: linkData.allowList,
denyList: linkData.denyList,
audienceType: linkData.audienceType,
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
index 29a3847e..10736bed 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
@@ -100,12 +100,14 @@ export default async function handle(
return res.status(401).end("Unauthorized");
}
- const { name, enableChangeNotifications, defaultPermissionStrategy, allowBulkDownload } =
+ const { name, description, enableChangeNotifications, defaultPermissionStrategy, allowBulkDownload, showLastUpdated } =
req.body as {
name?: string;
+ description?: string;
enableChangeNotifications?: boolean;
defaultPermissionStrategy?: DefaultPermissionStrategy;
allowBulkDownload?: boolean;
+ showLastUpdated?: boolean;
};
const featureFlags = await getFeatureFlags({ teamId: team.id });
@@ -129,6 +131,7 @@ export default async function handle(
},
data: {
...(name && { name }),
+ ...(description !== undefined && { description }),
...(typeof enableChangeNotifications === "boolean" && {
enableChangeNotifications,
}),
@@ -136,6 +139,9 @@ export default async function handle(
...(typeof allowBulkDownload === "boolean" && {
allowBulkDownload,
}),
+ ...(typeof showLastUpdated === "boolean" && {
+ showLastUpdated,
+ }),
},
});
diff --git a/pages/datarooms/[id]/settings/index.tsx b/pages/datarooms/[id]/settings/index.tsx
index 092ae05c..41412e77 100644
--- a/pages/datarooms/[id]/settings/index.tsx
+++ b/pages/datarooms/[id]/settings/index.tsx
@@ -89,6 +89,73 @@ export default function Settings() {
})
}
/>
+ <Form
+ title="Dataroom Description"
+ description="This is the description of your data room on Papermark."
+ inputAttrs={{
+ name: "description",
+ placeholder: "Add a description for your dataroom",
+ maxLength: 500,
+ }}
+ defaultValue={dataroom.description || ""}
+ helpText="Max 500 characters"
+ allowEmpty={true}
+ handleSubmit={(updateData) =>
+ fetch(`/api/teams/${teamId}/datarooms/${dataroom.id}`, {
+ method: "PATCH",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ description: updateData.description || null,
+ }),
+ }).then(async (res) => {
+ if (res.status === 200) {
+ await Promise.all([
+ mutate(`/api/teams/${teamId}/datarooms`),
+ mutate(`/api/teams/${teamId}/datarooms/${dataroom.id}`),
+ ]);
+ toast.success("Successfully updated dataroom description!");
+ } else {
+ const { error } = await res.json();
+ toast.error(error.message);
+ }
+ })
+ }
+ />
+ <Form
+ title="Show Last Updated"
+ description="Display the last updated date on your dataroom banner."
+ inputAttrs={{
+ name: "showLastUpdated",
+ type: "checkbox",
+ placeholder: "Show last updated date",
+ }}
+ defaultValue={String(dataroom.showLastUpdated ?? true)}
+ helpText="When enabled, visitors will see when the dataroom was last updated."
+ handleSubmit={(updateData) =>
+ fetch(`/api/teams/${teamId}/datarooms/${dataroom.id}`, {
+ method: "PATCH",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ showLastUpdated: updateData.showLastUpdated === "true",
+ }),
+ }).then(async (res) => {
+ if (res.status === 200) {
+ await Promise.all([
+ mutate(`/api/teams/${teamId}/datarooms`),
+ mutate(`/api/teams/${teamId}/datarooms/${dataroom.id}`),
+ ]);
+ toast.success("Successfully updated display settings!");
+ } else {
+ const { error } = await res.json();
+ toast.error(error.message);
+ }
+ })
+ }
+ />
<DuplicateDataroom dataroomId={dataroom.id} teamId={teamId} />
<Card className="bg-transparent">
<CardHeader>
diff --git a/prisma/migrations/20251031000000_add_message_to_link/migration.sql b/prisma/migrations/20251031000000_add_message_to_link/migration.sql
new file mode 100644
index 00000000..005882e8
--- /dev/null
+++ b/prisma/migrations/20251031000000_add_message_to_link/migration.sql
@@ -0,0 +1,9 @@
+-- AlterTable
+ALTER TABLE "Dataroom" ADD COLUMN "showLastUpdated" BOOLEAN NOT NULL DEFAULT true;
+
+-- AlterTable
+ALTER TABLE "Link" ADD COLUMN "welcomeMessage" TEXT;
+
+-- AlterTable
+ALTER TABLE "LinkPreset" ADD COLUMN "welcomeMessage" TEXT;
+
diff --git a/prisma/schema/dataroom.prisma b/prisma/schema/dataroom.prisma
index 46f3fcce..f65a5865 100644
--- a/prisma/schema/dataroom.prisma
+++ b/prisma/schema/dataroom.prisma
@@ -37,6 +37,9 @@ model Dataroom {
// bulk download setting
allowBulkDownload Boolean @default(true) // Allow bulk download of entire dataroom
+ // display settings
+ showLastUpdated Boolean @default(true) // Show/hide last updated date in dataroom view
+
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
diff --git a/prisma/schema/link.prisma b/prisma/schema/link.prisma
index 681984e5..0171260b 100644
--- a/prisma/schema/link.prisma
+++ b/prisma/schema/link.prisma
@@ -62,6 +62,9 @@ model Link {
metaFavicon String? // This will be the meta favicon of the link
enableCustomMetatag Boolean? @default(false) // Optional give user a option to enable the custom metatag
+ // custom welcome message (overrides brand welcome message)
+ welcomeMessage String? // Custom welcome message for this specific link
+
// conversation
enableConversation Boolean @default(false) // Controls if conversations are allowed on this link
conversations Conversation[]
@@ -129,6 +132,8 @@ model LinkPreset {
showBanner Boolean? @default(false) // Optional give user a option to show the "Powered by Papermark" banner
+ welcomeMessage String? // Custom welcome message for links created from this preset
+
isDefault Boolean @default(false)
createdAt DateTime @default(now())