From 0774a4111920b6175d1d8e1af04cab17eff2fcb0 Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Mon, 26 Jan 2026 22:11:14 +0900 Subject: [PATCH] refactor: move hooks and stores from packages/features to apps/web/modules (#27221) * refactor: move booking-audit client components from packages/features to apps/web/modules This is part of the larger effort to move tRPC-dependent UI components from packages/features to apps/web/modules to eliminate circular dependencies. Changes: - Move BookingHistory.tsx and BookingHistoryPage.tsx to apps/web/modules/booking-audit/components/ - Update imports in apps/web to use the new location Co-Authored-By: benny@cal.com * refactor: move formbricks client from packages/features to apps/web/modules Co-Authored-By: benny@cal.com * refactor: move hooks and stores from packages/features to apps/web/modules - Move useAppsData hook from packages/features/apps/hooks to apps/web/modules/apps/hooks - Move onboardingStore from packages/features/ee/organizations/lib to apps/web/modules/ee/organizations/lib - Move useWelcomeModal hook from packages/features/ee/organizations/hooks to apps/web/modules/ee/organizations/hooks - Move useAgentsData hook from packages/features/ee/workflows/hooks to apps/web/modules/ee/workflows/hooks - Update all import paths in consuming files Co-Authored-By: benny@cal.com * refactor: move onboardingStore test file to apps/web/modules Co-Authored-By: benny@cal.com --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../(main-nav)/booking/[uid]/logs/page.tsx | 2 +- .../apps/installation/EventTypeAppSettingsWrapper.tsx | 2 +- .../web/modules}/apps/hooks/useAppsData.ts | 0 .../modules/booking-audit}/components/BookingHistory.tsx | 0 .../booking-audit}/components/BookingHistoryPage.tsx | 0 .../modules/bookings/components/BookingDetailsSheet.tsx | 2 +- .../ee/organizations/components/AboutOrganizationForm.tsx | 2 +- .../organizations/components/AdminOnboardingHandover.tsx | 2 +- .../components/CreateANewOrganizationForm.tsx | 2 +- .../modules/ee/organizations/components/OtherTeamList.tsx | 2 +- .../components/WelcomeToOrganizationsModal.tsx | 2 +- .../modules}/ee/organizations/hooks/useWelcomeModal.ts | 0 .../modules}/ee/organizations/lib/onboardingStore.test.ts | 0 .../web/modules}/ee/organizations/lib/onboardingStore.ts | 0 .../ee/organizations/new/_components/AddNewTeamsForm.tsx | 2 +- .../organizations/new/_components/OnboardMembersView.tsx | 4 ++-- .../organizations/new/_components/PaymentStatusView.tsx | 2 +- apps/web/modules/ee/organizations/new/resume-view.tsx | 2 +- .../modules/ee/organizations/other-team-profile-view.tsx | 2 +- apps/web/modules/ee/teams/components/TeamInviteList.tsx | 2 +- apps/web/modules/ee/teams/components/TeamList.tsx | 2 +- apps/web/modules/ee/teams/views/team-profile-view.tsx | 2 +- .../ee/workflows/components/WorkflowDetailsPage.tsx | 2 +- .../web/modules}/ee/workflows/hooks/useAgentsData.ts | 0 .../event-types/components/tabs/apps/EventAppsTab.tsx | 2 +- .../web/modules/formbricks/hooks/useFormbricks.ts | 8 +------- apps/web/modules/formbricks/lib/trackFormbricksAction.ts | 7 +++++++ apps/web/modules/onboarding/hooks/useSubmitOnboarding.ts | 2 +- apps/web/modules/shell/Shell.tsx | 3 ++- .../wrappers/EventPaymentsTabPlatformWrapper.tsx | 2 +- 30 files changed, 31 insertions(+), 29 deletions(-) rename {packages/features => apps/web/modules}/apps/hooks/useAppsData.ts (100%) rename {packages/features/booking-audit/client => apps/web/modules/booking-audit}/components/BookingHistory.tsx (100%) rename {packages/features/booking-audit/client => apps/web/modules/booking-audit}/components/BookingHistoryPage.tsx (100%) rename {packages/features => apps/web/modules}/ee/organizations/hooks/useWelcomeModal.ts (100%) rename {packages/features => apps/web/modules}/ee/organizations/lib/onboardingStore.test.ts (100%) rename {packages/features => apps/web/modules}/ee/organizations/lib/onboardingStore.ts (100%) rename {packages/features => apps/web/modules}/ee/workflows/hooks/useAgentsData.ts (100%) rename packages/features/formbricks/formbricks-client.ts => apps/web/modules/formbricks/hooks/useFormbricks.ts (83%) create mode 100644 apps/web/modules/formbricks/lib/trackFormbricksAction.ts diff --git a/apps/web/app/(use-page-wrapper)/(main-nav)/booking/[uid]/logs/page.tsx b/apps/web/app/(use-page-wrapper)/(main-nav)/booking/[uid]/logs/page.tsx index ebe3c5c11b..6127f1a5d4 100644 --- a/apps/web/app/(use-page-wrapper)/(main-nav)/booking/[uid]/logs/page.tsx +++ b/apps/web/app/(use-page-wrapper)/(main-nav)/booking/[uid]/logs/page.tsx @@ -11,7 +11,7 @@ import { getServerSession } from "@calcom/features/auth/lib/getServerSession"; import { buildLegacyRequest } from "@lib/buildLegacyCtx"; -import { BookingHistoryPage } from "@calcom/features/booking-audit/client/components/BookingHistoryPage"; +import { BookingHistoryPage } from "@calcom/web/modules/booking-audit/components/BookingHistoryPage"; export const generateMetadata = async ({ params }: { params: Promise<{ uid: string }> }) => await _generateMetadata( diff --git a/apps/web/components/apps/installation/EventTypeAppSettingsWrapper.tsx b/apps/web/components/apps/installation/EventTypeAppSettingsWrapper.tsx index 777e82bebd..7b9a984a0d 100644 --- a/apps/web/components/apps/installation/EventTypeAppSettingsWrapper.tsx +++ b/apps/web/components/apps/installation/EventTypeAppSettingsWrapper.tsx @@ -2,7 +2,7 @@ import { useEffect, type FC } from "react"; import { EventTypeAppSettings } from "@calcom/app-store/_components/EventTypeAppSettingsInterface"; import type { EventTypeAppsList } from "@calcom/app-store/utils"; -import useAppsData from "@calcom/features/apps/hooks/useAppsData"; +import useAppsData from "@calcom/web/modules/apps/hooks/useAppsData"; import type { ConfigureStepCardProps } from "@components/apps/installation/ConfigureStepCard"; diff --git a/packages/features/apps/hooks/useAppsData.ts b/apps/web/modules/apps/hooks/useAppsData.ts similarity index 100% rename from packages/features/apps/hooks/useAppsData.ts rename to apps/web/modules/apps/hooks/useAppsData.ts diff --git a/packages/features/booking-audit/client/components/BookingHistory.tsx b/apps/web/modules/booking-audit/components/BookingHistory.tsx similarity index 100% rename from packages/features/booking-audit/client/components/BookingHistory.tsx rename to apps/web/modules/booking-audit/components/BookingHistory.tsx diff --git a/packages/features/booking-audit/client/components/BookingHistoryPage.tsx b/apps/web/modules/booking-audit/components/BookingHistoryPage.tsx similarity index 100% rename from packages/features/booking-audit/client/components/BookingHistoryPage.tsx rename to apps/web/modules/booking-audit/components/BookingHistoryPage.tsx diff --git a/apps/web/modules/bookings/components/BookingDetailsSheet.tsx b/apps/web/modules/bookings/components/BookingDetailsSheet.tsx index e7495cd94e..5029573d4c 100644 --- a/apps/web/modules/bookings/components/BookingDetailsSheet.tsx +++ b/apps/web/modules/bookings/components/BookingDetailsSheet.tsx @@ -45,7 +45,7 @@ import { usePaymentStatus } from "../hooks/usePaymentStatus"; import { useBookingDetailsSheetStore } from "../store/bookingDetailsSheetStore"; import type { BookingOutput } from "../types"; import { JoinMeetingButton } from "./JoinMeetingButton"; -import { BookingHistory } from "@calcom/features/booking-audit/client/components/BookingHistory"; +import { BookingHistory } from "@calcom/web/modules/booking-audit/components/BookingHistory"; import { SegmentedControl } from "@calcom/ui/components/segmented-control"; type BookingMetaData = z.infer; diff --git a/apps/web/modules/ee/organizations/components/AboutOrganizationForm.tsx b/apps/web/modules/ee/organizations/components/AboutOrganizationForm.tsx index edd294f5af..1781f3e211 100644 --- a/apps/web/modules/ee/organizations/components/AboutOrganizationForm.tsx +++ b/apps/web/modules/ee/organizations/components/AboutOrganizationForm.tsx @@ -3,7 +3,7 @@ import { useRouter } from "next/navigation"; import { Controller, useForm } from "react-hook-form"; -import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore"; +import { useOnboarding } from "@calcom/web/modules/ee/organizations/lib/onboardingStore"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { ImageUploader } from "@calcom/ui/components/image-uploader"; import { TextAreaField } from "@calcom/ui/components/form"; diff --git a/apps/web/modules/ee/organizations/components/AdminOnboardingHandover.tsx b/apps/web/modules/ee/organizations/components/AdminOnboardingHandover.tsx index 5e1266d059..53b0ef41be 100644 --- a/apps/web/modules/ee/organizations/components/AdminOnboardingHandover.tsx +++ b/apps/web/modules/ee/organizations/components/AdminOnboardingHandover.tsx @@ -3,7 +3,7 @@ import { useSession } from "next-auth/react"; import { useRouter } from "next/navigation"; -import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore"; +import { useOnboarding } from "@calcom/web/modules/ee/organizations/lib/onboardingStore"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Alert } from "@calcom/ui/components/alert"; diff --git a/apps/web/modules/ee/organizations/components/CreateANewOrganizationForm.tsx b/apps/web/modules/ee/organizations/components/CreateANewOrganizationForm.tsx index 1c8f2caae5..2cc4aa756d 100644 --- a/apps/web/modules/ee/organizations/components/CreateANewOrganizationForm.tsx +++ b/apps/web/modules/ee/organizations/components/CreateANewOrganizationForm.tsx @@ -22,7 +22,7 @@ import { Label } from "@calcom/ui/components/form"; import { TextField } from "@calcom/ui/components/form"; import { RadioAreaGroup as RadioArea } from "@calcom/ui/components/radio"; -import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore"; +import { useOnboarding } from "@calcom/web/modules/ee/organizations/lib/onboardingStore"; function extractDomainFromEmail(email: string) { const match = email.match(/^(?:.*?:\/\/)?.*?([\w-]*(?:\.\w{2,}|\.\w{2,}\.\w{2}))(?:[/?#:]|$)/); diff --git a/apps/web/modules/ee/organizations/components/OtherTeamList.tsx b/apps/web/modules/ee/organizations/components/OtherTeamList.tsx index c5d4691d49..07d3e5a653 100644 --- a/apps/web/modules/ee/organizations/components/OtherTeamList.tsx +++ b/apps/web/modules/ee/organizations/components/OtherTeamList.tsx @@ -3,7 +3,7 @@ import { useState } from "react"; import type { OrganizationRepository } from "@calcom/features/ee/organizations/di/OrganizationRepository.module"; -import { trackFormbricksAction } from "@calcom/features/formbricks/formbricks-client"; +import { trackFormbricksAction } from "@calcom/web/modules/formbricks/lib/trackFormbricksAction"; import { trpc } from "@calcom/trpc/react"; import { showToast } from "@calcom/ui/components/toast"; diff --git a/apps/web/modules/ee/organizations/components/WelcomeToOrganizationsModal.tsx b/apps/web/modules/ee/organizations/components/WelcomeToOrganizationsModal.tsx index dd262d500d..f0c48f27cf 100644 --- a/apps/web/modules/ee/organizations/components/WelcomeToOrganizationsModal.tsx +++ b/apps/web/modules/ee/organizations/components/WelcomeToOrganizationsModal.tsx @@ -8,7 +8,7 @@ import { Dialog, DialogContent } from "@calcom/ui/components/dialog"; import { Icon, type IconName } from "@calcom/ui/components/icon"; import { Logo } from "@calcom/ui/components/logo"; -import { useWelcomeModal } from "@calcom/features/ee/organizations/hooks/useWelcomeModal"; +import { useWelcomeModal } from "@calcom/web/modules/ee/organizations/hooks/useWelcomeModal"; const features = [ "1_parent_team_unlimited_subteams", diff --git a/packages/features/ee/organizations/hooks/useWelcomeModal.ts b/apps/web/modules/ee/organizations/hooks/useWelcomeModal.ts similarity index 100% rename from packages/features/ee/organizations/hooks/useWelcomeModal.ts rename to apps/web/modules/ee/organizations/hooks/useWelcomeModal.ts diff --git a/packages/features/ee/organizations/lib/onboardingStore.test.ts b/apps/web/modules/ee/organizations/lib/onboardingStore.test.ts similarity index 100% rename from packages/features/ee/organizations/lib/onboardingStore.test.ts rename to apps/web/modules/ee/organizations/lib/onboardingStore.test.ts diff --git a/packages/features/ee/organizations/lib/onboardingStore.ts b/apps/web/modules/ee/organizations/lib/onboardingStore.ts similarity index 100% rename from packages/features/ee/organizations/lib/onboardingStore.ts rename to apps/web/modules/ee/organizations/lib/onboardingStore.ts diff --git a/apps/web/modules/ee/organizations/new/_components/AddNewTeamsForm.tsx b/apps/web/modules/ee/organizations/new/_components/AddNewTeamsForm.tsx index b5f2e7ed0c..341e9f0337 100644 --- a/apps/web/modules/ee/organizations/new/_components/AddNewTeamsForm.tsx +++ b/apps/web/modules/ee/organizations/new/_components/AddNewTeamsForm.tsx @@ -5,7 +5,7 @@ import { useState } from "react"; import { Controller, useFieldArray, useForm } from "react-hook-form"; import { z } from "zod"; -import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore"; +import { useOnboarding } from "@calcom/web/modules/ee/organizations/lib/onboardingStore"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import slugify from "@calcom/lib/slugify"; import { trpc } from "@calcom/trpc/react"; diff --git a/apps/web/modules/ee/organizations/new/_components/OnboardMembersView.tsx b/apps/web/modules/ee/organizations/new/_components/OnboardMembersView.tsx index 421bb94dc9..277d704d3e 100644 --- a/apps/web/modules/ee/organizations/new/_components/OnboardMembersView.tsx +++ b/apps/web/modules/ee/organizations/new/_components/OnboardMembersView.tsx @@ -5,8 +5,8 @@ import { useState } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; -import { setShowNewOrgModalFlag } from "@calcom/features/ee/organizations/hooks/useWelcomeModal"; -import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore"; +import { setShowNewOrgModalFlag } from "@calcom/web/modules/ee/organizations/hooks/useWelcomeModal"; +import { useOnboarding } from "@calcom/web/modules/ee/organizations/lib/onboardingStore"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { RouterOutputs } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react"; diff --git a/apps/web/modules/ee/organizations/new/_components/PaymentStatusView.tsx b/apps/web/modules/ee/organizations/new/_components/PaymentStatusView.tsx index 1a5561b921..2fbb2f3a91 100644 --- a/apps/web/modules/ee/organizations/new/_components/PaymentStatusView.tsx +++ b/apps/web/modules/ee/organizations/new/_components/PaymentStatusView.tsx @@ -3,7 +3,7 @@ import { useRouter, useSearchParams } from "next/navigation"; import { useEffect, useState } from "react"; -import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore"; +import { useOnboarding } from "@calcom/web/modules/ee/organizations/lib/onboardingStore"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { Button } from "@calcom/ui/components/button"; diff --git a/apps/web/modules/ee/organizations/new/resume-view.tsx b/apps/web/modules/ee/organizations/new/resume-view.tsx index ce201863b4..e9fe618ea0 100644 --- a/apps/web/modules/ee/organizations/new/resume-view.tsx +++ b/apps/web/modules/ee/organizations/new/resume-view.tsx @@ -3,7 +3,7 @@ import { useRouter, useSearchParams } from "next/navigation"; import { useEffect } from "react"; -import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore"; +import { useOnboarding } from "@calcom/web/modules/ee/organizations/lib/onboardingStore"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Alert } from "@calcom/ui/components/alert"; import { SkeletonContainer, SkeletonText } from "@calcom/ui/components/skeleton"; diff --git a/apps/web/modules/ee/organizations/other-team-profile-view.tsx b/apps/web/modules/ee/organizations/other-team-profile-view.tsx index 0411e1b6df..6899d95b1f 100644 --- a/apps/web/modules/ee/organizations/other-team-profile-view.tsx +++ b/apps/web/modules/ee/organizations/other-team-profile-view.tsx @@ -9,7 +9,7 @@ import { z } from "zod"; import { Dialog } from "@calcom/features/components/controlled-dialog"; import { subdomainSuffix } from "@calcom/features/ee/organizations/lib/orgDomains"; -import { trackFormbricksAction } from "@calcom/features/formbricks/formbricks-client"; +import { trackFormbricksAction } from "@calcom/web/modules/formbricks/lib/trackFormbricksAction"; import { IS_TEAM_BILLING_ENABLED_CLIENT, WEBAPP_URL } from "@calcom/lib/constants"; import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/modules/ee/teams/components/TeamInviteList.tsx b/apps/web/modules/ee/teams/components/TeamInviteList.tsx index aebb8e47e1..b92147e763 100644 --- a/apps/web/modules/ee/teams/components/TeamInviteList.tsx +++ b/apps/web/modules/ee/teams/components/TeamInviteList.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { trackFormbricksAction } from "@calcom/features/formbricks/formbricks-client"; +import { trackFormbricksAction } from "@calcom/web/modules/formbricks/lib/trackFormbricksAction"; import type { MembershipRole } from "@calcom/prisma/enums"; import { trpc } from "@calcom/trpc/react"; import { showToast } from "@calcom/ui/components/toast"; diff --git a/apps/web/modules/ee/teams/components/TeamList.tsx b/apps/web/modules/ee/teams/components/TeamList.tsx index ebddcbfc07..32465177b7 100644 --- a/apps/web/modules/ee/teams/components/TeamList.tsx +++ b/apps/web/modules/ee/teams/components/TeamList.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { trackFormbricksAction } from "@calcom/features/formbricks/formbricks-client"; +import { trackFormbricksAction } from "@calcom/web/modules/formbricks/lib/trackFormbricksAction"; import { ORG_SELF_SERVE_ENABLED, ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUE, diff --git a/apps/web/modules/ee/teams/views/team-profile-view.tsx b/apps/web/modules/ee/teams/views/team-profile-view.tsx index 41298f85ed..7888552a3d 100644 --- a/apps/web/modules/ee/teams/views/team-profile-view.tsx +++ b/apps/web/modules/ee/teams/views/team-profile-view.tsx @@ -11,7 +11,7 @@ import { z } from "zod"; import { checkAdminOrOwner } from "@calcom/features/auth/lib/checkAdminOrOwner"; import { Dialog } from "@calcom/features/components/controlled-dialog"; import { getTeamUrlSync } from "@calcom/features/ee/organizations/lib/getTeamUrlSync"; -import { trackFormbricksAction } from "@calcom/features/formbricks/formbricks-client"; +import { trackFormbricksAction } from "@calcom/web/modules/formbricks/lib/trackFormbricksAction"; import SectionBottomActions from "@calcom/features/settings/SectionBottomActions"; import { IS_TEAM_BILLING_ENABLED, WEBAPP_URL } from "@calcom/lib/constants"; import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage"; diff --git a/apps/web/modules/ee/workflows/components/WorkflowDetailsPage.tsx b/apps/web/modules/ee/workflows/components/WorkflowDetailsPage.tsx index 6252c0a057..915aa6c670 100644 --- a/apps/web/modules/ee/workflows/components/WorkflowDetailsPage.tsx +++ b/apps/web/modules/ee/workflows/components/WorkflowDetailsPage.tsx @@ -3,7 +3,7 @@ import type { Dispatch, SetStateAction } from "react"; import { useState, useEffect } from "react"; import type { UseFormReturn } from "react-hook-form"; -import { useAgentsData } from "@calcom/features/ee/workflows/hooks/useAgentsData"; +import { useAgentsData } from "@calcom/web/modules/ee/workflows/hooks/useAgentsData"; import { isCalAIAction, isSMSAction, diff --git a/packages/features/ee/workflows/hooks/useAgentsData.ts b/apps/web/modules/ee/workflows/hooks/useAgentsData.ts similarity index 100% rename from packages/features/ee/workflows/hooks/useAgentsData.ts rename to apps/web/modules/ee/workflows/hooks/useAgentsData.ts diff --git a/apps/web/modules/event-types/components/tabs/apps/EventAppsTab.tsx b/apps/web/modules/event-types/components/tabs/apps/EventAppsTab.tsx index 3145642f26..7a638138a4 100644 --- a/apps/web/modules/event-types/components/tabs/apps/EventAppsTab.tsx +++ b/apps/web/modules/event-types/components/tabs/apps/EventAppsTab.tsx @@ -4,7 +4,7 @@ import { useFormContext } from "react-hook-form"; import { EventTypeAppCard } from "@calcom/app-store/_components/EventTypeAppCardInterface"; import type { EventTypeAppCardComponentProps } from "@calcom/app-store/types"; import type { EventTypeAppsList } from "@calcom/app-store/utils"; -import useAppsData from "@calcom/features/apps/hooks/useAppsData"; +import useAppsData from "@calcom/web/modules/apps/hooks/useAppsData"; import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hooks/useLockedFieldsManager"; import type { FormValues, EventTypeSetupProps, EventTypeApps } from "@calcom/features/eventtypes/lib/types"; import ServerTrans from "@calcom/lib/components/ServerTrans"; diff --git a/packages/features/formbricks/formbricks-client.ts b/apps/web/modules/formbricks/hooks/useFormbricks.ts similarity index 83% rename from packages/features/formbricks/formbricks-client.ts rename to apps/web/modules/formbricks/hooks/useFormbricks.ts index 73ddd14794..1c05fdeedc 100644 --- a/packages/features/formbricks/formbricks-client.ts +++ b/apps/web/modules/formbricks/hooks/useFormbricks.ts @@ -4,7 +4,7 @@ import { useEffect } from "react"; import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery"; -export const initFormbricks = ({ +const initFormbricks = ({ userId, attributes, }: { @@ -29,12 +29,6 @@ export const initFormbricks = ({ } }; -export const trackFormbricksAction = (eventName: string, properties: Record = {}) => { - if (process.env.NEXT_PUBLIC_FORMBRICKS_HOST_URL && process.env.NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID) { - formbricks.track(eventName, properties); - } -}; - export const useFormbricks = () => { const { data: user, isLoading } = useMeQuery(); const { data: session, status } = useSession(); diff --git a/apps/web/modules/formbricks/lib/trackFormbricksAction.ts b/apps/web/modules/formbricks/lib/trackFormbricksAction.ts new file mode 100644 index 0000000000..e65b220e99 --- /dev/null +++ b/apps/web/modules/formbricks/lib/trackFormbricksAction.ts @@ -0,0 +1,7 @@ +import formbricks from "@formbricks/js/app"; + +export const trackFormbricksAction = (eventName: string, properties: Record = {}) => { + if (process.env.NEXT_PUBLIC_FORMBRICKS_HOST_URL && process.env.NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID) { + formbricks.track(eventName, properties); + } +}; diff --git a/apps/web/modules/onboarding/hooks/useSubmitOnboarding.ts b/apps/web/modules/onboarding/hooks/useSubmitOnboarding.ts index 78a8ac24f5..68f1c30efc 100644 --- a/apps/web/modules/onboarding/hooks/useSubmitOnboarding.ts +++ b/apps/web/modules/onboarding/hooks/useSubmitOnboarding.ts @@ -1,6 +1,6 @@ import { useState } from "react"; -import { setShowNewOrgModalFlag } from "@calcom/features/ee/organizations/hooks/useWelcomeModal"; +import { setShowNewOrgModalFlag } from "@calcom/web/modules/ee/organizations/hooks/useWelcomeModal"; import { useFlagMap } from "@calcom/features/flags/context/provider"; import { CreationSource } from "@calcom/prisma/enums"; import { trpc } from "@calcom/trpc/react"; diff --git a/apps/web/modules/shell/Shell.tsx b/apps/web/modules/shell/Shell.tsx index 852ae579c1..74c54a00c5 100644 --- a/apps/web/modules/shell/Shell.tsx +++ b/apps/web/modules/shell/Shell.tsx @@ -7,9 +7,10 @@ import type React from "react"; import { cloneElement } from "react"; import { Toaster } from "sonner"; +import { useFormbricks } from "@calcom/web/modules/formbricks/hooks/useFormbricks"; import { useRedirectToLoginIfUnauthenticated } from "@calcom/web/modules/auth/hooks/useRedirectToLoginIfUnauthenticated"; import { useRedirectToOnboardingIfNeeded } from "@calcom/web/modules/auth/hooks/useRedirectToOnboardingIfNeeded"; -import { useFormbricks } from "@calcom/features/formbricks/formbricks-client"; + import TimezoneChangeDialog from "@calcom/web/modules/settings/components/TimezoneChangeDialog"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import classNames from "@calcom/ui/classNames"; diff --git a/packages/platform/atoms/event-types/wrappers/EventPaymentsTabPlatformWrapper.tsx b/packages/platform/atoms/event-types/wrappers/EventPaymentsTabPlatformWrapper.tsx index 7447d8b665..ca562fa861 100644 --- a/packages/platform/atoms/event-types/wrappers/EventPaymentsTabPlatformWrapper.tsx +++ b/packages/platform/atoms/event-types/wrappers/EventPaymentsTabPlatformWrapper.tsx @@ -4,7 +4,7 @@ import type { EventTypeForAppCard, } from "@calcom/app-store/_components/EventTypeAppCardInterface"; import type { EventTypeAppsList } from "@calcom/app-store/utils"; -import useAppsData from "@calcom/features/apps/hooks/useAppsData"; +import useAppsData from "@calcom/web/modules/apps/hooks/useAppsData"; import type { EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types"; import { EmptyScreen } from "@calcom/ui/components/empty-screen";