Skip to content

Commit 6a17a4c

Browse files
authored
Merge branch 'main' into 7936-wrong-links-in-commercial-license-required-page
2 parents a7994cd + 9d61dc2 commit 6a17a4c

9 files changed

Lines changed: 148 additions & 138 deletions

File tree

apps/web/components/Embed.tsx

Lines changed: 69 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible";
1+
import { Collapsible, CollapsibleContent } from "@radix-ui/react-collapsible";
22
import classNames from "classnames";
33
import type { NextRouter } from "next/router";
44
import { useRouter } from "next/router";
@@ -22,7 +22,7 @@ import {
2222
TextField,
2323
ColorPicker,
2424
} from "@calcom/ui";
25-
import { FiCode, FiTrello, FiSun, FiArrowLeft, FiChevronRight } from "@calcom/ui/components/icon";
25+
import { FiCode, FiTrello, FiSun, FiArrowLeft } from "@calcom/ui/components/icon";
2626

2727
import Select from "@components/ui/form/Select";
2828

@@ -313,7 +313,7 @@ const embeds: {
313313
}[] = [
314314
{
315315
title: "Inline Embed",
316-
subtitle: "Loads your Cal scheduling page directly inline with your other website content",
316+
subtitle: "Loads your event type directly inline with your other website content.",
317317
type: "inline",
318318
illustration: (
319319
<svg
@@ -798,7 +798,7 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
798798
}
799799

800800
const ThemeOptions = [
801-
{ value: Theme.auto, label: "Auto Theme" },
801+
{ value: Theme.auto, label: "Auto" },
802802
{ value: Theme.dark, label: "Dark Theme" },
803803
{ value: Theme.light, label: "Light Theme" },
804804
];
@@ -815,67 +815,62 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
815815
];
816816

817817
return (
818-
<DialogContent ref={dialogContentRef} size="xl" className="p-0.5" type="creation">
818+
<DialogContent
819+
ref={dialogContentRef}
820+
className="rounded-lg p-0.5 sm:max-w-[80rem]"
821+
enableOverflow
822+
type="creation">
819823
<div className="flex">
820824
<div className="flex w-1/3 flex-col bg-gray-50 p-8">
821-
<h3 className="mb-2 flex text-xl font-bold leading-6 text-gray-900" id="modal-title">
825+
<h3
826+
className="mb-2.5 flex items-center text-xl font-semibold leading-5 text-gray-900"
827+
id="modal-title">
822828
<button
829+
className="h-6 w-6"
823830
onClick={() => {
824831
removeQueryParams(router, ["embedType", "embedTabName"]);
825832
}}>
826833
<FiArrowLeft className="mr-4 w-4" />
827834
</button>
828835
{embed.title}
829836
</h3>
830-
<hr className={classNames("mt-4", embedType === "element-click" ? "hidden" : "")} />
831-
<div className="flex flex-col overflow-y-auto">
832-
<div className={classNames("mt-4 font-medium", embedType === "element-click" ? "hidden" : "")}>
837+
<h4 className="mb-6 text-sm font-normal text-gray-500">{embed.subtitle}</h4>
838+
<div className="flex flex-col">
839+
<div className={classNames("font-medium", embedType === "element-click" ? "hidden" : "")}>
833840
<Collapsible
834841
open={isEmbedCustomizationOpen}
835842
onOpenChange={() => setIsEmbedCustomizationOpen((val) => !val)}>
836-
<CollapsibleTrigger
837-
type="button"
838-
className="flex w-full items-center text-base font-medium text-gray-900">
839-
<div>
840-
{embedType === "inline"
841-
? "Inline Embed Customization"
842-
: embedType === "floating-popup"
843-
? "Floating Popup Customization"
844-
: "Element Click Customization"}
845-
</div>
846-
<FiChevronRight
847-
className={`${
848-
isEmbedCustomizationOpen ? "rotate-90 transform" : ""
849-
} ml-auto h-5 w-5 text-gray-500`}
850-
/>
851-
</CollapsibleTrigger>
852843
<CollapsibleContent className="text-sm">
853-
<div className={classNames("mt-6", embedType === "inline" ? "block" : "hidden")}>
844+
<div className={classNames(embedType === "inline" ? "block" : "hidden")}>
854845
{/*TODO: Add Auto/Fixed toggle from Figma */}
855-
<div className="text-sm">Embed Window Sizing</div>
856-
<div className="justify-left flex items-center">
857-
<TextField
858-
labelProps={{ className: "hidden" }}
859-
required
860-
value={previewState.inline.width}
861-
onChange={(e) => {
862-
setPreviewState((previewState) => {
863-
const width = e.target.value || "100%";
846+
<div className="mb-[9px] text-sm">Window sizing</div>
847+
<div className="justify-left flex items-center !font-normal">
848+
<div className="mr-[9px]">
849+
<TextField
850+
labelProps={{ className: "hidden" }}
851+
className="focus:ring-offset-0"
852+
required
853+
value={previewState.inline.width}
854+
onChange={(e) => {
855+
setPreviewState((previewState) => {
856+
const width = e.target.value || "100%";
857+
858+
return {
859+
...previewState,
860+
inline: {
861+
...previewState.inline,
862+
width,
863+
},
864+
};
865+
});
866+
}}
867+
addOnLeading={<>W</>}
868+
/>
869+
</div>
864870

865-
return {
866-
...previewState,
867-
inline: {
868-
...previewState.inline,
869-
width,
870-
},
871-
};
872-
});
873-
}}
874-
addOnLeading={<>W</>}
875-
/>
876-
<span className="p-2">×</span>
877871
<TextField
878872
labelProps={{ className: "hidden" }}
873+
className="focus:ring-offset-0"
879874
value={previewState.inline.height}
880875
required
881876
onChange={(e) => {
@@ -1007,22 +1002,13 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
10071002
</CollapsibleContent>
10081003
</Collapsible>
10091004
</div>
1010-
<hr className="mt-4" />
1011-
<div className="mt-4 font-medium">
1005+
<div className="font-medium">
10121006
<Collapsible
10131007
open={isBookingCustomizationOpen}
10141008
onOpenChange={() => setIsBookingCustomizationOpen((val) => !val)}>
1015-
<CollapsibleTrigger className="flex w-full" type="button">
1016-
<div className="text-base font-medium text-gray-900">Cal Booking Customization</div>
1017-
<FiChevronRight
1018-
className={`${
1019-
isBookingCustomizationOpen ? "rotate-90 transform" : ""
1020-
} ml-auto h-5 w-5 text-gray-500`}
1021-
/>
1022-
</CollapsibleTrigger>
10231009
<CollapsibleContent>
10241010
<div className="mt-6 text-sm">
1025-
<div className="mb-4 flex items-center justify-start space-x-2 rtl:space-x-reverse">
1011+
<div className="mb-6 flex items-center justify-start space-x-2 rtl:space-x-reverse">
10261012
<Switch
10271013
checked={previewState.hideEventTypeDetails}
10281014
onCheckedChange={(checked) => {
@@ -1036,28 +1022,6 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
10361022
/>
10371023
<div className="text-sm">{t("hide_eventtype_details")}</div>
10381024
</div>
1039-
<Label className="">
1040-
<div className="mb-2">Theme</div>
1041-
<Select
1042-
className="w-full"
1043-
defaultValue={ThemeOptions[0]}
1044-
components={{
1045-
Control: ThemeSelectControl,
1046-
}}
1047-
onChange={(option) => {
1048-
if (!option) {
1049-
return;
1050-
}
1051-
setPreviewState((previewState) => {
1052-
return {
1053-
...previewState,
1054-
theme: option.value,
1055-
};
1056-
});
1057-
}}
1058-
options={ThemeOptions}
1059-
/>
1060-
</Label>
10611025
{[
10621026
{ name: "brandColor", title: "Brand Color" },
10631027
// { name: "lightColor", title: "Light Color" },
@@ -1066,8 +1030,8 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
10661030
// { name: "highlightColor", title: "Highlight Color" },
10671031
// { name: "medianColor", title: "Median Color" },
10681032
].map((palette) => (
1069-
<Label key={palette.name} className="pb-4">
1070-
<div className="mb-2 pt-2">{palette.title}</div>
1033+
<Label key={palette.name} className="mb-6">
1034+
<div className="mb-2">{palette.title}</div>
10711035
<div className="w-full">
10721036
<ColorPicker
10731037
popoverAlign="start"
@@ -1082,6 +1046,29 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
10821046
</div>
10831047
</Label>
10841048
))}
1049+
<Label>
1050+
<div className="mb-2">Theme</div>
1051+
<Select
1052+
className="w-full"
1053+
defaultValue={ThemeOptions[0]}
1054+
components={{
1055+
Control: ThemeSelectControl,
1056+
IndicatorSeparator: () => null,
1057+
}}
1058+
onChange={(option) => {
1059+
if (!option) {
1060+
return;
1061+
}
1062+
setPreviewState((previewState) => {
1063+
return {
1064+
...previewState,
1065+
theme: option.value,
1066+
};
1067+
});
1068+
}}
1069+
options={ThemeOptions}
1070+
/>
1071+
</Label>
10851072
</div>
10861073
</CollapsibleContent>
10871074
</Collapsible>

apps/web/components/eventtype/EventLimitsTab.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ const IntervalLimitItem = ({
426426
required
427427
type="number"
428428
containerClassName={textFieldSuffix ? "w-44 -mb-1" : "w-16 mb-0"}
429+
className="mb-0"
429430
placeholder={`${value}`}
430431
min={step}
431432
step={step}

apps/web/public/static/locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@
15011501
"date_overrides_update_btn": "Update Override",
15021502
"event_type_duplicate_copy_text": "{{slug}}-copy",
15031503
"set_as_default": "Set as default",
1504-
"hide_eventtype_details": "Hide EventType Details",
1504+
"hide_eventtype_details": "Hide event type details",
15051505
"show_navigation": "Show navigation",
15061506
"hide_navigation": "Hide navigation",
15071507
"verification_code_sent": "Verification code sent",

packages/app-store/routing-forms/components/react-awesome-query-builder/config/config.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import type { Settings, Widgets, SelectWidgetProps } from "react-awesome-query-b
44
//@ts-ignore
55
import BasicConfig from "react-awesome-query-builder/lib/config/basic";
66

7+
import { EmailField } from "@calcom/ui";
8+
79
import widgetsComponents from "../widgets";
810

911
const {
@@ -92,8 +94,7 @@ const widgets: Widgets & { [key in keyof Widgets]: Widgets[key] & { type: string
9294
if (!props) {
9395
return <div />;
9496
}
95-
// TODO: Use EmailField component for Routing Form Email field
96-
return <TextWidget type="email" {...props} />;
97+
return <EmailField type="email" {...props} />;
9798
},
9899
},
99100
};

packages/features/bookings/lib/handleNewBooking.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ async function handler(
10841084
await sendRescheduledEmails({
10851085
...copyEvent,
10861086
additionalNotes, // Resets back to the additionalNote input and not the override value
1087-
cancellationReason: "$RCH$" + rescheduleReason ? rescheduleReason : "", // Removable code prefix to differentiate cancellation from rescheduling for email
1087+
cancellationReason: "$RCH$" + (rescheduleReason ? rescheduleReason : ""), // Removable code prefix to differentiate cancellation from rescheduling for email
10881088
});
10891089
}
10901090
const resultBooking = await resultBookingQuery(newBooking.id);
@@ -1189,7 +1189,7 @@ async function handler(
11891189
await sendRescheduledEmails({
11901190
...copyEvent,
11911191
additionalNotes, // Resets back to the additionalNote input and not the override value
1192-
cancellationReason: "$RCH$" + rescheduleReason ? rescheduleReason : "", // Removable code prefix to differentiate cancellation from rescheduling for email
1192+
cancellationReason: "$RCH$" + (rescheduleReason ? rescheduleReason : ""), // Removable code prefix to differentiate cancellation from rescheduling for email
11931193
});
11941194

11951195
// Update the old booking with the cancelled status
@@ -1519,6 +1519,9 @@ async function handler(
15191519
};
15201520
newBookingData["paid"] = originalRescheduledBooking.paid;
15211521
newBookingData["fromReschedule"] = originalRescheduledBooking.uid;
1522+
if (originalRescheduledBooking.uid) {
1523+
newBookingData.cancellationReason = rescheduleReason;
1524+
}
15221525
if (newBookingData.attendees?.createMany?.data) {
15231526
// Reschedule logic with booking with seats
15241527
if (eventType?.seatsPerTimeSlot && bookerEmail) {
@@ -1733,7 +1736,7 @@ async function handler(
17331736
...copyEvent,
17341737
additionalInformation: metadata,
17351738
additionalNotes, // Resets back to the additionalNote input and not the override value
1736-
cancellationReason: "$RCH$" + rescheduleReason ? rescheduleReason : "", // Removable code prefix to differentiate cancellation from rescheduling for email
1739+
cancellationReason: "$RCH$" + (rescheduleReason ? rescheduleReason : ""), // Removable code prefix to differentiate cancellation from rescheduling for email
17371740
});
17381741
}
17391742
}

packages/features/ee/workflows/api/scheduleEmailReminders.ts

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { NextApiRequest, NextApiResponse } from "next";
77
import dayjs from "@calcom/dayjs";
88
import { defaultHandler } from "@calcom/lib/server";
99
import prisma from "@calcom/prisma";
10-
import type { Prisma, WorkflowReminder } from "@calcom/prisma/client";
1110
import { bookingMetadataSchema } from "@calcom/prisma/zod-utils";
1211

1312
import type { VariablesType } from "../lib/reminders/templates/customTemplate";
@@ -31,7 +30,28 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
3130
return;
3231
}
3332

34-
//delete all scheduled email reminders where scheduled is past current date
33+
//delete batch_ids with already past scheduled date from scheduled_sends
34+
const remindersToDelete = await prisma.workflowReminder.findMany({
35+
where: {
36+
method: WorkflowMethods.EMAIL,
37+
cancelled: true,
38+
scheduledDate: {
39+
lte: dayjs().toISOString(),
40+
},
41+
},
42+
});
43+
44+
for (const reminder of remindersToDelete) {
45+
try {
46+
await client.request({
47+
url: `/v3/user/scheduled_sends/${reminder.referenceId}`,
48+
method: "DELETE",
49+
});
50+
} catch (error) {
51+
console.log(`Error deleting batch id from scheduled_sends: ${error}`);
52+
}
53+
}
54+
3555
await prisma.workflowReminder.deleteMany({
3656
where: {
3757
method: WorkflowMethods.EMAIL,
@@ -45,16 +65,15 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
4565
const remindersToCancel = await prisma.workflowReminder.findMany({
4666
where: {
4767
cancelled: true,
68+
scheduled: true, //if it is false then they are already cancelled
4869
scheduledDate: {
4970
lte: dayjs().add(1, "hour").toISOString(),
5071
},
5172
},
5273
});
5374

54-
try {
55-
const workflowRemindersToDelete: Prisma.Prisma__WorkflowReminderClient<WorkflowReminder, never>[] = [];
56-
57-
for (const reminder of remindersToCancel) {
75+
for (const reminder of remindersToCancel) {
76+
try {
5877
await client.request({
5978
url: "/v3/user/scheduled_sends",
6079
method: "POST",
@@ -64,17 +83,17 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
6483
},
6584
});
6685

67-
const workflowReminderToDelete = prisma.workflowReminder.delete({
86+
await prisma.workflowReminder.update({
6887
where: {
6988
id: reminder.id,
7089
},
90+
data: {
91+
scheduled: false, // to know which reminder already got cancelled (to avoid error from cancelling the same reminders again)
92+
},
7193
});
72-
73-
workflowRemindersToDelete.push(workflowReminderToDelete);
94+
} catch (error) {
95+
console.log(`Error cancelling scheduled Emails: ${error}`);
7496
}
75-
await Promise.all(workflowRemindersToDelete);
76-
} catch (error) {
77-
console.log(`Error cancelling scheduled Emails: ${error}`);
7897
}
7998

8099
//find all unscheduled Email reminders

packages/features/ee/workflows/components/WorkflowStepContainer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,7 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
409409
onChange={(val) => {
410410
const isAlreadyVerified = !!verifiedNumbers
411411
?.concat([])
412-
.find(
413-
(number) => number === form.getValues(`steps.${step.stepNumber - 1}.sendTo`)
414-
);
412+
.find((number) => number.replace(/\s/g, "") === val?.replace(/\s/g, ""));
415413
setNumberVerified(isAlreadyVerified);
416414
onChange(val);
417415
}}

0 commit comments

Comments
 (0)