Skip to content

Commit 423dce2

Browse files
authored
feat: add contactId to user table
feat: add contactId to user table
2 parents 03e2d95 + e37ce2d commit 423dce2

File tree

23 files changed

+146
-161
lines changed

23 files changed

+146
-161
lines changed

components/links/link-sheet/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export const DEFAULT_LINK_PROPS = (linkType: LinkType) => ({
7575
watermarkConfig: null,
7676
audienceType: LinkAudienceType.GENERAL,
7777
groupId: null,
78-
screenShieldPercentage: null,
7978
customFields: [],
8079
});
8180

@@ -109,7 +108,6 @@ export type DEFAULT_LINK_TYPE = {
109108
watermarkConfig: WatermarkConfig | null;
110109
audienceType: LinkAudienceType;
111110
groupId: string | null;
112-
screenShieldPercentage: number | null;
113111
customFields: CustomFieldData[];
114112
};
115113

components/links/link-sheet/link-options.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import useLimits from "@/lib/swr/use-limits";
2525
import AgreementSection from "./agreement-section";
2626
import CustomFieldsSection from "./custom-fields-section";
2727
import QuestionSection from "./question-section";
28-
import ScreenShieldSection from "./screen-shield-section";
2928
import ScreenshotProtectionSection from "./screenshot-protection-section";
3029
import WatermarkSection from "./watermark-section";
3130

components/links/link-sheet/screen-shield-section.tsx

Lines changed: 0 additions & 92 deletions
This file was deleted.

components/links/links-table.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ export default function LinksTable({
137137
watermarkConfig: link.watermarkConfig as WatermarkConfig | null,
138138
audienceType: link.audienceType,
139139
groupId: link.groupId,
140-
screenShieldPercentage: link.screenShieldPercentage,
141140
customFields: link.customFields || [],
142141
});
143142
//wait for dropdown to close before opening the link sheet

