Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

remove restriction, fix review sheet

Steven Tey927c16935406
diff --git a/apps/web/app/(ee)/admin.dub.co/(dashboard)/fraud-alerts/page.tsx b/apps/web/app/(ee)/admin.dub.co/(dashboard)/fraud-alerts/page.tsx
index 3ff39b6e12..3fd307d515 100644
--- a/apps/web/app/(ee)/admin.dub.co/(dashboard)/fraud-alerts/page.tsx
+++ b/apps/web/app/(ee)/admin.dub.co/(dashboard)/fraud-alerts/page.tsx
@@ -13,7 +13,7 @@ import {
useTable,
} from "@dub/ui";
import { CircleDotted, GridIcon } from "@dub/ui/icons";
-import { fetcher, formatDateTime, OG_AVATAR_URL } from "@dub/utils";
+import { fetcher, formatDate, formatDateTime, OG_AVATAR_URL } from "@dub/utils";
import { Suspense, useCallback, useMemo, useState } from "react";
import useSWR from "swr";
import * as z from "zod/v4";
@@ -209,17 +209,18 @@ function FraudAlertsPageClient() {
id: "reviewNote",
header: "Review Note",
cell: ({ row }) => {
- const { reviewNote, reviewedBy } = row.original;
+ const { reviewNote, reviewedBy, reviewedAt } = row.original;
if (!reviewNote) return "-";
return (
<Tooltip
content={
- <div className="max-w-xs">
+ <div className="max-w-xs p-2">
<p className="text-sm">{reviewNote}</p>
{reviewedBy && (
<p className="mt-1 text-xs text-neutral-400">
Reviewed by {reviewedBy.name}
+ {reviewedAt ? ` on ${formatDate(reviewedAt)}` : ""}
</p>
)}
</div>
diff --git a/apps/web/app/(ee)/admin.dub.co/(dashboard)/fraud-alerts/review-fraud-alert-sheet.tsx b/apps/web/app/(ee)/admin.dub.co/(dashboard)/fraud-alerts/review-fraud-alert-sheet.tsx
index 6103865854..3e7853c575 100644
--- a/apps/web/app/(ee)/admin.dub.co/(dashboard)/fraud-alerts/review-fraud-alert-sheet.tsx
+++ b/apps/web/app/(ee)/admin.dub.co/(dashboard)/fraud-alerts/review-fraud-alert-sheet.tsx
@@ -26,6 +26,7 @@ import {
} from "@dub/ui";
import { BadgeCheck2Fill, Xmark } from "@dub/ui/icons";
import {
+ cn,
COUNTRIES,
currencyFormatter,
formatDateTime,
@@ -113,7 +114,7 @@ function SheetContent({
setIsOpen: (open: boolean) => void;
onReviewed: () => Promise<void>;
}) {
- const [reviewNote, setReviewNote] = useState("");
+ const [reviewNote, setReviewNote] = useState(fraudAlert.reviewNote ?? "");
const [isSubmitting, setIsSubmitting] = useState(false);
const { data: partner, isLoading } = useSWR<PartnerDetail>(
@@ -314,25 +315,31 @@ function SheetContent({
</div>
{/* Sticky footer with review actions */}
- {fraudAlert.status === "pending" && (
- <div className="shrink-0 border-t border-neutral-200 p-6">
- <div>
- <label className="block text-sm font-medium text-neutral-900">
- Review note{" "}
- <span className="font-normal text-neutral-400">(optional)</span>
- </label>
- <textarea
- className="mt-1.5 block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
- placeholder="Add a note about this review..."
- rows={3}
- maxLength={MAX_FRAUD_REASON_LENGTH}
- value={reviewNote}
- onChange={(e) => setReviewNote(e.target.value)}
- />
- <p className="mt-1 text-right text-xs text-neutral-400">
- {reviewNote.length}/{MAX_FRAUD_REASON_LENGTH}
- </p>
- </div>
+ <div className="shrink-0 border-t border-neutral-200 p-6">
+ <div>
+ <label className="block text-sm font-medium text-neutral-900">
+ Review note{" "}
+ <span className="font-normal text-neutral-400">(optional)</span>
+ </label>
+ <textarea
+ className={cn(
+ "mt-1.5 block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 sm:text-sm",
+ fraudAlert.status !== "pending"
+ ? "pointer-events-none cursor-not-allowed bg-neutral-50 text-neutral-600"
+ : "focus:border-neutral-500 focus:outline-none focus:ring-neutral-500",
+ )}
+ placeholder="Add a note about this review..."
+ rows={3}
+ maxLength={MAX_FRAUD_REASON_LENGTH}
+ value={reviewNote}
+ onChange={(e) => setReviewNote(e.target.value)}
+ readOnly={fraudAlert.status !== "pending"}
+ />
+ <p className="mt-1 text-right text-xs text-neutral-400">
+ {reviewNote.length}/{MAX_FRAUD_REASON_LENGTH}
+ </p>
+ </div>
+ {fraudAlert.status === "pending" && (
<div className="mt-3 flex items-center justify-end gap-2">
<Button
variant="secondary"
@@ -349,8 +356,8 @@ function SheetContent({
onClick={() => handleReview("confirmed")}
/>
</div>
- </div>
- )}
+ )}
+ </div>
</div>
);
}
diff --git a/apps/web/lib/actions/partners/merge-partner-accounts.ts b/apps/web/lib/actions/partners/merge-partner-accounts.ts
index 5217f0e618..d817fe14ab 100644
--- a/apps/web/lib/actions/partners/merge-partner-accounts.ts
+++ b/apps/web/lib/actions/partners/merge-partner-accounts.ts
@@ -136,12 +136,6 @@ const sendTokens = async ({
);
}
- if (sourceAccount.payoutsEnabledAt) {
- throw new Error(
- "Account merging is not available if payouts are enabled on the source account. Please contact support for assistance.",
- );
- }
-
// if source acocunt country is set and is different from target account country, throw an error
if (
sourceAccount.country &&