Fix rescheduling error with attendee phone number as location (#5657)

* only show smsReminder number if event type has SMS_ATTENDEE action

* fix rescheduling bug

* Change array iteration to only run for best scenario

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Alan <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2022-11-23 22:30:54 +00:00
1 parent c0f34a39d1
commit 38d8852819
3 files changed
+18 -5

No files matched your search

@@ -622,7 +622,7 @@ const BookingPage = ({
)}
</>
{/* TODO: Change name and id ="phone" to something generic */}
{AttendeeInput && (
{AttendeeInput && !disableInput && (
<div className="mb-4">
<label
htmlFor={
@@ -659,7 +659,6 @@ const BookingPage = ({
: ""
}
required
disabled={disableInput}
/>
</div>
{bookingForm.formState.errors.phone && (
+16 -2
View File
@@ -1,4 +1,4 @@
import { BookingStatus } from "@prisma/client";
import { BookingStatus, WorkflowActions } from "@prisma/client";
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible";
import classNames from "classnames";
import { createEvent } from "ics";
@@ -298,6 +298,11 @@ export default function Success(props: SuccessProps) {
const locationToDisplay = getSuccessPageLocationMessage(location, t);
const hasSMSAttendeeAction =
eventType.workflows.find((workflowEventType) =>
workflowEventType.workflow.steps.find((step) => step.action === WorkflowActions.SMS_ATTENDEE)
) !== undefined;
return (
<div className={isEmbed ? "" : "h-screen"} data-testid="success-page">
{userIsOwner && !isEmbed && (
@@ -452,7 +457,7 @@ export default function Success(props: SuccessProps) {
</>
);
})}
{bookingInfo?.smsReminderNumber && (
{bookingInfo?.smsReminderNumber && hasSMSAttendeeAction && (
<>
<div className="mt-9 font-medium">{t("number_sms_notifications")}</div>
<div className="col-span-2 mb-2 mt-9">
@@ -777,6 +782,15 @@ const getEventTypesFromDB = async (id: number) => {
hideBranding: true,
},
},
workflows: {
select: {
workflow: {
select: {
steps: true,
},
},
},
},
metadata: true,
seatsPerTimeSlot: true,
seatsShowAttendees: true,
+1 -1
View File
@@ -153,7 +153,7 @@ export const extendedBookingCreateBody = bookingCreateBodySchema.merge(
allRecurringDates: z.string().array().optional(),
currentRecurringIndex: z.number().optional(),
rescheduleReason: z.string().optional(),
smsReminderNumber: z.string().optional(),
smsReminderNumber: z.string().optional().nullable(),
appsStatus: z
.array(
z.object({