Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { cookies, headers } from "next/headers";
import { redirect } from "next/navigation";
import { z } from "zod";

import { EventTypeWebWrapper } from "@calcom/atoms/event-types/wrappers/EventTypeWebWrapper";
import { EventTypeWebWrapper } from "@calcom/web/modules/event-types/components/EventTypeWebWrapper";
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
import { getEventTypePermissions } from "@calcom/features/pbac/lib/event-type-permissions";
import { eventTypesRouter } from "@calcom/trpc/server/routers/viewer/eventTypes/_router";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SkeletonLoader } from "@calcom/atoms/connect/conferencing-apps/ConferencingAppsViewWebWrapper";
import { SkeletonLoader } from "@calcom/web/modules/apps/components/ConferencingAppsViewWebWrapper";

export default function Loading() {
return <SkeletonLoader />;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createRouterCaller } from "app/_trpc/context";
import { _generateMetadata } from "app/_utils";

import { ConferencingAppsViewWebWrapper } from "@calcom/atoms/connect/conferencing-apps/ConferencingAppsViewWebWrapper";
import { ConferencingAppsViewWebWrapper } from "@calcom/web/modules/apps/components/ConferencingAppsViewWebWrapper";
import { appsRouter } from "@calcom/trpc/server/routers/viewer/apps/_router";
import { eventTypesRouter } from "@calcom/trpc/server/routers/viewer/eventTypes/_router";

Expand Down
4 changes: 2 additions & 2 deletions apps/web/components/apps/CalendarListContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { useEffect, Suspense } from "react";

import { InstallAppButton } from "@calcom/app-store/InstallAppButton";
import { DestinationCalendarSettingsWebWrapper } from "@calcom/atoms/destination-calendar/wrappers/DestinationCalendarSettingsWebWrapper";
import { SelectedCalendarsSettingsWebWrapper } from "@calcom/atoms/selected-calendars/wrappers/SelectedCalendarsSettingsWebWrapper";
import { DestinationCalendarSettingsWebWrapper } from "./DestinationCalendarSettingsWebWrapper";
import { SelectedCalendarsSettingsWebWrapper } from "@calcom/web/modules/calendars/components/SelectedCalendarsSettingsWebWrapper";
import AppListCard from "@calcom/web/modules/apps/components/AppListCard";
import { SkeletonLoader } from "@calcom/web/modules/apps/components/SkeletonLoader";
import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { trpc } from "@calcom/trpc/react";

import { AtomsWrapper } from "../../src/components/atoms-wrapper";
import { DestinationCalendarSettings } from "../DestinationCalendar";
import { AtomsWrapper } from "../../../../packages/platform/atoms/src/components/atoms-wrapper";
import { DestinationCalendarSettings } from "../../../../packages/platform/atoms/destination-calendar/DestinationCalendar";
Comment on lines +3 to +4
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify Next.js transpilation settings and path aliases relevant to packages/platform/atoms.

echo "== next.config files =="
fd -a 'next.config' -E node_modules -E .next

for f in $(fd -a 'next.config' -E node_modules -E .next); do
  echo "---- $f ----"
  rg -n "transpilePackages|externalDir|outputFileTracingRoot" "$f" || true
done

echo "== tsconfig path aliases =="
for f in $(fd -a 'tsconfig*.json' -E node_modules -E .next); do
  echo "---- $f ----"
  rg -n "\"@calcom/|packages/platform/atoms\"" "$f" || true
done

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 7713


🏁 Script executed:

#!/bin/bash
# Check the package.json and entry point of packages/platform/atoms

echo "== Looking for packages/platform/atoms package.json =="
find . -path "*/packages/platform/atoms/package.json" -type f 2>/dev/null | head -5

echo "== Inspect atoms package structure =="
find packages/platform/atoms -maxdepth 3 -type f -name "package.json" -o -name "index.ts" -o -name "index.tsx" 2>/dev/null | head -20

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 988


🏁 Script executed:

#!/bin/bash
# Check other imports from packages/platform/atoms in the codebase

echo "== Other imports from packages/platform/atoms =="
rg "from ['\"].*packages/platform/atoms" apps/web --type ts --type tsx -n | head -20

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 179


🏁 Script executed:

#!/bin/bash
# Get the actual transpilePackages array from apps/web/next.config.ts
echo "== apps/web/next.config.ts transpilePackages section =="
sed -n '230,260p' apps/web/next.config.ts

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 884


