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 <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 <rajiv@cal.com> * fix: update AtomScheduleType to include null and undefined Co-Authored-By: rajiv@cal.com <rajiv@cal.com> * refactor: move AtomScheduleType to AvailabilitySettingsPlatformWrapper for cleaner organization Co-Authored-By: rajiv@cal.com <rajiv@cal.com> * feat: rename AtomScheduleType to AvailabilitySettingsAtomScheduleType for better clarity Co-Authored-By: rajiv@cal.com <rajiv@cal.com> * feat: rename to AvailabilitySettingsScheduleType for better naming consistency Co-Authored-By: rajiv@cal.com <rajiv@cal.com> * fix: use proper import from @calcom/platform-libraries/schedules instead of dynamic import Co-Authored-By: rajiv@cal.com <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 <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 <rajiv@cal.com> Co-authored-by: Rajiv Sahal <sahalrajiv-extc@atharvacoe.ac.in> Co-authored-by: Ryukemeister <sahalrajiv6900@gmail.com>
This commit is contained in:
co-authored by
Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
rajiv@cal.com <rajiv@cal.com>
Rajiv Sahal
Ryukemeister
parent
13cb99b7fe
commit
d2bbbf3f45
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@calcom/atoms": minor
|
||||
---
|
||||
|
||||
This change updates the atoms export file to include type for Schedule in Availability Settings atom
|
||||
@@ -69,19 +69,21 @@ export type CustomClassNames = {
|
||||
|
||||
export type Availability = Pick<Schedule, "days" | "startTime" | "endTime">;
|
||||
|
||||
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;
|
||||
|
||||
+1
-1
@@ -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<ScheduleLabelsType>;
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user