Skip to content

Commit 1f102bf

Browse files
authored
fix: revert bookings redesign (#25172)
* Revert "refactor: extract logic as bookingDetailsSheetStore (#25129)" This reverts commit 7a0b8a9. * Revert "feat: bookings page redesign v3 with calendar view (#24664)" This reverts commit 8923047.
1 parent 7a0b8a9 commit 1f102bf

35 files changed

+636
-1989
lines changed

apps/web/app/(use-page-wrapper)/(main-nav)/bookings/[status]/ViewToggleButton.tsx

Lines changed: 0 additions & 62 deletions
This file was deleted.

apps/web/app/(use-page-wrapper)/(main-nav)/bookings/[status]/page.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import { redirect } from "next/navigation";
66
import { z } from "zod";
77

88
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
9+
import { FeaturesRepository } from "@calcom/features/flags/features.repository";
910
import { PermissionCheckService } from "@calcom/features/pbac/services/permission-check.service";
11+
import { prisma } from "@calcom/prisma";
1012
import { MembershipRole } from "@calcom/prisma/enums";
1113

1214
import { buildLegacyRequest } from "@lib/buildLegacyCtx";
1315

1416
import { validStatuses } from "~/bookings/lib/validStatuses";
1517
import BookingsList from "~/bookings/views/bookings-view";
1618

17-
import { ViewToggleButton } from "./ViewToggleButton";
18-
1919
const querySchema = z.object({
2020
status: z.enum(validStatuses),
2121
});
@@ -54,12 +54,18 @@ const Page = async ({ params }: PageProps) => {
5454
canReadOthersBookings = teamIdsWithPermission.length > 0;
5555
}
5656

57+
const featuresRepository = new FeaturesRepository(prisma);
58+
const isCalendarViewEnabled = await featuresRepository.checkIfFeatureIsEnabledGlobally(
59+
"booking-calendar-view"
60+
);
61+
5762
return (
58-
<ShellMainAppDir heading={t("bookings")} CTA={<ViewToggleButton />}>
63+
<ShellMainAppDir heading={t("bookings")} subtitle={t("bookings_description")}>
5964
<BookingsList
6065
status={parsed.data.status}
6166
userId={session?.user?.id}
6267
permissions={{ canReadOthersBookings }}
68+
isCalendarViewEnabled={isCalendarViewEnabled}
6369
/>
6470
</ShellMainAppDir>
6571
);

apps/web/components/booking/_BookingListItem.tsx renamed to apps/web/components/booking/BookingListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ function BookingListItem(booking: BookingItemProps) {
499499
</div>
500500
<div className="flex w-full flex-col flex-wrap items-end justify-end space-x-2 space-y-2 py-4 pl-4 text-right text-sm font-medium ltr:pr-4 rtl:pl-4 sm:flex-row sm:flex-nowrap sm:items-start sm:space-y-0 sm:pl-0">
501501
{shouldShowPendingActions(actionContext) && <TableActions actions={pendingActions} />}
502-
<BookingActionsDropdown booking={booking} />
502+
<BookingActionsDropdown booking={booking} context="booking-list-item" />
503503
{shouldShowRecurringCancelAction(actionContext) && <TableActions actions={[cancelEventAction]} />}
504504
{shouldShowIndividualReportButton(actionContext) && (
505505
<div className="flex items-center space-x-2">
Lines changed: 21 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,36 @@
11
import React from "react";
22

3-
import classNames from "@calcom/ui/classNames";
4-
import { SkeletonAvatar, SkeletonText } from "@calcom/ui/components/skeleton";
3+
import { SkeletonText } from "@calcom/ui/components/skeleton";
54

65
function SkeletonLoader() {
76
return (
8-
<div className="animate-pulse">
9-
{/* Table rows with separator at the beginning */}
10-
<div className="divide-subtle divide-y">
11-
{/* Month separator skeleton */}
12-
<div className="bg-muted rounded-t py-2">
13-
<SkeletonItem isHeader={true} />
14-
</div>
15-
<div className="bg-muted">
16-
<SkeletonText className="ml-2 mt-3 h-4 w-28 rounded" />
17-
</div>
18-
19-
<SkeletonItem />
20-
<SkeletonItem />
21-
<SkeletonItem />
22-
<SkeletonItem />
23-
<SkeletonItem />
24-
</div>
25-
</div>
7+
<ul className="divide-subtle border-subtle bg-default animate-pulse divide-y rounded-md border sm:overflow-hidden">
8+
<SkeletonItem />
9+
<SkeletonItem />
10+
<SkeletonItem />
11+
</ul>
2612
);
2713
}
2814

2915
export default SkeletonLoader;
3016

31-
function SkeletonItem({ isHeader = false }: { isHeader?: boolean }) {
17+
function SkeletonItem() {
3218
return (
33-
<div
34-
className={classNames(
35-
"grid grid-cols-[132px_130px_185px_150px_140px_280px] gap-6 px-2",
36-
isHeader ? "py-2" : "py-2.5"
37-
)}>
38-
{/* Date column - 140px */}
39-
<div className="flex items-center">
40-
<SkeletonText className={classNames("h-4 rounded", isHeader ? "w-12" : "w-20")} />
41-
</div>
42-
43-
{/* Time column - 140px */}
44-
<div className="flex items-center">
45-
<SkeletonText className={classNames("h-4 rounded", isHeader ? "w-12" : "w-28")} />
46-
</div>
47-
48-
{/* Event column - 200px */}
49-
<div className="flex items-center">
50-
<SkeletonText className={classNames("h-4 rounded", isHeader ? "w-16" : "w-full")} />
51-
</div>
52-
53-
{/* Who column - 160px, Avatar group */}
54-
<div className="flex items-center -space-x-1">
55-
{isHeader && <SkeletonText className="h-4 w-20 rounded" />}
56-
{!isHeader && (
57-
<>
58-
<SkeletonAvatar className="h-6 w-6 rounded-full" />
59-
<SkeletonAvatar className="h-6 w-6 rounded-full" />
60-
<SkeletonAvatar className="h-6 w-6 rounded-full" />
61-
</>
62-
)}
63-
</div>
64-
65-
{/* Team column - 140px */}
66-
<div className="flex items-center">
67-
<SkeletonText className="h-4 w-20 rounded-md" />
19+
<li className="group flex w-full items-center justify-between px-4 py-4 sm:px-6">
20+
<div className="flex-grow truncate text-sm">
21+
<div className="flex">
22+
<div className="flex flex-col space-y-2">
23+
<SkeletonText className="h-5 w-16" />
24+
<SkeletonText className="h-4 w-32" />
25+
</div>
26+
</div>
6827
</div>
69-
70-
{/* Actions column - 280px */}
71-
<div className="mr-2 flex items-center justify-end gap-2">
72-
{isHeader && <SkeletonText className="h-4 w-16 rounded-md" />}
73-
{!isHeader && (
74-
<>
75-
<SkeletonText className="h-4 w-16 rounded-md" />
76-
<SkeletonText className="h-4 w-20 rounded-md" />
77-
<SkeletonText className="h-4 w-8 rounded-md" />
78-
</>
79-
)}
28+
<div className="mt-4 hidden flex-shrink-0 sm:ml-5 sm:mt-0 lg:flex">
29+
<div className="flex justify-between space-x-2 rtl:space-x-reverse">
30+
<SkeletonText className="h-6 w-16" />
31+
<SkeletonText className="h-6 w-32" />
32+
</div>
8033
</div>
81-
</div>
34+
</li>
8235
);
8336
}

0 commit comments

Comments
 (0)