Skip to content

Commit eba0635

Browse files
authored
refactor: eliminate all @calcom/trpc/react imports and tRPC hooks from @calcom/features (calcom#27728)
* migrate booker layout selector * move schedule hooks and types * migrate feature opt in components * migrate feedback dialog * update * migrate schedule hooks * migrate useSegments * update * update import paths * fix import paths * mv useTimesForSchedule back to features * fix * add useEvent to web * remove the old file * update imports * clean up * migrate Segment * update imports * update imports * fix name * fix tests * fix * fix * update imports * remove trpc/react * remove trpc dependency from package.json * rm * wip * wip * fix types * fix * migrate PhoneInput * mv LocationInput * remove dead file * update import paths * rm dead import * rm useApp hook * cleanup * wip * restore * wip * remove dead code * fix * simplify * fix * fix * fix * fix * fix * fix * format * format * restore * remove prop
1 parent 7b9168e commit eba0635

25 files changed

Lines changed: 288 additions & 349 deletions

File tree

apps/web/components/apps/routing-forms/TestFormDialog.test.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ vi.mock("@calcom/web/modules/shell/Shell", () => ({
6464
ShellMain: vi.fn(),
6565
}));
6666

67-
vi.mock("@calcom/lib/hooks/useApp", () => ({
68-
default: vi.fn(),
69-
}));
7067
/**
7168
* Avoids the error due to Formbricks
7269
*/

apps/web/components/dialog/EditLocationDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
OrganizerDefaultConferencingAppType,
1616
} from "@calcom/app-store/locations";
1717
import { Dialog } from "@calcom/features/components/controlled-dialog";
18-
import PhoneInput from "@calcom/features/components/phone-input";
18+
import PhoneInput from "@calcom/web/components/phone-input";
1919
import type { LocationOption } from "@calcom/features/form/components/LocationSelect";
2020
import LocationSelect from "@calcom/features/form/components/LocationSelect";
2121
import { useLocale } from "@calcom/lib/hooks/useLocale";
File renamed without changes.
File renamed without changes.

apps/web/modules/bookings/components/BookEventForm/BookingFields.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { DefaultEventLocationTypeEnum } from "@calcom/app-store/locations";
88
import { useBookerStore } from "@calcom/features/bookings/Booker/store";
99
import type { GetBookingType } from "@calcom/features/bookings/lib/get-booking";
1010
import getLocationOptionsForSelect from "@calcom/features/bookings/lib/getLocationOptionsForSelect";
11-
import { FormBuilderField } from "@calcom/features/form-builder/FormBuilderField";
11+
import { FormBuilderField } from "@calcom/web/modules/form-builder/components/FormBuilderField";
1212
import { fieldTypesConfigMap } from "@calcom/features/form-builder/fieldTypes";
1313
import { fieldsThatSupportLabelAsSafeHtml } from "@calcom/features/form-builder/fieldsThatSupportLabelAsSafeHtml";
1414
import { SystemField } from "@calcom/lib/bookings/SystemField";

apps/web/modules/ee/workflows/components/AddActionDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Controller, useForm } from "react-hook-form";
66
import { z } from "zod";
77

88
import { Dialog } from "@calcom/features/components/controlled-dialog";
9-
import PhoneInput from "@calcom/features/components/phone-input";
9+
import PhoneInput from "@calcom/web/components/phone-input";
1010
import { WORKFLOW_ACTIONS } from "@calcom/features/ee/workflows/lib/constants";
1111
import { onlyLettersNumbersSpaces } from "@calcom/features/ee/workflows/lib/schema";
1212
import { SENDER_ID, SENDER_NAME } from "@calcom/lib/constants";

apps/web/modules/ee/workflows/components/TestPhoneCallDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState } from "react";
22
import type { UseFormReturn } from "react-hook-form";
33

44
import { Dialog } from "@calcom/features/components/controlled-dialog";
5-
import PhoneInput from "@calcom/features/components/phone-input";
5+
import PhoneInput from "@calcom/web/components/phone-input";
66
import { getEventTypeIdForCalAiTest } from "@calcom/features/ee/workflows/lib/actionHelperFunctions";
77
import type { FormValues } from "@calcom/features/ee/workflows/lib/types";
88
import { useLocale } from "@calcom/lib/hooks/useLocale";

apps/web/modules/ee/workflows/components/WorkflowStepContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import "react-phone-number-input/style.css";
88

99
import type { RetellAgentWithDetails } from "@calcom/features/calAIPhone/providers/retellAI";
1010
import { Dialog } from "@calcom/features/components/controlled-dialog";
11-
import PhoneInput from "@calcom/features/components/phone-input";
11+
import PhoneInput from "@calcom/web/components/phone-input";
1212
import {
1313
isSMSAction,
1414
isWhatsappAction,

apps/web/modules/event-types/components/locations/DefaultLocationSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
99
import classNames from "@calcom/ui/classNames";
1010
import { TextField } from "@calcom/ui/components/form";
1111

12-
import LocationInput from "@calcom/features/eventtypes/components/locations/LocationInput";
12+
import LocationInput from "./LocationInput";
1313
import LocationOptionContainer from "./LocationSettingsContainer";
1414

1515
const DefaultLocationSettings = ({

apps/web/modules/event-types/components/locations/HostLocations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
isStaticLocationType,
1616
} from "@calcom/app-store/locations";
1717
import { getAppFromSlug } from "@calcom/app-store/utils";
18-
import PhoneInput from "@calcom/features/components/phone-input";
18+
import PhoneInput from "@calcom/web/components/phone-input";
1919
import invertLogoOnDark from "@calcom/lib/invertLogoOnDark";
2020
import type { LocationOption } from "@calcom/features/form/components/LocationSelect";
2121
import LocationSelect from "@calcom/features/form/components/LocationSelect";

0 commit comments

Comments
 (0)