Skip to content

Scheduling infrastructure for absolutely everyone.

feat: event type tabs platform wrapper (#16891)

Somay Chauhan513a58c91c0f
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index 3f94fae70aa..6e306dcbfa4 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -1668,6 +1668,7 @@
"billing_frequency": "Billing Frequency",
"monthly": "Monthly",
"yearly": "Yearly",
+ "weekly": "Weekly",
"checkout": "Checkout",
"your_team_disbanded_successfully": "Your team has been disbanded successfully",
"your_org_disbanded_successfully": "Your organization has been disbanded successfully",
diff --git a/packages/platform/atoms/event-types/wrappers/EventLimitsTabPlatformWrapper.tsx b/packages/platform/atoms/event-types/wrappers/EventLimitsTabPlatformWrapper.tsx
new file mode 100644
index 00000000000..940333ebc3e
--- /dev/null
+++ b/packages/platform/atoms/event-types/wrappers/EventLimitsTabPlatformWrapper.tsx
@@ -0,0 +1,8 @@
+import { EventLimitsTab } from "@calcom/features/eventtypes/components/tabs/limits/EventLimitsTab";
+import type { EventLimitsTabProps } from "@calcom/features/eventtypes/components/tabs/limits/EventLimitsTab";
+
+const EventLimitsTabPlatformWrapper = (props: EventLimitsTabProps) => {
+ return <EventLimitsTab {...props} />;
+};
+
+export default EventLimitsTabPlatformWrapper;
diff --git a/packages/platform/atoms/event-types/wrappers/EventRecurringTabPlatformWrapper.tsx b/packages/platform/atoms/event-types/wrappers/EventRecurringTabPlatformWrapper.tsx
new file mode 100644
index 00000000000..c7436e91d5a
--- /dev/null
+++ b/packages/platform/atoms/event-types/wrappers/EventRecurringTabPlatformWrapper.tsx
@@ -0,0 +1,10 @@
+import { EventRecurringTab } from "@calcom/features/eventtypes/components/tabs/recurring/EventRecurringTab";
+import type { EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types";
+
+export type EventRecurringWebWrapperProps = Pick<EventTypeSetupProps, "eventType">;
+
+const EventRecurringTabPlatformWrapper = (props: EventRecurringWebWrapperProps) => {
+ return <EventRecurringTab {...props} />;
+};
+
+export default EventRecurringTabPlatformWrapper;
diff --git a/packages/platform/atoms/event-types/wrappers/EventTypePlatformWrapper.tsx b/packages/platform/atoms/event-types/wrappers/EventTypePlatformWrapper.tsx
index 13a3a33ee10..9dbd993b7b1 100644
--- a/packages/platform/atoms/event-types/wrappers/EventTypePlatformWrapper.tsx
+++ b/packages/platform/atoms/event-types/wrappers/EventTypePlatformWrapper.tsx
@@ -17,6 +17,8 @@ import { useAtomUpdateEventType } from "../hooks/useAtomUpdateEventType";
import { useEventTypeForm } from "../hooks/useEventTypeForm";
import { useHandleRouteChange } from "../hooks/useHandleRouteChange";
import { usePlatformTabsNavigations } from "../hooks/usePlatformTabsNavigations";
+import EventLimitsTabPlatformWrapper from "./EventLimitsTabPlatformWrapper";
+import EventRecurringTabPlatformWrapper from "./EventRecurringTabPlatformWrapper";
import SetupTab from "./EventSetupTabPlatformWrapper";
export type PlatformTabs = keyof Omit<TabMap, "workflows" | "webhooks" | "instant" | "ai" | "apps">;
@@ -29,9 +31,7 @@ export type EventTypePlatformWrapperProps = {
};
const EventType = ({
- tabs = ["setup", "availability", "team", "limits", "advanced"],
- onSuccess,
- onError,
+ tabs = ["setup", "availability", "team", "limits", "advanced", "recurring"],
...props
}: EventTypeSetupProps & EventTypePlatformWrapperProps) => {
const { t } = useLocale();
@@ -87,10 +87,14 @@ const EventType = ({
),
availability: <></>,
team: <></>,
- limits: <></>,
+ limits: tabs.includes("limits") ? <EventLimitsTabPlatformWrapper eventType={eventType} /> : <></>,
advanced: <></>,
instant: <></>,
- recurring: <></>,
+ recurring: tabs.includes("recurring") ? (
+ <EventRecurringTabPlatformWrapper eventType={eventType} />
+ ) : (
+ <></>
+ ),
apps: <></>,
workflows: <></>,
webhooks: <></>,
diff --git a/packages/platform/examples/base/src/pages/event-types.tsx b/packages/platform/examples/base/src/pages/event-types.tsx
index 69a8a82311a..f43ce2a6fec 100644
--- a/packages/platform/examples/base/src/pages/event-types.tsx
+++ b/packages/platform/examples/base/src/pages/event-types.tsx
@@ -86,7 +86,7 @@ export default function Bookings(props: { calUsername: string; calEmail: string
<div>
<EventTypeSettings
id={eventTypeId}
- tabs={["setup"]}
+ tabs={["setup", "limits", "recurring", "advanced"]}
onSuccess={(eventType) => {
console.log(eventType);
setEventTypeId(null);