refactor: remove 3 @calcom/web imports from @calcom/features by relocating blocklist UI and useEvent hook (#27775)
* migrate blocklist components to web * migrate useEvent * fix * fix * rm barrel file * dead code
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ import {
|
||||
} from "@calcom/ui/components/dropdown";
|
||||
import { Checkbox } from "@calcom/ui/components/form";
|
||||
|
||||
import type { BlocklistEntry, BlocklistScope } from "../types";
|
||||
import type { BlocklistEntry, BlocklistScope } from "@calcom/features/blocklist/types";
|
||||
|
||||
interface UseBlockedEntriesColumnsProps<T extends BlocklistEntry> {
|
||||
t: (key: string) => string;
|
||||
+2
-2
@@ -5,14 +5,14 @@ import { getCoreRowModel, getSortedRowModel, useReactTable } from "@tanstack/rea
|
||||
import type { ReactNode } from "react";
|
||||
import { useMemo, useState } from "react";
|
||||
|
||||
import { DataTableSelectionBar, DataTableWrapper } from "~/data-table/components";
|
||||
import { DataTableSelectionBar, DataTableWrapper } from "@calcom/web/modules/data-table/components";
|
||||
import { IS_CALCOM } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { ConfirmationDialogContent, Dialog } from "@calcom/ui/components/dialog";
|
||||
import { EmptyScreen } from "@calcom/ui/components/empty-screen";
|
||||
|
||||
import type { BlocklistEntry, BlocklistPermissions, BlocklistScope } from "../types";
|
||||
import type { BlocklistEntry, BlocklistPermissions, BlocklistScope } from "@calcom/features/blocklist/types";
|
||||
import { useBlockedEntriesColumns } from "./BlockedEntriesColumns";
|
||||
import { BlocklistEntryDetailsSheet } from "./BlocklistEntryDetailsSheet";
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import {
|
||||
} from "@calcom/ui/components/sheet";
|
||||
import { SkeletonText } from "@calcom/ui/components/skeleton";
|
||||
|
||||
import type { BlocklistEntry, BlocklistEntryDetails, BlocklistScope } from "../types";
|
||||
import type { BlocklistEntry, BlocklistEntryDetails, BlocklistScope } from "@calcom/features/blocklist/types";
|
||||
|
||||
export interface BlocklistEntryDetailsSheetProps<T extends BlocklistEntry> {
|
||||
scope: BlocklistScope;
|
||||
+1
-1
@@ -10,7 +10,7 @@ import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/co
|
||||
import { ToggleGroup } from "@calcom/ui/components/form";
|
||||
import { Icon } from "@calcom/ui/components/icon";
|
||||
|
||||
import type { GroupedBookingReport, BlocklistScope } from "../types";
|
||||
import type { GroupedBookingReport, BlocklistScope } from "@calcom/features/blocklist/types";
|
||||
|
||||
interface FormData {
|
||||
blockType: WatchlistType;
|
||||
+1
-1
@@ -12,7 +12,7 @@ import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/co
|
||||
import { Input, Label, TextArea, ToggleGroup } from "@calcom/ui/components/form";
|
||||
import { Icon } from "@calcom/ui/components/icon";
|
||||
|
||||
import type { BlocklistScope, CreateBlocklistEntryFormData } from "../types";
|
||||
import type { BlocklistScope, CreateBlocklistEntryFormData } from "@calcom/features/blocklist/types";
|
||||
|
||||
export interface CreateBlocklistEntryModalProps {
|
||||
isOpen: boolean;
|
||||
+1
-1
@@ -14,7 +14,7 @@ import {
|
||||
} from "@calcom/ui/components/dropdown";
|
||||
import { Checkbox } from "@calcom/ui/components/form";
|
||||
|
||||
import type { GroupedBookingReport, BlocklistScope } from "../types";
|
||||
import type { GroupedBookingReport, BlocklistScope } from "@calcom/features/blocklist/types";
|
||||
|
||||
interface UsePendingReportsColumnsProps<T extends GroupedBookingReport> {
|
||||
t: (key: string) => string;
|
||||
+2
-2
@@ -5,12 +5,12 @@ import { getCoreRowModel, getSortedRowModel, useReactTable } from "@tanstack/rea
|
||||
import type { ReactNode } from "react";
|
||||
import { useMemo, useState } from "react";
|
||||
|
||||
import { DataTableSelectionBar, DataTableWrapper } from "~/data-table/components";
|
||||
import { DataTableSelectionBar, DataTableWrapper } from "@calcom/web/modules/data-table/components";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import type { WatchlistType } from "@calcom/prisma/enums";
|
||||
import { EmptyScreen } from "@calcom/ui/components/empty-screen";
|
||||
|
||||
import type { GroupedBookingReport, BlocklistScope } from "../types";
|
||||
import type { GroupedBookingReport, BlocklistScope } from "@calcom/features/blocklist/types";
|
||||
import { BookingReportDetailsModal } from "./BookingReportDetailsModal";
|
||||
import { usePendingReportsColumns } from "./PendingReportsColumns";
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
export * from "./types";
|
||||
export * from "./components/CreateBlocklistEntryModal";
|
||||
export * from "./components/BlockedEntriesTable";
|
||||
export * from "./components/BlockedEntriesColumns";
|
||||
@@ -17,7 +17,7 @@ import { BookerLayouts } from "@calcom/prisma/zod-utils";
|
||||
import classNames from "@calcom/ui/classNames";
|
||||
|
||||
import { AvailableTimesHeader } from "@calcom/web/modules/bookings/components/AvailableTimesHeader";
|
||||
import type { useScheduleForEventReturnType } from "@calcom/features/bookings/Booker/utils/event";
|
||||
import type { useScheduleForEventReturnType } from "@calcom/web/modules/schedules/hooks/useEvent";
|
||||
import { getQueryParam } from "@calcom/features/bookings/Booker/utils/query-param";
|
||||
|
||||
type AvailableTimeSlotsProps = {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { DialogContent } from "@calcom/ui/components/dialog";
|
||||
|
||||
import { getDurationFormatted } from "../event-meta/Duration";
|
||||
import { FromTime } from "@calcom/features/bookings/Booker/utils/dates";
|
||||
import { useEvent } from "@calcom/features/bookings/Booker/utils/event";
|
||||
import { useEvent } from "@calcom/web/modules/schedules/hooks/useEvent";
|
||||
import { useBookerTime } from "@calcom/features/bookings/Booker/hooks/useBookerTime";
|
||||
|
||||
const BookEventFormWrapper = ({ children, onCancel }: { onCancel: () => void; children: ReactNode }) => {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useSlots } from "../hooks/useSlots";
|
||||
import { useVerifyCode } from "../hooks/useVerifyCode";
|
||||
import { useVerifyEmail } from "../hooks/useVerifyEmail";
|
||||
import { useInitializeBookerStore } from "@calcom/features/bookings/Booker/store";
|
||||
import { useEvent, useScheduleForEvent } from "@calcom/features/bookings/Booker/utils/event";
|
||||
import { useEvent, useScheduleForEvent } from "@calcom/web/modules/schedules/hooks/useEvent";
|
||||
import { useBrandColors } from "@calcom/features/bookings/Booker/utils/use-brand-colors";
|
||||
import type { getPublicEvent } from "@calcom/features/eventtypes/lib/getPublicEvent";
|
||||
import { DEFAULT_DARK_BRAND_COLOR, DEFAULT_LIGHT_BRAND_COLOR, WEBAPP_URL } from "@calcom/lib/constants";
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Calendar } from "@calcom/web/modules/calendars/weeklyview/components/Ca
|
||||
import type { CalendarEvent } from "@calcom/features/calendars/weeklyview/types/events";
|
||||
import { localStorage } from "@calcom/lib/webstorage";
|
||||
|
||||
import type { useScheduleForEventReturnType } from "@calcom/features/bookings/Booker/utils/event";
|
||||
import type { useScheduleForEventReturnType } from "@calcom/web/modules/schedules/hooks/useEvent";
|
||||
import { getQueryParam } from "@calcom/features/bookings/Booker/utils/query-param";
|
||||
import { useOverlayCalendarStore } from "@calcom/features/bookings/Booker/components/OverlayCalendar/store";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DataTableRow } from "@calcom/features/data-table/lib/separator";
|
||||
import type { RouterOutputs } from "@calcom/trpc/react";
|
||||
import type { BookerEventQuery } from "@calcom/features/bookings/types";
|
||||
import type { useScheduleForEventReturnType } from "@calcom/features/bookings/Booker/utils/event";
|
||||
import type { useScheduleForEventReturnType } from "@calcom/web/modules/schedules/hooks/useEvent";
|
||||
import type { ToggledConnectedCalendars, CustomClassNames } from "@calcom/features/bookings/Booker/types";
|
||||
import type { EventBusyDate } from "@calcom/types/Calendar";
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
PendingReportsBadge,
|
||||
PendingReportsTable,
|
||||
type SortByOption,
|
||||
} from "@calcom/features/blocklist";
|
||||
} from "@calcom/web/modules/blocklist";
|
||||
import { DataTableProvider, useDataTable } from "@calcom/features/data-table";
|
||||
import { DataTableToolbar } from "~/data-table/components";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
PendingReportsBadge,
|
||||
PendingReportsTable,
|
||||
type SortByOption,
|
||||
} from "@calcom/features/blocklist";
|
||||
} from "@calcom/web/modules/blocklist";
|
||||
import { useDataTable } from "@calcom/features/data-table";
|
||||
import { DataTableToolbar } from "~/data-table/components";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
||||
@@ -21,7 +21,7 @@ import { useInitializeBookerStore } from "@calcom/features/bookings/Booker/store
|
||||
import {
|
||||
useEvent,
|
||||
useScheduleForEvent,
|
||||
} from "@calcom/features/bookings/Booker/utils/event";
|
||||
} from "@calcom/web/modules/schedules/hooks/useEvent";
|
||||
import DatePicker from "@calcom/features/calendars/components/DatePicker";
|
||||
import { Dialog } from "@calcom/features/components/controlled-dialog";
|
||||
import { TimezoneSelect } from "@calcom/web/modules/timezone/components/TimezoneSelect";
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { shallow } from "zustand/shallow";
|
||||
|
||||
import { useBookerStoreContext } from "@calcom/features/bookings/Booker/BookerStoreProvider";
|
||||
import { useSchedule } from "~/schedules/hooks/useSchedule";
|
||||
import { useSchedule } from "@calcom/web/modules/schedules/hooks/useSchedule";
|
||||
import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import type { useScheduleForEventReturnType } from "@calcom/features/bookings/Booker/utils/event";
|
||||
import type { BookerEventQuery } from "@calcom/features/bookings/types";
|
||||
import type { IntlSupportedTimeZones } from "@calcom/lib/timeZones";
|
||||
import type { EventBusyDate } from "@calcom/types/Calendar";
|
||||
import type { TIsAvailableOutputSchema } from "@calcom/trpc/server/routers/viewer/slots/isAvailable.schema";
|
||||
import type React from "react";
|
||||
import type { GetBookingType } from "../lib/get-booking";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user