components/view/PagesViewerNew.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import { TDocumentData } from "./dataroom/dataroom-view";
2727
import Nav from "./nav";
2828
import { PoweredBy } from "./powered-by";
2929
import Question from "./question";
30-
import { ScreenShield } from "./screen-shield";
3130
import Toolbar from "./toolbar";
3231
import ViewDurationSummary from "./visitor-graph";
3332
import { SVGWatermark } from "./watermark-svg";
@@ -77,7 +76,6 @@ export default function PagesViewer({
7776
allowDownload,
7877
feedbackEnabled,
7978
screenshotProtectionEnabled,
80-
screenShieldPercentage,
8179
versionNumber,
8280
brand,
8381
documentName,
@@ -108,7 +106,6 @@ export default function PagesViewer({
108106
allowDownload: boolean;
109107
feedbackEnabled: boolean;
110108
screenshotProtectionEnabled: boolean;
111-
screenShieldPercentage: number | null;
112109
versionNumber: number;
113110
brand?: Partial<Brand> | Partial<DataroomBrand> | null;
114111
documentName?: string;
@@ -496,7 +493,7 @@ export default function PagesViewer({
496493

497494
// Function to handle context for screenshotting
498495
const handleContextMenu = (event: React.MouseEvent<HTMLDivElement>) => {
499-
if (!screenshotProtectionEnabled && !screenShieldPercentage) {
496+
if (!screenshotProtectionEnabled) {
500497
return null;
501498
}
502499

@@ -1107,9 +1104,6 @@ export default function PagesViewer({
11071104
isPreview={isPreview}
11081105
/>
11091106
) : null}
1110-
{!!screenShieldPercentage ? (
1111-
<ScreenShield visiblePercentage={screenShieldPercentage} />
1112-
) : null}
11131107
{screenshotProtectionEnabled ? <ScreenProtector /> : null}
11141108
{showPoweredByBanner ? <PoweredBy linkId={linkId} /> : null}
11151109
</div>

components/view/view-data.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ export default function ViewData({
121121
allowDownload={link.allowDownload!}
122122
feedbackEnabled={link.enableFeedback!}
123123
screenshotProtectionEnabled={link.enableScreenshotProtection!}
124-
screenShieldPercentage={link.screenShieldPercentage}
125124
versionNumber={document.versions[0].versionNumber}
126125
brand={brand}
127126
showPoweredByBanner={showPoweredByBanner}
@@ -148,7 +147,6 @@ export default function ViewData({
148147
allowDownload={link.allowDownload!}
149148
feedbackEnabled={link.enableFeedback!}
150149
screenshotProtectionEnabled={link.enableScreenshotProtection!}
151-
screenShieldPercentage={link.screenShieldPercentage}
152150
versionNumber={document.versions[0].versionNumber}
153151
brand={brand}
154152
showPoweredByBanner={showPoweredByBanner}
@@ -174,7 +172,6 @@ export default function ViewData({
174172
allowDownload={link.allowDownload!}
175173
feedbackEnabled={link.enableFeedback!}
176174
screenshotProtectionEnabled={link.enableScreenshotProtection!}
177-
screenShieldPercentage={link.screenShieldPercentage}
178175
versionNumber={document.versions[0].versionNumber}
179176
brand={brand}
180177
showPoweredByBanner={showPoweredByBanner}

components/view/viewer/image-viewer.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useEffect, useRef, useState } from "react";
44
import React from "react";
55

66
import { Brand, DataroomBrand } from "@prisma/client";
7-
import { toast } from "sonner";
87

98
import { WatermarkConfig } from "@/lib/types";
109
import { cn } from "@/lib/utils";
@@ -16,7 +15,6 @@ import { ScreenProtector } from "../ScreenProtection";
1615
import { TDocumentData } from "../dataroom/dataroom-view";
1716
import Nav from "../nav";
1817
import { PoweredBy } from "../powered-by";
19-
import { ScreenShield } from "../screen-shield";
2018
import { SVGWatermark } from "../watermark-svg";
2119

2220
const trackPageView = async (data: {
@@ -50,7 +48,6 @@ export default function ImageViewer({
5048
allowDownload,
5149
feedbackEnabled,
5250
screenshotProtectionEnabled,
53-
screenShieldPercentage,
5451
versionNumber,
5552
brand,
5653
documentName,
@@ -74,7 +71,6 @@ export default function ImageViewer({
7471
allowDownload: boolean;
7572
feedbackEnabled: boolean;
7673
screenshotProtectionEnabled: boolean;
77-
screenShieldPercentage: number | null;
7874
versionNumber: number;
7975
brand?: Partial<Brand> | Partial<DataroomBrand> | null;
8076
documentName?: string;
@@ -359,9 +355,6 @@ export default function ImageViewer({
359355
</div>
360356
</div>
361357

362-
{!!screenShieldPercentage ? (
363-
<ScreenShield visiblePercentage={screenShieldPercentage} />
364-
) : null}
365358
{screenshotProtectionEnabled ? <ScreenProtector /> : null}
366359
{showPoweredByBanner ? <PoweredBy linkId={linkId} /> : null}
367360
</div>

components/view/viewer/pages-horizontal-viewer.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import React from "react";
66
import { Brand, DataroomBrand } from "@prisma/client";
77
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
88
import { useSession } from "next-auth/react";
9-
import { toast } from "sonner";
109

1110
import { WatermarkConfig } from "@/lib/types";
1211
import { cn } from "@/lib/utils";
@@ -19,7 +18,6 @@ import { TDocumentData } from "../dataroom/dataroom-view";
1918
import Nav from "../nav";
2019
import { PoweredBy } from "../powered-by";
2120
import Question from "../question";
22-
import { ScreenShield } from "../screen-shield";
2321
import Toolbar from "../toolbar";
2422
import ViewDurationSummary from "../visitor-graph";
2523
import { SVGWatermark } from "../watermark-svg";
@@ -69,7 +67,6 @@ export default function PagesHorizontalViewer({
6967
allowDownload,
7068
feedbackEnabled,
7169
screenshotProtectionEnabled,
72-
screenShieldPercentage,
7370
versionNumber,
7471
brand,
7572
documentName,
@@ -99,7 +96,6 @@ export default function PagesHorizontalViewer({
9996
allowDownload: boolean;
10097
feedbackEnabled: boolean;
10198
screenshotProtectionEnabled: boolean;
102-
screenShieldPercentage: number | null;
10399
versionNumber: number;
104100
brand?: Partial<Brand> | Partial<DataroomBrand> | null;
105101
documentName?: string;
@@ -811,9 +807,7 @@ export default function PagesHorizontalViewer({
811807
isPreview={isPreview}
812808
/>
813809
) : null}
814-
{!!screenShieldPercentage ? (
815-
<ScreenShield visiblePercentage={screenShieldPercentage} />
816-
) : null}
810+
817811
{screenshotProtectionEnabled ? <ScreenProtector /> : null}
818812
{showPoweredByBanner ? <PoweredBy linkId={linkId} /> : null}
819813
</div>

components/view/viewer/pages-vertical-viewer.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@ import { useEffect, useRef, useState } from "react";
44
import React from "react";
55

66
import { Brand, DataroomBrand } from "@prisma/client";
7-
import {
8-
ChevronDownIcon,
9-
ChevronLeftIcon,
10-
ChevronRightIcon,
11-
ChevronUpIcon,
12-
ZoomInIcon,
13-
ZoomOutIcon,
14-
} from "lucide-react";
15-
import { useSession } from "next-auth/react";
16-
import { toast } from "sonner";
7+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
178

189
import { WatermarkConfig } from "@/lib/types";
1910
import { cn } from "@/lib/utils";
@@ -26,9 +17,7 @@ import { TDocumentData } from "../dataroom/dataroom-view";
2617
import Nav from "../nav";
2718
import { PoweredBy } from "../powered-by";
2819
import Question from "../question";
29-
import { ScreenShield } from "../screen-shield";
3020
import Toolbar from "../toolbar";
31-
import ViewDurationSummary from "../visitor-graph";
3221
import { SVGWatermark } from "../watermark-svg";
3322

3423
const DEFAULT_PRELOADED_IMAGES_NUM = 5;
@@ -103,7 +92,6 @@ export default function PagesVerticalViewer({
10392
allowDownload,
10493
feedbackEnabled,
10594
screenshotProtectionEnabled,
106-
screenShieldPercentage,
10795
versionNumber,
10896
brand,
10997
documentName,
@@ -133,7 +121,6 @@ export default function PagesVerticalViewer({
133121
allowDownload: boolean;
134122
feedbackEnabled: boolean;
135123
screenshotProtectionEnabled: boolean;
136-
screenShieldPercentage: number | null;
137124
versionNumber: number;
138125
brand?: Partial<Brand> | Partial<DataroomBrand> | null;
139126
documentName?: string;
@@ -945,9 +932,7 @@ export default function PagesVerticalViewer({
945932
isPreview={isPreview}
946933
/>
947934
) : null}
948-
{!!screenShieldPercentage ? (
949-
<ScreenShield visiblePercentage={screenShieldPercentage} />
950-
) : null}
935+
951936
{screenshotProtectionEnabled ? <ScreenProtector /> : null}
952937
{showPoweredByBanner ? <PoweredBy linkId={linkId} /> : null}
953938
</div>

lib/api/views/record-visit.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export async function recordVisit({
9595
enabledFeedback: link.enableFeedback ?? false,
9696
enabledQuestion: link.enableQuestion ?? false,
9797
enabledScreenshotProtection: link.enableScreenshotProtection ?? false,
98-
enabledScreenShieldPercentage: !!link.screenShieldPercentage,
9998
enabledAgreement: link.enableAgreement ?? false,
10099
enabledWatermark: link.enableWatermark ?? false,
101100
metaTitle: link.metaTitle,

0 commit comments

Comments
 (0)