Skip to content
Merged
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 @@ -22,7 +22,6 @@ import type {
SeatOptionsDisabledSchema,
SeatOptionsTransformedSchema,
} from "@calcom/platform-types";

import {
type CustomField,
type SystemField,
Expand Down Expand Up @@ -689,6 +688,32 @@ describe("transformIntervalLimitsApiToInternal", () => {

expect(result).toEqual(expectedOutput);
});

it("should handle bookingLimitsCount with disabled: false and valid counts", () => {
const input: BookingLimitsCount_2024_06_14 = {
day: 5,
disabled: false,
};

const expectedOutput = {
PER_DAY: 5,
};
const result = transformIntervalLimitsApiToInternal(input);

expect(result).toEqual(expectedOutput);
expect(result).not.toHaveProperty("undefined");
});

it("should handle bookingLimitsCount with disabled: true", () => {
const input: BookingLimitsCount_2024_06_14 = {
disabled: true,
};

const expectedOutput = {};
const result = transformIntervalLimitsApiToInternal(input);

expect(result).toEqual(expectedOutput);
});
});

describe("transformFutureBookingLimitsApiToInternal", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BookingLimitsEnum_2024_06_14 } from "@calcom/platform-enums";
import {
type CreateEventTypeInput_2024_06_14,
type BookingLimitsKeyOutputType_2024_06_14,
type CreateEventTypeInput_2024_06_14,
type TransformBookingLimitsSchema_2024_06_14,
} from "@calcom/platform-types";

Expand All @@ -13,7 +13,10 @@ export function transformIntervalLimitsApiToInternal(
return res;
}
inputBookingLimits &&
Object.entries(inputBookingLimits).map(([key, value]) => {
Object.entries(inputBookingLimits).forEach(([key, value]) => {
if (!(key in BookingLimitsEnum_2024_06_14)) {
return;
}
const outputKey: BookingLimitsKeyOutputType_2024_06_14 = BookingLimitsEnum_2024_06_14[
key as keyof typeof BookingLimitsEnum_2024_06_14
] satisfies BookingLimitsKeyOutputType_2024_06_14;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type { VerticalTabItemProps } from "@calcom/ui/components/navigation";
import { VerticalTabItem } from "@calcom/ui/components/navigation";
import { Skeleton } from "@calcom/ui/components/skeleton";
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible";
import Image from "next/image";
import { Avatar } from "@calcom/ui/components/avatar";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { useSession } from "next-auth/react";
Expand Down Expand Up @@ -622,12 +622,11 @@ const TeamListCollapsible = ({ teamFeatures }: { teamFeatures?: Record<number, T
</div>
{}
{!team.parentId && (
<Image
src={getPlaceholderAvatar(team.logoUrl, team.name)}
width={16}
height={16}
className="self-start rounded-full stroke-[2px] ltr:mr-2 rtl:ml-2 md:mt-0"
<Avatar
size="xs"
imageSrc={getPlaceholderAvatar(team.logoUrl, team.name)}
alt={team.name || "Team logo"}
className="self-start border-0 bg-transparent ltr:mr-2 rtl:ml-2 md:mt-0"
/>
)}
<p className="w-1/2 truncate leading-normal">{team.name}</p>
Expand Down Expand Up @@ -813,12 +812,11 @@ const SettingsSidebarContainer = ({
)}
{}
{!tab.icon && tab?.avatar && (
<Image
width={16}
height={16}
className="rounded-full ltr:mr-3 rtl:ml-3"
src={tab?.avatar}
alt="Organization Logo"
<Avatar
size="xs"
imageSrc={tab?.avatar}
alt={tab.name || "Organization Logo"}
className="border-0 bg-transparent ltr:mr-3 rtl:ml-3"
/>
)}
<Skeleton
Expand Down Expand Up @@ -969,12 +967,11 @@ const SettingsSidebarContainer = ({
</div>
{}
{!otherTeam.parentId && (
<Image
src={getPlaceholderAvatar(otherTeam.logoUrl, otherTeam.name)}
width={16}
height={16}
className="self-start rounded-full stroke-[2px] ltr:mr-2 rtl:ml-2 md:mt-0"
<Avatar
size="xs"
imageSrc={getPlaceholderAvatar(otherTeam.logoUrl, otherTeam.name)}
alt={otherTeam.name || "Team logo"}
className="self-start border-0 bg-transparent ltr:mr-2 rtl:ml-2 md:mt-0"
/>
)}
<p className="w-1/2 truncate leading-normal">{otherTeam.name}</p>
Expand Down
Loading
Loading