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 <sldisek783@gmail.com>
This commit is contained in:
Eunjae Lee
2025-03-13 14:11:02 -04:00
committed by GitHub
co-authored by Tushar Bhatt Benny Joo
parent 034dfc8e6b
commit f8aa2701b6
3 changed files with 14 additions and 10 deletions
@@ -8,7 +8,7 @@ import { useDataTable } from "../hooks";
interface DataTablePaginationProps<TData> {
table: Table<TData>;
totalRowCount: number;
totalRowCount?: number;
paginationMode?: "infinite" | "standard";
}
@@ -18,6 +18,9 @@ export function DataTablePagination<TData>({
paginationMode = "infinite",
}: DataTablePaginationProps<TData>) {
const { pageIndex, pageSize, setPageIndex, setPageSize } = useDataTable();
if (!totalRowCount) {
return null;
}
if (paginationMode === "infinite") {
const loadedCount = table.getRowModel().rows.length;
@@ -141,15 +141,13 @@ export function DataTableWrapper<TData>({
fetchMoreOnBottomReached(e.target as HTMLDivElement)
: undefined
}>
{totalRowCount && (
<div style={{ gridArea: "footer", marginTop: "1rem" }}>
<DataTablePagination<TData>
table={table}
totalRowCount={totalRowCount}
paginationMode={paginationMode}
/>
</div>
)}
<div style={{ gridArea: "footer", marginTop: "1rem" }}>
<DataTablePagination<TData>
table={table}
totalRowCount={totalRowCount}
paginationMode={paginationMode}
/>
</div>
</DataTable>
)}
</>
@@ -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<string, string | undefined>);
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(),