Skip to content

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

Merge branch 'main' into 218-presetOption

Marc Seitz57a9054f2cbc
diff --cc components/links/link-sheet/link-options.tsx
index 22841299,0a4db1c8..1925c118
--- a/components/links/link-sheet/link-options.tsx
+++ b/components/links/link-sheet/link-options.tsx
@@@ -25,11 -25,8 +25,12 @@@ import ConversationSection from "./conv
import CustomFieldsSection from "./custom-fields-section";
import QuestionSection from "./question-section";
import ScreenshotProtectionSection from "./screenshot-protection-section";
+ import UploadSection from "./upload-section";
import WatermarkSection from "./watermark-section";
+import useSWRImmutable from "swr/immutable";
+import { LinkPreset } from "@prisma/client";
+import { fetcher } from "@/lib/utils";
+import { useTeam } from "@/context/team-context";
export type LinkUpgradeOptions = {
state: boolean;
@@@ -91,9 -84,18 +94,19 @@@ export const LinkOptions = (
<AllowNotificationSection {...{ data, setData }} />
<AllowDownloadSection {...{ data, setData }} />
<ExpirationSection {...{ data, setData }} />
+ {limits?.dataroomUpload &&
+ linkType === LinkType.DATAROOM_LINK &&
+ targetId ? (
+ <UploadSection
+ {...{ data, setData }}
+ isAllowed={isTrial || isDatarooms || isDataroomsPlus}
+ handleUpgradeStateChange={handleUpgradeStateChange}
+ targetId={targetId}
+ />
+ ) : null}
<OGSection
{...{ data, setData }}
+ presets={presetsData}
isAllowed={
isTrial ||
(isPro && allowAdvancedLinkControls) ||
diff --cc pages/api/links/index.ts
index 70392550,61ddaf4d..b6a09215
--- a/pages/api/links/index.ts
+++ b/pages/api/links/index.ts
@@@ -189,10 -189,12 +189,15 @@@ export default async function handler
},
},
}),
+ ...(linkData.enableUpload && {
+ enableUpload: linkData.enableUpload,
+ isFileRequestOnly: linkData.isFileRequestOnly,
+ uploadFolderId: linkData.uploadFolderId,
+ }),
},
+ include: {
+ customFields: true,
+ },
});
const linkWithView = {