🏁 Script executed:

#!/bin/bash
# Check what's exported from packages/platform/atoms destination-calendar entry point
echo "== packages/platform/atoms/destination-calendar/index.ts =="
cat packages/platform/atoms/destination-calendar/index.ts

echo ""
echo "== packages/platform/atoms/src/components structure =="
find packages/platform/atoms/src/components -type f -name "*.ts" -o -name "*.tsx" 2>/dev/null | head -10

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 800


🏁 Script executed:

#!/bin/bash
# Check if atoms-wrapper is exported from the destination-calendar package or main atoms
echo "== Search for atoms-wrapper in packages/platform/atoms =="
find packages/platform/atoms -name "*atoms-wrapper*" -o -name "*AtomWrapper*" 2>/dev/null

echo ""
echo "== Check main atoms index.ts for atoms-wrapper export =="
rg -n "atoms-wrapper|AtomsWrapper" packages/platform/atoms/index.ts

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 258


🏁 Script executed:

#!/bin/bash
# Search for all deep imports from packages/platform/atoms across the whole codebase
echo "== All deep imports from packages/platform/atoms (across entire repo) =="
rg "from ['\"].*packages/platform/atoms/(src/|[a-z-]+/)" --type ts -A 0 | head -30

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1508


🏁 Script executed:

#!/bin/bash
# Check if DestinationCalendar file exists
echo "== packages/platform/atoms/destination-calendar/ directory contents =="
ls -la packages/platform/atoms/destination-calendar/

echo ""
echo "== Check for DestinationCalendarSettings export =="
rg -n "DestinationCalendarSettings" packages/platform/atoms/destination-calendar/ || echo "Not found in destination-calendar"

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1705


🏁 Script executed:

#!/bin/bash
# Check the main atoms index.ts to see what's exported
echo "== packages/platform/atoms/index.ts (main entry point) =="
cat packages/platform/atoms/index.ts | head -50

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 3731


🏁 Script executed:

#!/bin/bash
# Check the atoms-wrapper export
echo "== packages/platform/atoms/src/components/atoms-wrapper.tsx (first 20 lines) =="
head -20 packages/platform/atoms/src/components/atoms-wrapper.tsx

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 746


Add @calcom/platform-atoms to transpilePackages and prefer entry-point exports.

Lines 3–4 import directly from package source paths (atoms-wrapper and DestinationCalendar file), bypassing the main entry point. The AtomsWrapper is not exported from the package entry, but DestinationCalendarSettings is available as DestinationCalendarSettingsPlatformWrapper from packages/platform/atoms. Additionally, @calcom/platform-atoms is not listed in Next.js transpilePackages at apps/web/next.config.ts (which currently includes @calcom/app-store, @calcom/features, @calcom/lib, etc.), which may cause transpilation issues in production. Either add @calcom/platform-atoms to transpilePackages or consider creating a tsconfig path alias to normalize these imports.

🤖 Prompt for AI Agents
In `@apps/web/components/apps/DestinationCalendarSettingsWebWrapper.tsx` around
lines 3 - 4, Current imports bypass the package entry by importing AtomsWrapper
and DestinationCalendarSettings from deep source paths; update imports to use
the package entry and transpilation settings by replacing deep imports with the
public exports from packages/platform/atoms (use
DestinationCalendarSettingsPlatformWrapper for DestinationCalendarSettings and
the exported AtomsWrapper if added to the package entry), and add
`@calcom/platform-atoms` to the Next.js transpilePackages array in next.config.ts
(or alternatively add a tsconfig path alias pointing to the package entry) so
the module is transpiled in production.


