Skip to content

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

feat: add notifications (default off) to presets

Marc Seitzdaa6357c45ec
diff --git a/pages/settings/presets/[id].tsx b/pages/settings/presets/[id].tsx
index b2977f18..5ad6cc89 100644
--- a/pages/settings/presets/[id].tsx
+++ b/pages/settings/presets/[id].tsx
@@ -76,13 +76,8 @@ export default function EditPreset() {
const [data, setData] = useState<PRESET_DATA | null>(null);
const [showDeleteAlert, setShowDeleteAlert] = useState(false);
- const {
- isPro,
- isBusiness,
- isDatarooms,
- isDataroomsPlus,
- isTrial,
- } = usePlan();
+ const { isPro, isBusiness, isDatarooms, isDataroomsPlus, isTrial } =
+ usePlan();
const { limits } = useLimits();
const allowAdvancedLinkControls = limits
? limits?.advancedLinkControlsOnPro
@@ -142,7 +137,7 @@ export default function EditPreset() {
agreementId: preset.agreementId,
enableCustomFields: customFields.length > 0,
customFields: customFields,
- enableNotification: preset.enableNotification ?? true,
+ enableNotification: preset.enableNotification ?? false,
});
}
}, [preset]);
@@ -383,7 +378,7 @@ export default function EditPreset() {
}
handleUpgradeStateChange={handleUpgradeStateChange}
/>
-
+
<AllowNotificationSection
data={data as any}
setData={setData as any}
diff --git a/prisma/migrations/20250508113621_added_enable_notification_linkpreset/migration.sql b/prisma/migrations/20250607000000_add_notification_to_presets/migration.sql
similarity index 78%
rename from prisma/migrations/20250508113621_added_enable_notification_linkpreset/migration.sql
rename to prisma/migrations/20250607000000_add_notification_to_presets/migration.sql
index fd8dcb48..7231faa0 100644
--- a/prisma/migrations/20250508113621_added_enable_notification_linkpreset/migration.sql
+++ b/prisma/migrations/20250607000000_add_notification_to_presets/migration.sql
@@ -1,2 +1,3 @@
-- AlterTable
-ALTER TABLE "LinkPreset" ADD COLUMN "enableNotification" BOOLEAN DEFAULT true;
+ALTER TABLE "LinkPreset" ADD COLUMN "enableNotification" BOOLEAN DEFAULT false;
+
diff --git a/prisma/schema/link.prisma b/prisma/schema/link.prisma
index 4d0ff673..17b213ec 100644
--- a/prisma/schema/link.prisma
+++ b/prisma/schema/link.prisma
@@ -94,22 +94,22 @@ model LinkPreset {
metaImage String? // This will be the meta image of the link
metaFavicon String? // This will be the meta favicon of the link
- enableNotification Boolean? @default(true)
- emailProtected Boolean? @default(true)
- emailAuthenticated Boolean? @default(false)
- allowDownload Boolean? @default(false)
- enableAllowList Boolean? @default(false)
- allowList String[]
- enableDenyList Boolean? @default(false)
- denyList String[]
- expiresIn Int? // how many days from link creation until it expires in seconds
- enableScreenshotProtection Boolean? @default(false)
- expiresAt DateTime?
- enablePassword Boolean? @default(false)
- password String?
- enableWatermark Boolean? @default(false)
- watermarkConfig Json? //{text: "Confidential", isTiled: false, color: "#000000", fontSize: 12, opacity: 0.5, rotation: 30, position: "top-right"}
-
+ enableNotification Boolean? @default(false)
+ emailProtected Boolean? @default(true)
+ emailAuthenticated Boolean? @default(false)
+ allowDownload Boolean? @default(false)
+ enableAllowList Boolean? @default(false)
+ allowList String[]
+ enableDenyList Boolean? @default(false)
+ denyList String[]
+ expiresIn Int? // how many days from link creation until it expires in seconds
+ enableScreenshotProtection Boolean? @default(false)
+ expiresAt DateTime?
+ enablePassword Boolean? @default(false)
+ password String?
+ enableWatermark Boolean? @default(false)
+ watermarkConfig Json? //{text: "Confidential", isTiled: false, color: "#000000", fontSize: 12, opacity: 0.5, rotation: 30, position: "top-right"}
+
enableAgreement Boolean? @default(false)
agreementId String?
diff --git a/prisma/schema/schema.prisma b/prisma/schema/schema.prisma
index 339c620b..6cadfb43 100644
--- a/prisma/schema/schema.prisma
+++ b/prisma/schema/schema.prisma
@@ -134,7 +134,7 @@ model UserTeam {
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
- blockedAt DateTime? // When the user was blocked
+ blockedAt DateTime? // When the user was blocked
notificationPreferences Json? // Format: { yearInReview: { "enabled": false } }
@@id([userId, teamId])
@@ -177,8 +177,8 @@ model Document {
folderId String? // Optional Folder ID for documents in folders
folder Folder? @relation(fields: [folderId], references: [id], onDelete: SetNull)
- datarooms DataroomDocument[] // Datarooms associated with this document
- tags TagItem[]
+ datarooms DataroomDocument[] // Datarooms associated with this document
+ tags TagItem[]
// upload external documents
uploadedDocument DocumentUpload[]
@@ -591,19 +591,19 @@ enum TagType {
}
model Tag {
- id String @id @default(cuid())
+ id String @id @default(cuid())
name String
color String
description String?
- teamId String
- team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
-
- items TagItem[]
+ teamId String
+ team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
+
+ items TagItem[]
- createdBy String?
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
+ createdBy String?
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
@@unique([teamId, name])
@@index([teamId])
@@ -612,24 +612,24 @@ model Tag {
}
model TagItem {
- id String @id @default(cuid())
- tagId String
- tag Tag @relation(fields: [tagId], references: [id], onDelete: Cascade)
- itemType TagType
+ id String @id @default(cuid())
+ tagId String
+ tag Tag @relation(fields: [tagId], references: [id], onDelete: Cascade)
+ itemType TagType
// tag can be linked to a link, document or dataroom
- linkId String?
- link Link? @relation(fields: [linkId], references: [id], onDelete: Cascade)
+ linkId String?
+ link Link? @relation(fields: [linkId], references: [id], onDelete: Cascade)
documentId String?
document Document? @relation(fields: [documentId], references: [id], onDelete: Cascade)
dataroomId String?
dataroom Dataroom? @relation(fields: [dataroomId], references: [id], onDelete: Cascade)
taggedBy String?
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
@@index([tagId, linkId])
@@index([tagId, documentId])
@@index([tagId, dataroomId])
-}
\ No newline at end of file
+}