From f8aa2701b677566063720787be0da700cd1ffddb Mon Sep 17 00:00:00 2001 From: Eunjae Lee Date: Thu, 13 Mar 2025 19:11:02 +0100 Subject: [PATCH] fix: add booking uid and link to insights routing downloads (#20007) * fix: add booking uid and link to insights routing downloads * minor change --------- Co-authored-by: Tushar Bhatt <95581504+TusharBhatt1@users.noreply.github.com> Co-authored-by: Benny Joo --- .../components/DataTablePagination.tsx | 5 ++++- .../data-table/components/DataTableWrapper.tsx | 16 +++++++--------- .../features/insights/server/routing-events.ts | 3 +++ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/features/data-table/components/DataTablePagination.tsx b/packages/features/data-table/components/DataTablePagination.tsx index 592db49509..b3c7df9837 100644 --- a/packages/features/data-table/components/DataTablePagination.tsx +++ b/packages/features/data-table/components/DataTablePagination.tsx @@ -8,7 +8,7 @@ import { useDataTable } from "../hooks"; interface DataTablePaginationProps { table: Table; - totalRowCount: number; + totalRowCount?: number; paginationMode?: "infinite" | "standard"; } @@ -18,6 +18,9 @@ export function DataTablePagination({ paginationMode = "infinite", }: DataTablePaginationProps) { const { pageIndex, pageSize, setPageIndex, setPageSize } = useDataTable(); + if (!totalRowCount) { + return null; + } if (paginationMode === "infinite") { const loadedCount = table.getRowModel().rows.length; diff --git a/packages/features/data-table/components/DataTableWrapper.tsx b/packages/features/data-table/components/DataTableWrapper.tsx index 4c7a26cff1..b3662c07c4 100644 --- a/packages/features/data-table/components/DataTableWrapper.tsx +++ b/packages/features/data-table/components/DataTableWrapper.tsx @@ -141,15 +141,13 @@ export function DataTableWrapper({ fetchMoreOnBottomReached(e.target as HTMLDivElement) : undefined }> - {totalRowCount && ( -
- - table={table} - totalRowCount={totalRowCount} - paginationMode={paginationMode} - /> -
- )} +
+ + table={table} + totalRowCount={totalRowCount} + paginationMode={paginationMode} + /> +
)} diff --git a/packages/features/insights/server/routing-events.ts b/packages/features/insights/server/routing-events.ts index 4f7deb382f..fd2da31466 100644 --- a/packages/features/insights/server/routing-events.ts +++ b/packages/features/insights/server/routing-events.ts @@ -17,6 +17,7 @@ import type { RoutingFormResponsesInput, RoutingFormStatsInput, } from "@calcom/features/insights/server/raw-data.schema"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import { readonlyPrisma as prisma } from "@calcom/prisma"; import { type ResponseValue, ZResponse } from "../lib/types"; @@ -408,6 +409,8 @@ class RoutingEventsInsights { }, {} as Record); return { + "Booking UID": item.bookingUid, + "Booking Link": item.bookingUid ? `${WEBAPP_URL}/booking/${item.bookingUid}` : "", "Response ID": item.id, "Form Name": item.formName, "Submitted At": item.createdAt.toISOString(),