Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof bookingMetadataSchema>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}))(?:[/?#:]|$)/);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/ee/organizations/new/resume-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/ee/teams/components/TeamInviteList.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/ee/teams/components/TeamList.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/ee/teams/views/team-profile-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect } from "react";

import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";

export const initFormbricks = ({
const initFormbricks = ({
userId,
attributes,
}: {
Expand All @@ -29,12 +29,6 @@ export const initFormbricks = ({
}
};

export const trackFormbricksAction = (eventName: string, properties: Record<string, string> = {}) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted to apps/web/modules/formbricks/lib/trackFormbricksAction.ts

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();
Expand Down
7 changes: 7 additions & 0 deletions apps/web/modules/formbricks/lib/trackFormbricksAction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import formbricks from "@formbricks/js/app";

export const trackFormbricksAction = (eventName: string, properties: Record<string, string> = {}) => {
if (process.env.NEXT_PUBLIC_FORMBRICKS_HOST_URL && process.env.NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID) {
formbricks.track(eventName, properties);
}
};
2 changes: 1 addition & 1 deletion apps/web/modules/onboarding/hooks/useSubmitOnboarding.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
3 changes: 2 additions & 1 deletion apps/web/modules/shell/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Loading