Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
28e7559
Loading state and rejected bookings gone
leog May 11, 2022
f8d6e22
Listing fixes
leog May 12, 2022
cbf67d3
Merge branch 'main' into leog/recurring-event-improvements
leog May 12, 2022
0a977ce
Merge branch 'main' into leog/recurring-event-improvements
leog May 12, 2022
9a008db
Merge branch 'main' into leog/recurring-event-improvements
PeerRich May 13, 2022
624f42b
Merge branch 'main' into leog/recurring-event-improvements
pumfleet May 17, 2022
be14429
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 22, 2022
f5a6403
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
ad0957c
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
fe42380
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
2f370fb
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
b42ab5f
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
ce060f1
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
faf2f78
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
d1703f4
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
d19985d
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
e386911
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
e700bd8
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
052723a
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
c156235
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
4e3be33
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 23, 2022
e306f6a
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 24, 2022
da6c619
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 24, 2022
c2b5b51
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 24, 2022
b87ab98
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 25, 2022
0e2456e
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 25, 2022
36f6a99
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 25, 2022
22554d2
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 25, 2022
25e8266
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 25, 2022
c0e159a
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 25, 2022
acfe4a5
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 25, 2022
4e00ce7
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 25, 2022
2229332
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 25, 2022
ddddcb0
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
00bca27
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
f744093
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
499be42
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
827849b
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
c2894de
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
facdd39
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
ff020c0
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
305d43a
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
59754df
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
4398ca8
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 26, 2022
47c371b
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 27, 2022
d5389f5
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 27, 2022
f00012d
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 27, 2022
20117a9
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 27, 2022
5042c7c
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 27, 2022
47f0896
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 28, 2022
9c974f0
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 28, 2022
0a1fcf0
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 28, 2022
1b41c0c
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 28, 2022
9d15097
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 28, 2022
6c8cabf
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 28, 2022
37d4db6
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 28, 2022
e898329
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 28, 2022
a44554a
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 28, 2022
f187ede
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
2345740
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
6d065b0
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
abf8751
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
5b87d05
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
2226d88
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
0ef3c1a
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
1722e47
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
3ded649
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
ae0e60b
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
c5ce155
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
ba0685e
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
1095d52
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
56bee4b
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
44ed7ab
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
1cca638
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
f858677
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 30, 2022
547d944
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 31, 2022
0eb8c1c
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 31, 2022
fc0e552
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 31, 2022
bd2da91
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] May 31, 2022
de1eccc
Tweaking upcoming vs recurring bookings tabs
leog May 31, 2022
d17c9cd
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 1, 2022
a79303a
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 1, 2022
a2e2e13
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 1, 2022
92e7769
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 1, 2022
b4ba27c
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 2, 2022
2131572
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 2, 2022
90694c8
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 2, 2022
fba41d0
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 2, 2022
bfd4984
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 2, 2022
b615135
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 2, 2022
2fa47ec
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 2, 2022
6377aee
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 2, 2022
4194b1e
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 2, 2022
9151037
Merge branch 'main' into leog/recurring-event-improvements
leog Jun 6, 2022
b98362b
Merge branch 'main' into leog/recurring-event-improvements
leog Jun 6, 2022
a73bef2
Tweaking new emails to avoid recurringEvent param
leog Jun 7, 2022
5d090bb
Merge branch 'main' into leog/recurring-event-improvements
leog Jun 7, 2022
546eec7
Tweaks to support recurring events in common flows
leog Jun 7, 2022
eed2059
Merge branch 'main' into leog/recurring-event-improvements
leog Jun 7, 2022
1a6d549
Missed one renderEmail
leog Jun 7, 2022
07f19a7
Removing uneeded references
leog Jun 7, 2022
bf3bf97
Reverting manual plural fixes
leog Jun 7, 2022
e60aa9a
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 8, 2022
5098a44
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 8, 2022
cea572d
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 8, 2022
83961f8
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 8, 2022
30ccdd4
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 8, 2022
239597d
Refactoring recurring event strings
leog Jun 9, 2022
e2d74ac
Merge branch 'main' into leog/recurring-event-improvements
leog Jun 10, 2022
ddbf7ca
Correcting merge issues
leog Jun 10, 2022
334572c
Relying on newly introduced obj
leog Jun 10, 2022
f5336e3
Fixing mobile
leog Jun 10, 2022
5b727fb
Final tweaks
leog Jun 10, 2022
720860e
Latest fixes
leog Jun 10, 2022
185f0a9
Merge branch 'main' into leog/recurring-event-improvements
leog Jun 10, 2022
b0ea666
Merge branch 'main' into leog/recurring-event-improvements
leog Jun 10, 2022
f46389c
Merge branch 'main' into leog/recurring-event-improvements
kodiakhq[bot] Jun 10, 2022
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
65 changes: 40 additions & 25 deletions apps/web/components/booking/BookingListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { parseRecurringEvent } from "@calcom/lib";
import classNames from "@calcom/lib/classNames";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import showToast from "@calcom/lib/notification";
import { Frequency } from "@calcom/prisma/zod-utils";
import { getEveryFreqFor } from "@calcom/lib/recurringStrings";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A repeated string for recurring events was refactored into its own util

