Skip to content

Scheduling infrastructure for absolutely everyone.

fix: added timezonebadge to insights/routing which appears on timezone mismatch (#25138)

spandev82782fcf779a
diff --git a/apps/web/app/(use-page-wrapper)/insights/routing/page.tsx b/apps/web/app/(use-page-wrapper)/insights/routing/page.tsx
index f7faaa38894..4693547e5f6 100644
--- a/apps/web/app/(use-page-wrapper)/insights/routing/page.tsx
+++ b/apps/web/app/(use-page-wrapper)/insights/routing/page.tsx
@@ -1,5 +1,7 @@
import { _generateMetadata } from "app/_utils";
+import { prisma } from "@calcom/prisma";
+
import InsightsRoutingPage from "~/insights/insights-routing-view";
import { checkInsightsPagePermission } from "../checkInsightsPagePermission";
@@ -14,7 +16,14 @@ export const generateMetadata = async () =>
);
export default async function Page() {
- await checkInsightsPagePermission();
+ const session = await checkInsightsPagePermission();
+
+ const { timeZone } = await prisma.user.findUniqueOrThrow({
+ where: { id: session?.user.id ?? -1 },
+ select: {
+ timeZone: true,
+ },
+ });
- return <InsightsRoutingPage />;
+ return <InsightsRoutingPage timeZone={timeZone} />;
}
diff --git a/apps/web/modules/insights/insights-routing-view.tsx b/apps/web/modules/insights/insights-routing-view.tsx
index 346d0e2b824..9e8b23aa6aa 100644
--- a/apps/web/modules/insights/insights-routing-view.tsx
+++ b/apps/web/modules/insights/insights-routing-view.tsx
@@ -13,14 +13,14 @@ import {
import { InsightsOrgTeamsProvider } from "@calcom/features/insights/context/InsightsOrgTeamsProvider";
import { useLocale } from "@calcom/lib/hooks/useLocale";
-export default function InsightsRoutingFormResponsesPage() {
+export default function InsightsRoutingFormResponsesPage({ timeZone }: { timeZone: string }) {
const { t } = useLocale();
const pathname = usePathname();
if (!pathname) return null;
return (
- <DataTableProvider tableIdentifier={pathname} useSegments={useSegments}>
+ <DataTableProvider tableIdentifier={pathname} useSegments={useSegments} timeZone={timeZone}>
<InsightsOrgTeamsProvider>
<div className="mb-4 space-y-4">
<RoutingFormResponsesTable />
diff --git a/packages/features/insights/components/routing/RoutingFormResponsesTable.tsx b/packages/features/insights/components/routing/RoutingFormResponsesTable.tsx
index b8d1136dd24..d8354fd2be2 100644
--- a/packages/features/insights/components/routing/RoutingFormResponsesTable.tsx
+++ b/packages/features/insights/components/routing/RoutingFormResponsesTable.tsx
@@ -1,7 +1,8 @@
"use client";
import { useReactTable, getCoreRowModel, getSortedRowModel } from "@tanstack/react-table";
-
+import { TimezoneBadge } from "@calcom/features/insights/components/booking";
+
import { useMemo, useEffect } from "react";
import { createPortal } from "react-dom";
@@ -155,6 +156,7 @@ export function RoutingFormResponsesTable() {
<>
<DateRangeFilter column={createdAtColumn} options={{ convertToTimeZone: true }} />
<RoutingFormResponsesDownload sorting={sorting} />
+ <TimezoneBadge />
</>,
ctaContainerRef.current
)}