Skip to content

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

feat: add Excel advanced mode preview to dataroom document management

Cursor Agent4d3c3e153273
diff --git a/components/datarooms/dataroom-document-card.tsx b/components/datarooms/dataroom-document-card.tsx
index 57dfc779..6136fa5b 100644
--- a/components/datarooms/dataroom-document-card.tsx
+++ b/components/datarooms/dataroom-document-card.tsx
@@ -278,8 +278,11 @@ export default function DataroomDocumentCard({
hasPages:
dataroomDocument.document.versions?.[0]?.hasPages || false,
type: dataroomDocument.document.type,
- numPages: null, // Not available in this context
+ numPages: null,
}}
+ advancedExcelEnabled={
+ dataroomDocument.document.advancedExcelEnabled
+ }
variant="outline"
size="icon"
className="z-10 h-8 w-8 border-gray-200 bg-transparent hover:bg-gray-200 dark:border-gray-700 hover:dark:bg-gray-700 lg:h-9 lg:w-9"
diff --git a/lib/swr/use-dataroom.ts b/lib/swr/use-dataroom.ts
index ea79964f..7895f847 100644
--- a/lib/swr/use-dataroom.ts
+++ b/lib/swr/use-dataroom.ts
@@ -293,6 +293,7 @@ export type DataroomFolderDocument = DataroomDocument & {
id: string;
name: string;
type: string;
+ advancedExcelEnabled?: boolean;
versions?: { id: string; hasPages: boolean }[];
isExternalUpload?: boolean;
_count: {
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/documents/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/documents/index.ts
index e7e6e406..0db141e0 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/documents/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/documents/index.ts
@@ -84,6 +84,7 @@ export default async function handle(
id: true,
name: true,
type: true,
+ advancedExcelEnabled: true,
versions: {
select: { id: true, hasPages: true },
},
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/folders/documents/[...name].ts b/pages/api/teams/[teamId]/datarooms/[id]/folders/documents/[...name].ts
index ee3135a8..20a9566d 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/folders/documents/[...name].ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/folders/documents/[...name].ts
@@ -98,6 +98,7 @@ export default async function handle(
id: true,
name: true,
type: true,
+ advancedExcelEnabled: true,
versions: {
select: { id: true, hasPages: true },
},