import Button from "@calcom/ui/Button";
import { Dialog, DialogClose, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/Dialog";
import { Tooltip } from "@calcom/ui/Tooltip";
Expand Down Expand Up @@ -63,9 +63,9 @@ function BookingListItem(booking: BookingItemProps) {
};
/**
* Only pass down the recurring event id when we need to confirm the entire series, which happens in
* the "Upcoming" tab, to support confirming discretionally in the "Recurring" tab.
* the "Recurring" tab, to support confirming discretionally in the "Recurring" tab.
*/
if (booking.listingStatus === "upcoming" && booking.recurringEventId !== null) {
if (booking.listingStatus === "recurring" && booking.recurringEventId !== null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is now a behavior desired for the recurring tab, not upcoming

body = Object.assign({}, body, { recurringEventId: booking.recurringEventId });
}
const res = await fetch("/api/book/confirm", {
Expand Down Expand Up @@ -96,7 +96,7 @@ function BookingListItem(booking: BookingItemProps) {
{
id: "reject",
label:
booking.listingStatus === "upcoming" && booking.recurringEventId !== null
booking.listingStatus === "recurring" && booking.recurringEventId !== null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's extract this repeated condition to isRecurring and use it instead

? t("reject_all")
: t("reject"),
onClick: () => {
Expand All @@ -108,7 +108,7 @@ function BookingListItem(booking: BookingItemProps) {
{
id: "confirm",
label:
booking.listingStatus === "upcoming" && booking.recurringEventId !== null
booking.listingStatus === "recurring" && booking.recurringEventId !== null
? t("confirm_all")
: t("confirm"),
onClick: () => {
Expand All @@ -120,10 +120,13 @@ function BookingListItem(booking: BookingItemProps) {
},
];

const bookedActions: ActionType[] = [
let bookedActions: ActionType[] = [
{
id: "cancel",
label: t("cancel"),
label:
booking.listingStatus === "recurring" && booking.recurringEventId !== null
? t("cancel_all_remaining")
: t("cancel"),
href: `/cancel/${booking.uid}`,
icon: XIcon,
},
Expand Down Expand Up @@ -159,6 +162,10 @@ function BookingListItem(booking: BookingItemProps) {
},
];

if (booking.listingStatus === "recurring" && booking.recurringEventId !== null) {
bookedActions = bookedActions.filter((action) => action.id !== "edit_booking");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case we are dealing with a recurring booking, no edition available

}

const RequestSentMessage = () => {
return (
<div className="ml-1 mr-8 flex text-gray-500" data-testid="request_reschedule_sent">
Expand Down Expand Up @@ -191,17 +198,24 @@ function BookingListItem(booking: BookingItemProps) {
setLocationMutation.mutate({ bookingId: booking.id, newLocation });
};

// Calculate the booking date(s)
// Calculate the booking date(s) and setup recurring event data to show
let recurringStrings: string[] = [];
if (booking.recurringCount && booking.eventType.recurringEvent?.freq !== null) {
[recurringStrings] = parseRecurringDates(
let recurringDates: Date[] = [];
const today = new Date();
if (booking.recurringCount && booking.eventType.recurringEvent?.freq !== undefined) {
[recurringStrings, recurringDates] = parseRecurringDates(
{
startDate: booking.startTime,
recurringEvent: parseRecurringEvent(booking.eventType.recurringEvent),
recurringCount: booking.recurringCount,
},
i18n
);
if (booking.status === BookingStatus.PENDING) {
// Only take into consideration next up instances if booking is confirmed
recurringDates = recurringDates.filter((aDate) => aDate >= today);
recurringStrings = recurringDates.map((_, key) => recurringStrings[key]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to support the "X remaining events" copy in confirmed recurring events showing in the recurring tab

}
}

let location = booking.location || "";
Expand Down Expand Up @@ -285,9 +299,7 @@ function BookingListItem(booking: BookingItemProps) {
</Dialog>

<tr className="flex hover:bg-neutral-50">
<td
className="hidden whitespace-nowrap align-top ltr:pl-6 rtl:pr-6 sm:table-cell sm:w-56"
onClick={onClick}>
<td className="hidden align-top ltr:pl-6 rtl:pr-6 sm:table-cell sm:w-64" onClick={onClick}>
<div className="cursor-pointer py-4">
<div className="text-sm leading-6 text-gray-900">{startTime}</div>
<div className="text-sm text-gray-500">
Expand All @@ -297,24 +309,27 @@ function BookingListItem(booking: BookingItemProps) {
<div className="text-sm text-gray-400">
{booking.recurringCount &&
booking.eventType?.recurringEvent?.freq &&
booking.listingStatus === "upcoming" && (
(booking.listingStatus === "recurring" || booking.listingStatus === "cancelled") && (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to show recurring information both in recurring and cancelled tabs

<div className="underline decoration-gray-400 decoration-dashed underline-offset-2">
<div className="flex">
<Tooltip
content={recurringStrings.map((aDate, key) => (
<p key={key}>{aDate}</p>
))}>
<p className="text-gray-600 dark:text-white">
<RefreshIcon className="mr-1 -mt-1 inline-block h-4 w-4 text-gray-400" />
{`${t("every_for_freq", {
freq: t(
`${Frequency[booking.eventType.recurringEvent.freq].toString().toLowerCase()}`
),
})} ${booking.recurringCount} ${t(
`${Frequency[booking.eventType.recurringEvent.freq].toString().toLowerCase()}`,
{ count: booking.recurringCount }
)}`}
</p>
<div className="text-gray-600 dark:text-white">
<RefreshIcon className="float-left mr-1 mt-[2px] inline-block h-4 w-4 text-gray-400" />
<p className="pl-[21px]">
{booking.status === BookingStatus.ACCEPTED
? `${t("event_remaining", {
count: recurringDates.length,
})}`
: getEveryFreqFor({
t,
recurringEvent: booking.eventType.recurringEvent,
recurringCount: booking.recurringCount,
})}
</p>
</div>
</Tooltip>
</div>
</div>
Expand Down
16 changes: 10 additions & 6 deletions apps/web/components/booking/CancelBooking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useRouter } from "next/router";
import { useState } from "react";

import { useLocale } from "@calcom/lib/hooks/useLocale";
import { RecurringEvent } from "@calcom/types/Calendar";
import { Button } from "@calcom/ui/Button";

import useTheme from "@lib/hooks/useTheme";
Expand All @@ -17,6 +18,7 @@ type Props = {
name: string | null;
slug: string | null;
};
recurringEvent: RecurringEvent | null;
team?: string | null;
setIsCancellationMode: (value: boolean) => void;
theme: string | null;
Expand Down Expand Up @@ -59,11 +61,13 @@ export default function CancelBooking(props: Props) {
rows={3}
/>
<div className="flex rtl:space-x-reverse">
<div className="w-full">
<Button color="secondary" onClick={() => router.push("/reschedule/" + booking?.uid)}>
{t("reschedule_this")}
</Button>
</div>
{!props.recurringEvent && (
<div className="w-full">
<Button color="secondary" onClick={() => router.push("/reschedule/" + booking?.uid)}>
{t("reschedule_this")}
</Button>
</div>
)}
<div className="w-full space-x-2 text-right">
<Button color="secondary" onClick={() => props.setIsCancellationMode(false)}>
{t("nevermind")}
Expand Down Expand Up @@ -92,7 +96,7 @@ export default function CancelBooking(props: Props) {
await router.push(
`/cancel/success?name=${props.profile.name}&title=${booking?.title}&eventPage=${
profile.slug
}&team=${team ? 1 : 0}`
}&team=${team ? 1 : 0}&recurring=${!!props.recurringEvent}`
);
} else {
setLoading(false);
Expand Down
119 changes: 45 additions & 74 deletions apps/web/components/booking/pages/AvailabilityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import {
import classNames from "@calcom/lib/classNames";
import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { getRecurringFreq } from "@calcom/lib/recurringStrings";
import { localStorage } from "@calcom/lib/webstorage";
import { Frequency } from "@calcom/prisma/zod-utils";

import { asStringOrNull } from "@lib/asStringOrNull";
import { timeZone } from "@lib/clock";
Expand Down Expand Up @@ -296,33 +296,6 @@ const AvailabilityPage = ({ profile, plan, eventType, workingHours, previousPage
<ClockIcon className="mr-[10px] -mt-1 ml-[2px] inline-block h-4 w-4 text-gray-400" />
{eventType.length} {t("minutes")}
</p>
{!rescheduleUid && eventType.recurringEvent?.count && eventType.recurringEvent?.freq && (
<div className="text-gray-600 dark:text-white">
<RefreshIcon className="mr-[10px] -mt-1 ml-[2px] inline-block h-4 w-4 text-gray-400" />
<p className="mb-1 -ml-2 inline px-2 py-1">
{t("every_for_freq", {
freq: t(
`${Frequency[eventType.recurringEvent.freq].toString().toLowerCase()}`
),
})}
</p>
<input
type="number"
min="1"
max={eventType.recurringEvent.count}
className="w-15 h-7 rounded-sm border-gray-300 bg-white text-gray-600 shadow-sm [appearance:textfield] ltr:mr-2 rtl:ml-2 dark:border-gray-500 dark:bg-gray-600 dark:text-white sm:text-sm"
defaultValue={eventType.recurringEvent.count}
onChange={(event) => {
setRecurringEventCount(parseInt(event?.target.value));
}}
/>
<p className="inline text-gray-600 dark:text-white">
{t(`${Frequency[eventType.recurringEvent.freq].toString().toLowerCase()}`, {
count: recurringEventCount,
})}
</p>
</div>
)}
{eventType.price > 0 && (
<div className="text-gray-600 dark:text-white">
<CreditCardIcon className="mr-[10px] ml-[2px] -mt-1 inline-block h-4 w-4 dark:text-gray-400" />
Expand All @@ -335,31 +308,29 @@ const AvailabilityPage = ({ profile, plan, eventType, workingHours, previousPage
</IntlProvider>
</div>
)}
{!rescheduleUid && eventType.recurringEvent?.count && eventType.recurringEvent?.freq && (
{!rescheduleUid && eventType.recurringEvent && (
<div className="text-gray-600 dark:text-white">
<RefreshIcon className="mr-[10px] -mt-1 ml-[2px] inline-block h-4 w-4 text-gray-400" />
<p className="mb-1 -ml-2 inline px-2 py-1">
{t("every_for_freq", {
freq: t(
`${Frequency[eventType.recurringEvent.freq].toString().toLowerCase()}`
),
})}
</p>
<input
type="number"
min="1"
max={eventType.recurringEvent.count}
className="w-15 h-7 rounded-sm border-gray-300 bg-white text-gray-600 shadow-sm [appearance:textfield] ltr:mr-2 rtl:ml-2 dark:border-gray-500 dark:bg-gray-600 dark:text-white sm:text-sm"
defaultValue={eventType.recurringEvent.count}
onChange={(event) => {
setRecurringEventCount(parseInt(event?.target.value));
}}
/>
<p className="inline text-gray-600 dark:text-white">
{t(`${Frequency[eventType.recurringEvent.freq].toString().toLowerCase()}`, {
count: recurringEventCount,
})}
</p>
<RefreshIcon className="float-left mr-[10px] mt-1 ml-[2px] inline-block h-4 w-4 text-gray-400" />
<div className="ml-[27px]">
<p className="mb-1 -ml-2 inline px-2 py-1">
{getRecurringFreq({ t, recurringEvent: eventType.recurringEvent })}
</p>
<input
type="number"
min="1"
max={eventType.recurringEvent.count}
className="w-15 h-7 rounded-sm border-gray-300 bg-white text-gray-600 shadow-sm [appearance:textfield] ltr:mr-2 rtl:ml-2 dark:border-gray-500 dark:bg-gray-600 dark:text-white sm:text-sm"
defaultValue={eventType.recurringEvent.count}
onChange={(event) => {
setRecurringEventCount(parseInt(event?.target.value));
}}
/>
<p className="inline text-gray-600 dark:text-white">
{t("occurrence", {
count: recurringEventCount,
})}
</p>
</div>
</div>
)}
<TimezoneDropdown />
Expand Down Expand Up @@ -460,29 +431,29 @@ const AvailabilityPage = ({ profile, plan, eventType, workingHours, previousPage
<ClockIcon className="mr-[10px] -mt-1 ml-[2px] inline-block h-4 w-4 text-gray-400" />
{eventType.length} {t("minutes")}
</p>
{!rescheduleUid && eventType.recurringEvent?.count && eventType.recurringEvent?.freq && (
{!rescheduleUid && eventType.recurringEvent && (
<div className="text-gray-600 dark:text-white">
<RefreshIcon className="mr-[10px] -mt-1 ml-[2px] inline-block h-4 w-4 text-gray-400" />
<p className="mb-1 -ml-2 inline px-2 py-1">
{t("every_for_freq", {
freq: t(`${Frequency[eventType.recurringEvent.freq].toString().toLowerCase()}`),
})}
</p>
<input
type="number"
min="1"
max={eventType.recurringEvent.count}
className="w-15 h-7 rounded-sm border-gray-300 bg-white text-gray-600 shadow-sm [appearance:textfield] ltr:mr-2 rtl:ml-2 dark:border-gray-500 dark:bg-gray-600 dark:text-white sm:text-sm"
defaultValue={eventType.recurringEvent.count}
onChange={(event) => {
setRecurringEventCount(parseInt(event?.target.value));
}}
/>
<p className="inline text-gray-600 dark:text-white">
{t(`${Frequency[eventType.recurringEvent.freq].toString().toLowerCase()}`, {
count: recurringEventCount,
})}
</p>
<RefreshIcon className="float-left mr-[10px] mt-1 ml-[2px] inline-block h-4 w-4 text-gray-400" />
<div className="ml-[27px]">
<p className="mb-1 -ml-2 inline px-2 py-1">
{getRecurringFreq({ t, recurringEvent: eventType.recurringEvent })}
</p>
<input
type="number"
min="1"
max={eventType.recurringEvent.count}
className="w-15 h-7 rounded-sm border-gray-300 bg-white text-gray-600 shadow-sm [appearance:textfield] ltr:mr-2 rtl:ml-2 dark:border-gray-500 dark:bg-gray-600 dark:text-white sm:text-sm"
defaultValue={eventType.recurringEvent.count}
onChange={(event) => {
setRecurringEventCount(parseInt(event?.target.value));
}}
/>
<p className="inline text-gray-600 dark:text-white">
{t("occurrence", {
count: recurringEventCount,
})}
</p>
</div>
</div>
)}
{eventType.price > 0 && (
Expand Down
13 changes: 6 additions & 7 deletions apps/web/components/booking/pages/BookingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import classNames from "@calcom/lib/classNames";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { HttpError } from "@calcom/lib/http-error";
import { Frequency } from "@calcom/prisma/zod-utils";
import { getEveryFreqFor } from "@calcom/lib/recurringStrings";
import { createPaymentLink } from "@calcom/stripe/client";
import { Button } from "@calcom/ui/Button";
import { Tooltip } from "@calcom/ui/Tooltip";
Expand Down Expand Up @@ -517,12 +517,11 @@ const BookingPage = ({
<div className="mb-3 text-gray-600 dark:text-white">
<RefreshIcon className="mr-[10px] -mt-1 ml-[2px] inline-block h-4 w-4 text-gray-400" />
<p className="mb-1 -ml-2 inline px-2 py-1">
{`${t("every_for_freq", {
freq: t(`${Frequency[eventType.recurringEvent.freq].toString().toLowerCase()}`),
})} ${recurringEventCount} ${t(
`${Frequency[eventType.recurringEvent.freq].toString().toLowerCase()}`,
{ count: parseInt(recurringEventCount.toString()) }
)}`}
{getEveryFreqFor({
t,
recurringEvent: eventType.recurringEvent,
recurringCount: recurringEventCount,
})}
</p>
</div>
)}
Expand Down
Loading