From d2bbbf3f45c6d1617e244516b2ebbfd717c6db51 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 16:53:40 +0200 Subject: [PATCH] feat: expose AvailabilitySettingsProps type in @calcom/atoms (#22246) * feat: expose AvailabilitySettingsProps type in @calcom/atoms - Export AvailabilitySettingsPlatformWrapperProps as AvailabilitySettingsProps - Add type export to main atoms package index for direct import - Enables external consumers to import type directly from @calcom/atoms Co-Authored-By: rajiv@cal.com * feat: also export AtomScheduleType for atomSchedule data - Export FindDetailedScheduleByIdReturnType as AtomScheduleType - Enables direct import of atomSchedule type from @calcom/atoms - Covers both AvailabilitySettingsProps and AtomScheduleType exports Co-Authored-By: rajiv@cal.com * fix: update AtomScheduleType to include null and undefined Co-Authored-By: rajiv@cal.com * refactor: move AtomScheduleType to AvailabilitySettingsPlatformWrapper for cleaner organization Co-Authored-By: rajiv@cal.com * feat: rename AtomScheduleType to AvailabilitySettingsAtomScheduleType for better clarity Co-Authored-By: rajiv@cal.com * feat: rename to AvailabilitySettingsScheduleType for better naming consistency Co-Authored-By: rajiv@cal.com * fix: use proper import from @calcom/platform-libraries/schedules instead of dynamic import Co-Authored-By: rajiv@cal.com * add changelogs * feat: extract AvailabilitySettingsSchedule type from AvailabilitySettingsProps - Extract schedule property structure into separate AvailabilitySettingsSchedule type - Update AvailabilitySettingsProps to reuse the extracted schedule type - Export AvailabilitySettingsSchedule from @calcom/atoms package index - Enables direct import of schedule type for external consumers Co-Authored-By: rajiv@cal.com * Revert "feat: extract AvailabilitySettingsSchedule type from AvailabilitySettingsProps" This reverts commit 79239e4b18925db3fcc1d8df7e9f37770ec4f116. * fixup: extract schedule for AvailabilitySettingsProps --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: rajiv@cal.com Co-authored-by: Rajiv Sahal Co-authored-by: Ryukemeister --- .changeset/better-zebras-relate.md | 5 ++++ .../availability/AvailabilitySettings.tsx | 24 ++++++++++--------- .../AvailabilitySettingsPlatformWrapper.tsx | 2 +- packages/platform/atoms/index.ts | 2 ++ 4 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 .changeset/better-zebras-relate.md diff --git a/.changeset/better-zebras-relate.md b/.changeset/better-zebras-relate.md new file mode 100644 index 0000000000..46a322d91d --- /dev/null +++ b/.changeset/better-zebras-relate.md @@ -0,0 +1,5 @@ +--- +"@calcom/atoms": minor +--- + +This change updates the atoms export file to include type for Schedule in Availability Settings atom diff --git a/packages/platform/atoms/availability/AvailabilitySettings.tsx b/packages/platform/atoms/availability/AvailabilitySettings.tsx index f46a42fa6f..7b94c0e499 100644 --- a/packages/platform/atoms/availability/AvailabilitySettings.tsx +++ b/packages/platform/atoms/availability/AvailabilitySettings.tsx @@ -69,19 +69,21 @@ export type CustomClassNames = { export type Availability = Pick; +export type AvailabilitySettingsScheduleType = { + name: string; + id: number; + availability: TimeRange[][]; + isLastSchedule: boolean; + isDefault: boolean; + workingHours: WorkingHours[]; + dateOverrides: { ranges: TimeRange[] }[]; + timeZone: string; + schedule: Availability[]; +}; + type AvailabilitySettingsProps = { skeletonLabel?: string; - schedule: { - name: string; - id: number; - availability: TimeRange[][]; - isLastSchedule: boolean; - isDefault: boolean; - workingHours: WorkingHours[]; - dateOverrides: { ranges: TimeRange[] }[]; - timeZone: string; - schedule: Availability[]; - }; + schedule: AvailabilitySettingsScheduleType; travelSchedules?: RouterOutputs["viewer"]["travelSchedules"]["get"]; handleDelete: () => void; allowDelete?: boolean; diff --git a/packages/platform/atoms/availability/wrappers/AvailabilitySettingsPlatformWrapper.tsx b/packages/platform/atoms/availability/wrappers/AvailabilitySettingsPlatformWrapper.tsx index e6756f9af4..d4c3a9d2c7 100644 --- a/packages/platform/atoms/availability/wrappers/AvailabilitySettingsPlatformWrapper.tsx +++ b/packages/platform/atoms/availability/wrappers/AvailabilitySettingsPlatformWrapper.tsx @@ -15,7 +15,7 @@ import type { CustomClassNames } from "../AvailabilitySettings"; import { AvailabilitySettings } from "../AvailabilitySettings"; import type { AvailabilityFormValues } from "../types"; -type AvailabilitySettingsPlatformWrapperProps = { +export type AvailabilitySettingsPlatformWrapperProps = { id?: string; labels?: { tooltips: Partial; diff --git a/packages/platform/atoms/index.ts b/packages/platform/atoms/index.ts index 3ff8f90e70..41409e3a38 100644 --- a/packages/platform/atoms/index.ts +++ b/packages/platform/atoms/index.ts @@ -1,6 +1,8 @@ export { CalProvider } from "./cal-provider"; export { GcalConnect } from "./connect/google/GcalConnect"; export { AvailabilitySettingsPlatformWrapper as AvailabilitySettings } from "./availability"; +export type { AvailabilitySettingsPlatformWrapperProps as AvailabilitySettingsProps } from "./availability/wrappers/AvailabilitySettingsPlatformWrapper"; +export type { AvailabilitySettingsScheduleType } from "./availability/AvailabilitySettings"; export { BookerPlatformWrapper as Booker } from "./booker/BookerPlatformWrapper"; export { useIsPlatform } from "./hooks/useIsPlatform"; export { useAtomsContext } from "./hooks/useAtomsContext";