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.

chartActivityIconMode

Steven Teyd2e275618e33
diff --git a/apps/web/scripts/migrations/backfill-fraud-event-metadata.ts b/apps/web/scripts/migrations/backfill-fraud-event-metadata.ts
index f14d9de36e..b9e66c6ad0 100644
--- a/apps/web/scripts/migrations/backfill-fraud-event-metadata.ts
+++ b/apps/web/scripts/migrations/backfill-fraud-event-metadata.ts
@@ -1,7 +1,7 @@
-import { getLeadEvents } from "@/lib/tinybird/get-lead-events";
import { prisma } from "@dub/prisma";
import { chunk } from "@dub/utils";
import "dotenv-flow/config";
+import { getLeadEvents } from "../../lib/tinybird/get-lead-events";
async function main() {
const fraudEvents = await prisma.fraudEvent.findMany({
@@ -51,6 +51,9 @@ async function main() {
const { data: events } = await getLeadEvents({
customerIds: batch,
});
+ console.log(
+ `Found ${events.length} lead events from Tinybird for customerIds ${batch.join(", ")}`,
+ );
events.forEach((event) => {
customerIdToUrl.set(event.customer_id, event.url);
@@ -73,6 +76,7 @@ async function main() {
return Promise.resolve(null);
}
+ console.log(`Updating fraud event ${event.id} with URL ${url}`);
return prisma.fraudEvent.update({
where: {
id: event.id,
diff --git a/apps/web/ui/customers/customer-row-item.tsx b/apps/web/ui/customers/customer-row-item.tsx
index 8a006b5778..3bd989e666 100644
--- a/apps/web/ui/customers/customer-row-item.tsx
+++ b/apps/web/ui/customers/customer-row-item.tsx
@@ -9,7 +9,7 @@ export function CustomerRowItem({
href,
className,
avatarClassName,
- hideChartActivityOnHover = true,
+ chartActivityIconMode = "hiddenOnHover",
}: {
customer: {
id: string;
@@ -20,7 +20,7 @@ export function CustomerRowItem({
href?: string;
className?: string;
avatarClassName?: string;
- hideChartActivityOnHover?: boolean;
+ chartActivityIconMode?: "visible" | "hidden" | "hiddenOnHover";
}) {
const display = customer.email || customer.name || generateRandomName();
@@ -45,11 +45,11 @@ export function CustomerRowItem({
/>
<span className="truncate">{display}</span>
</div>
- {href && (
+ {href && chartActivityIconMode !== "hidden" && (
<ChartActivity2
className={cn(
"size-3.5 shrink-0 transition-all",
- hideChartActivityOnHover &&
+ chartActivityIconMode === "hiddenOnHover" &&
"group-hover:-translate-x-3 group-hover:opacity-0",
)}
/>
diff --git a/apps/web/ui/customers/customer-table/customer-table.tsx b/apps/web/ui/customers/customer-table/customer-table.tsx
index fdbe801ce8..35598cdb54 100644
--- a/apps/web/ui/customers/customer-table/customer-table.tsx
+++ b/apps/web/ui/customers/customer-table/customer-table.tsx
@@ -121,7 +121,7 @@ export function CustomerTable() {
<CustomerRowItem
customer={row.original}
href={`/${workspaceSlug}/customers/${row.original.id}`}
- hideChartActivityOnHover={false}
+ chartActivityIconMode="visible"
/>
);
},
diff --git a/apps/web/ui/partners/fraud-risks/fraud-events-tables/fraud-paid-traffic-detected-table.tsx b/apps/web/ui/partners/fraud-risks/fraud-events-tables/fraud-paid-traffic-detected-table.tsx
index b18ddaf0c1..beafaff241 100644
--- a/apps/web/ui/partners/fraud-risks/fraud-events-tables/fraud-paid-traffic-detected-table.tsx
+++ b/apps/web/ui/partners/fraud-risks/fraud-events-tables/fraud-paid-traffic-detected-table.tsx
@@ -82,7 +82,11 @@ export function FraudPaidTrafficDetectedTable() {
size: 220,
cell: ({ row }) =>
row.original.customer ? (
- <CustomerRowItem customer={row.original.customer} />
+ <CustomerRowItem
+ customer={row.original.customer}
+ href={`/${workspaceSlug}/customers/${row.original.customer.id}`}
+ chartActivityIconMode="hidden"
+ />
) : (
"-"
),
@@ -151,7 +155,7 @@ export function FraudPaidTrafficDetectedTable() {
return (
<Link
- href={`/${workspaceSlug}/events?interval=all&customerId=${row.original.customer.id}`}
+ href={`/${workspaceSlug}/events?event=leads&interval=all&customerId=${row.original.customer.id}`}
target="_blank"
>
<Button