From 82782fcf779a5e84ec1778570b1361bb5c7e1f3d Mon Sep 17 00:00:00 2001 From: spandev <143828642+Spandan-Mishra@users.noreply.github.com> Date: Fri, 14 Nov 2025 23:45:34 +0530 Subject: [PATCH] fix: added timezonebadge to insights/routing which appears on timezone mismatch (#25138) * fix: added timezonebadge to insights/routing which appears on timezone mismatch * update: removed user repository and directly used prisma * clean up code --------- Co-authored-by: Eunjae Lee --- .../(use-page-wrapper)/insights/routing/page.tsx | 13 +++++++++++-- apps/web/modules/insights/insights-routing-view.tsx | 4 ++-- .../routing/RoutingFormResponsesTable.tsx | 4 +++- 3 files changed, 16 insertions(+), 5 deletions(-) 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 f7faaa3889..4693547e5f 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(); - return ; + const { timeZone } = await prisma.user.findUniqueOrThrow({ + where: { id: session?.user.id ?? -1 }, + select: { + timeZone: true, + }, + }); + + return ; } diff --git a/apps/web/modules/insights/insights-routing-view.tsx b/apps/web/modules/insights/insights-routing-view.tsx index 346d0e2b82..9e8b23aa6a 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 ( - +
diff --git a/packages/features/insights/components/routing/RoutingFormResponsesTable.tsx b/packages/features/insights/components/routing/RoutingFormResponsesTable.tsx index b8d1136dd2..d8354fd2be 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() { <> + , ctaContainerRef.current )}