export const DestinationCalendarSettingsWebWrapper = () => {
const calendars = trpc.viewer.calendars.connectedCalendars.useQuery();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import { useReducer } from "react";

import { AppList } from "@calcom/web/modules/apps/components/AppList";
import DisconnectIntegrationModal from "@calcom/web/modules/apps/components/DisconnectIntegrationModal";
import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
Expand All @@ -13,6 +11,9 @@ import { EmptyScreen } from "@calcom/ui/components/empty-screen";
import { SkeletonText, SkeletonContainer } from "@calcom/ui/components/skeleton";
import { showToast } from "@calcom/ui/components/toast";

import { AppList } from "./AppList";
import DisconnectIntegrationModal from "./DisconnectIntegrationModal";

export type UpdateUsersDefaultConferencingAppParams = {
appSlug: string;
appLink?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import { useSession } from "next-auth/react";
import { useSearchParams, usePathname, useRouter } from "next/navigation";
import { useMemo, useCallback, useEffect, useRef } from "react";
import { useSearchParams, usePathname } from "next/navigation";
import { useMemo, useCallback, useEffect } from "react";
import React from "react";
Comment on lines +4 to 6
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | head -50

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 2890


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '190,240p'

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 2125


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '40,100p'

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 2927


🏁 Script executed:

rg "const router\s*=" apps/web/modules/bookings/components/BookerWebWrapper.tsx

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 68


🏁 Script executed:

rg "router" apps/web/modules/bookings/components/BookerWebWrapper.tsx -B 2 -A 2

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1414


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '100,180p'

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 3280


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '180,210p'

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1308


🏁 Script executed:

wc -l apps/web/modules/bookings/components/BookerWebWrapper.tsx

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 147


🏁 Script executed:

grep -n "router" apps/web/modules/bookings/components/BookerWebWrapper.tsx

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 454


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | grep -E "(function|const.*=.*\(|router\s*:|router\s*=)" | head -30

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1946


router is undefined after useRouter import was removed. The variable is used at lines 193, 228, 232, and 238, but never declared. Re-introduce the useRouter import and declare the router instance.

🛠️ Proposed fix
-import { useSearchParams, usePathname } from "next/navigation";
+import { useSearchParams, usePathname, useRouter } from "next/navigation";
 const BookerWebWrapperComponent = (props: BookerWebWrapperAtomProps) => {
   const pathname = usePathname();
   const searchParams = useSearchParams();
+  const router = useRouter();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { useSearchParams, usePathname } from "next/navigation";
import { useMemo, useCallback, useEffect } from "react";
import React from "react";
import { useSearchParams, usePathname, useRouter } from "next/navigation";
import { useMemo, useCallback, useEffect } from "react";
import React from "react";
🤖 Prompt for AI Agents
In `@apps/web/modules/bookings/components/BookerWebWrapper.tsx` around lines 4 -
6, The component BookerWebWrapper uses router but removed the useRouter hook;
re-add the import "useRouter" from "next/navigation" and declare a router
instance inside the component (e.g., const router = useRouter()) alongside other
hooks (useSearchParams, usePathname, useMemo, etc.) so the existing references
to router (used in callbacks and effects) resolve and follow React hook rules.

import { shallow } from "zustand/shallow";

Expand All @@ -12,7 +12,6 @@ import {
} from "@calcom/embed-core/embed-iframe";
import { useBookerEmbedEvents } from "@calcom/embed-core/src/embed-iframe/react-hooks";
import type { BookerProps } from "@calcom/features/bookings/Booker";
import { Booker as BookerComponent } from "@calcom/web/modules/bookings/components/Booker";
import {
BookerStoreProvider,
useInitializeBookerStoreContext,
Expand All @@ -33,12 +32,13 @@ import { DEFAULT_LIGHT_BRAND_COLOR, DEFAULT_DARK_BRAND_COLOR, WEBAPP_URL } from
import { useRouterQuery } from "@calcom/lib/hooks/useRouterQuery";
import { localStorage } from "@calcom/lib/webstorage";

import { Booker as BookerComponent } from "./Booker";

export type BookerWebWrapperAtomProps = BookerProps & {
eventData?: NonNullable<Awaited<ReturnType<typeof getPublicEvent>>>;
};

const BookerWebWrapperComponent = (props: BookerWebWrapperAtomProps) => {
const router = useRouter();
const pathname = usePathname();
const searchParams = useSearchParams();
const clientFetchedEvent = useEvent({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Alert } from "@calcom/ui/components/alert";
import { Select } from "@calcom/ui/components/form";
import { List } from "@calcom/ui/components/list";

import { SelectedCalendarsSettings } from "../SelectedCalendarsSettings";
import { SelectedCalendarsSettings } from "@calcom/atoms/selected-calendars/SelectedCalendarsSettings";

export enum SelectedCalendarSettingsScope {
User = "user",
Expand Down Expand Up @@ -147,7 +147,6 @@ export const SelectedCalendarsSettingsWebWrapper = (props: SelectedCalendarsSett

const query = trpc.viewer.calendars.connectedCalendars.useQuery(
{

eventTypeId: scope === SelectedCalendarSettingsScope.EventType ? eventTypeId! : null,
},
{
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/d/[link]/d-type-view.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { BookerWebWrapper as Booker } from "@calcom/atoms/booker";
import { BookerWebWrapper as Booker } from "@calcom/web/modules/bookings/components/BookerWebWrapper";
import { getBookerWrapperClasses } from "@calcom/features/bookings/Booker/utils/getBookerWrapperClasses";

import { type PageProps } from "@lib/d/[link]/[slug]/getServerSideProps";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Controller } from "react-hook-form";
import type { Options } from "react-select";

import { AddMembersWithSwitchPlatformWrapper } from "@calcom/atoms/add-members-switch/AddMembersWithSwitchPlatformWrapper";
import { AddMembersWithSwitchWebWrapper } from "@calcom/atoms/add-members-switch/AddMembersWithSwitchWebWrapper";
import { AddMembersWithSwitchWebWrapper } from "./AddMembersWithSwitchWebWrapper";
import { useIsPlatform } from "@calcom/atoms/hooks/useIsPlatform";
import { Segment } from "@calcom/features/Segment";
import type {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { AddMembersWithSwitchProps } from "@calcom/web/modules/event-types/components/AddMembersWithSwitch";
import { AddMembersWithSwitch } from "@calcom/web/modules/event-types/components/AddMembersWithSwitch";
import { trpc } from "@calcom/trpc/react";

import type { AddMembersWithSwitchProps } from "./AddMembersWithSwitch";
import { AddMembersWithSwitch } from "./AddMembersWithSwitch";

export const AddMembersWithSwitchWebWrapper = ({ ...props }: AddMembersWithSwitchProps) => {
const utils = trpc.useUtils();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { useEffect, useRef, useState } from "react";
import { z } from "zod";

import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider";
import type { ChildrenEventType } from "@calcom/web/modules/event-types/components/ChildrenEventTypeSelect";
import { EventType as EventTypeComponent } from "@calcom/web/modules/event-types/components/EventType";
import type { EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types";
import { EventPermissionProvider } from "@calcom/features/pbac/client/context/EventPermissionContext";
import { useWorkflowPermission } from "@calcom/features/pbac/client/hooks/useEventPermission";
Expand All @@ -20,14 +18,17 @@ import { trpc } from "@calcom/trpc/react";
import type { RouterOutputs } from "@calcom/trpc/react";
import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
import { showToast } from "@calcom/ui/components/toast";
import { revalidateTeamEventTypeCache } from "@calcom/web/app/(booking-page-wrapper)/team/[slug]/[type]/actions";
import { revalidateEventTypeEditPage } from "@calcom/web/app/(use-page-wrapper)/event-types/[type]/actions";

import { TRPCClientError } from "@trpc/react-query";

import { useEventTypeForm } from "../hooks/useEventTypeForm";
import { useHandleRouteChange } from "../hooks/useHandleRouteChange";
import { useTabsNavigations } from "../hooks/useTabsNavigations";
import { revalidateTeamEventTypeCache } from "@calcom/web/app/(booking-page-wrapper)/team/[slug]/[type]/actions";
import { revalidateEventTypeEditPage } from "@calcom/web/app/(use-page-wrapper)/event-types/[type]/actions";

import type { ChildrenEventType } from "./ChildrenEventTypeSelect";
import { EventType as EventTypeComponent } from "./EventType";
import { useEventTypeForm } from "@calcom/atoms/event-types/hooks/useEventTypeForm";
import { useHandleRouteChange } from "@calcom/atoms/event-types/hooks/useHandleRouteChange";
import { useTabsNavigations } from "@calcom/atoms/event-types/hooks/useTabsNavigations";

type EventPermissions = {
eventTypes: {
Expand All @@ -44,65 +45,49 @@ type EventPermissions = {
};
};

const ManagedEventTypeDialog = dynamic(
() => import("@calcom/web/modules/event-types/components/dialogs/ManagedEventDialog")
);
const ManagedEventTypeDialog = dynamic(() => import("./dialogs/ManagedEventDialog"));

const AssignmentWarningDialog = dynamic(
() => import("@calcom/web/modules/event-types/components/dialogs/AssignmentWarningDialog")
);
const AssignmentWarningDialog = dynamic(() => import("./dialogs/AssignmentWarningDialog"));

const EventSetupTab = dynamic(
() =>
// import web wrapper when it's ready
import("./EventSetupTabWebWrapper").then((mod) => mod),
() => import("./tabs/setup/EventSetupTabWebWrapper").then((mod) => mod),
{ loading: () => null }
);

const EventAvailabilityTab = dynamic(() =>
// import web wrapper when it's ready
import("./EventAvailabilityTabWebWrapper").then((mod) => mod)
import("./tabs/availability/EventAvailabilityTabWebWrapper").then((mod) => mod)
);

const EventTeamAssignmentTab = dynamic(() => import("./EventTeamAssignmentTabWebWrapper").then((mod) => mod));
const EventTeamAssignmentTab = dynamic(() => import("./tabs/assignment/EventTeamAssignmentTabWebWrapper"));

const EventLimitsTab = dynamic(() =>
// import web wrapper when it's ready
import("./EventLimitsTabWebWrapper").then((mod) => mod)
import("./tabs/limits/EventLimitsTabWebWrapper").then((mod) => mod)
);

const EventAdvancedTab = dynamic(() =>
// import web wrapper when it's ready
import("./EventAdvancedWebWrapper").then((mod) => mod)
import("./tabs/advanced/EventAdvancedWebWrapper").then((mod) => mod)
);

const EventInstantTab = dynamic(() =>
import("@calcom/web/modules/event-types/components/tabs/instant/EventInstantTab").then(
(mod) => mod.EventInstantTab
)
import("./tabs/instant/EventInstantTab").then((mod) => mod.EventInstantTab)
);

const EventRecurringTab = dynamic(() =>
// import web wrapper when it's ready
import("./EventRecurringWebWrapper").then((mod) => mod)
import("./tabs/recurring/EventRecurringWebWrapper").then((mod) => mod)
);

const EventAppsTab = dynamic(() =>
import("@calcom/web/modules/event-types/components/tabs/apps/EventAppsTab").then((mod) => mod.EventAppsTab)
import("./tabs/apps/EventAppsTab").then((mod) => mod.EventAppsTab)
);

const EventWorkflowsTab = dynamic(
() => import("@calcom/web/modules/event-types/components/tabs/workflows/EventWorkflowsTab")
);
const EventWorkflowsTab = dynamic(() => import("./tabs/workflows/EventWorkflowsTab"));

const EventWebhooksTab = dynamic(() =>
import("@calcom/web/modules/event-types/components/tabs/webhooks/EventWebhooksTab").then(
(mod) => mod.EventWebhooksTab
)
import("./tabs/webhooks/EventWebhooksTab").then((mod) => mod.EventWebhooksTab)
);

const EventAITab = dynamic(() =>
import("@calcom/web/modules/event-types/components/tabs/ai/EventAITab").then((mod) => mod.EventAITab)
import("./tabs/ai/EventAITab").then((mod) => mod.EventAITab)
);

export type EventTypeWebWrapperProps = {
Expand Down Expand Up @@ -248,21 +233,21 @@ const EventTypeWeb = ({

const tabMap = {
setup: (
<EventSetupTab
eventType={eventType}
locationOptions={locationOptions}
team={team}
teamMembers={teamMembers}
destinationCalendar={destinationCalendar}
/>
<EventSetupTab
eventType={eventType}
locationOptions={locationOptions}
team={team}
teamMembers={teamMembers}
destinationCalendar={destinationCalendar}
/>
),
availability: (
<EventAvailabilityTab
eventType={eventType}
isTeamEvent={!!team}
user={user}
teamMembers={teamMembers}
/>
<EventAvailabilityTab
eventType={eventType}
isTeamEvent={!!team}
user={user}
teamMembers={teamMembers}
/>
),
team: (
<EventTeamAssignmentTab
Expand Down
23 changes: 1 addition & 22 deletions apps/web/modules/event-types/components/HostEditDialogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
InputClassNames,
SelectClassNames,
} from "@calcom/features/eventtypes/lib/types";
import { groupHostsByGroupId, getHostsFromOtherGroups } from "@calcom/lib/bookings/hostGroupUtils";
import { groupHostsByGroupId, getHostsFromOtherGroups, sortHosts } from "@calcom/lib/bookings/hostGroupUtils";
import { DEFAULT_GROUP_ID } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import classNames from "@calcom/ui/classNames";
Expand Down Expand Up @@ -128,27 +128,6 @@ export const PriorityDialog = (
);
};

export function sortHosts(
hostA: { priority: number | null; weight: number | null },
hostB: { priority: number | null; weight: number | null },
isRRWeightsEnabled: boolean
) {
const weightA = hostA.weight ?? 100;
const priorityA = hostA.priority ?? 2;
const weightB = hostB.weight ?? 100;
const priorityB = hostB.priority ?? 2;

if (isRRWeightsEnabled) {
if (weightA === weightB) {
return priorityB - priorityA;
} else {
return weightB - weightA;
}
} else {
return priorityB - priorityA;
}
}

export type WeightDialogCustomClassNames = {
container?: string;
label?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
SelectedCalendarsSettingsWebWrapper,
SelectedCalendarSettingsScope,
SelectedCalendarsSettingsWebWrapperSkeleton,
} from "@calcom/atoms/selected-calendars/wrappers/SelectedCalendarsSettingsWebWrapper";
} from "@calcom/web/modules/calendars/components/SelectedCalendarsSettingsWebWrapper";
import { Timezone as PlatformTimzoneSelect } from "@calcom/atoms/timezone";
import getLocationsOptionsForSelect from "@calcom/features/bookings/lib/getLocationOptionsForSelect";
import DestinationCalendarSelector from "@calcom/features/calendars/DestinationCalendarSelector";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { localeOptions } from "@calcom/lib/i18n";
import { trpc } from "@calcom/trpc/react";
import type { EventAdvancedBaseProps } from "@calcom/web/modules/event-types/components/tabs/advanced/EventAdvancedTab";
import { EventAdvancedTab } from "@calcom/web/modules/event-types/components/tabs/advanced/EventAdvancedTab";

import type { EventAdvancedBaseProps } from "./EventAdvancedTab";
import { EventAdvancedTab } from "./EventAdvancedTab";

const EventAdvancedWebWrapper = ({ ...props }: EventAdvancedBaseProps) => {
const connectedCalendarsQuery = trpc.viewer.calendars.connectedCalendars.useQuery();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import AssignAllTeamMembers from "@calcom/web/modules/event-types/components/Ass
import type { ChildrenEventTypeSelectCustomClassNames } from "@calcom/web/modules/event-types/components/ChildrenEventTypeSelect";
import ChildrenEventTypeSelect from "@calcom/web/modules/event-types/components/ChildrenEventTypeSelect";
import { EditWeightsForAllTeamMembers } from "@calcom/web/modules/event-types/components/EditWeightsForAllTeamMembers";
import { sortHosts } from "@calcom/web/modules/event-types/components/HostEditDialogs";
import { sortHosts } from "@calcom/lib/bookings/hostGroupUtils";
import { LearnMoreLink } from "@calcom/web/modules/event-types/components/LearnMoreLink";
import WeightDescription from "@calcom/web/modules/event-types/components/WeightDescription";
import type {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
EventTeamAssignmentTab,
type EventTeamAssignmentTabBaseProps,
} from "@calcom/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTab";
} from "./EventTeamAssignmentTab";

const EventTeamAssignmentTabWebWrapper = (
props: Omit<EventTeamAssignmentTabBaseProps, "isSegmentApplicable">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Controller, useFormContext } from "react-hook-form";
import type { OptionProps, SingleValueProps } from "react-select";
import { components } from "react-select";

import type { GetAllSchedulesByUserIdQueryType } from "@calcom/atoms/event-types/wrappers/EventAvailabilityTabWebWrapper";
import type { GetAllSchedulesByUserIdQueryType } from "./EventAvailabilityTabWebWrapper";
import { useIsPlatform } from "@calcom/atoms/hooks/useIsPlatform";
import dayjs from "@calcom/dayjs";
import { SelectSkeletonLoader } from "@calcom/features/availability/components/SkeletonLoader";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useFormContext } from "react-hook-form";

import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hooks/useLockedFieldsManager";
import type { TeamMembers } from "@calcom/web/modules/event-types/components/EventType";
import type { EventTypeSetup, FormValues } from "@calcom/features/eventtypes/lib/types";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { RouterOutputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
import { EventAvailabilityTab } from "@calcom/web/modules/event-types/components/tabs/availability/EventAvailabilityTab";

import type { TeamMembers } from "../../EventType";
import { EventAvailabilityTab } from "./EventAvailabilityTab";

export type EventAvailabilityTabWebWrapperProps = {
eventType: EventTypeSetup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ const EventLimitsTabWebWrapper = (props: EventLimitsTabProps) => {
return <EventLimitsTab {...props} />;
};

export default EventLimitsTabWebWrapper;
export default EventLimitsTabWebWrapper;
Loading
Loading