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 <wollencarina@gmail.com> Co-authored-by: Alan <alannnc@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/5656/head^2
parent
c0f34a39d1
commit
38d8852819
|
@ -622,7 +622,7 @@ const BookingPage = ({
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
{/* TODO: Change name and id ="phone" to something generic */}
|
{/* TODO: Change name and id ="phone" to something generic */}
|
||||||
{AttendeeInput && (
|
{AttendeeInput && !disableInput && (
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<label
|
<label
|
||||||
htmlFor={
|
htmlFor={
|
||||||
|
@ -659,7 +659,6 @@ const BookingPage = ({
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
required
|
required
|
||||||
disabled={disableInput}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{bookingForm.formState.errors.phone && (
|
{bookingForm.formState.errors.phone && (
|
||||||
|
|
|
@ -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 { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { createEvent } from "ics";
|
import { createEvent } from "ics";
|
||||||
|
@ -298,6 +298,11 @@ export default function Success(props: SuccessProps) {
|
||||||
|
|
||||||
const locationToDisplay = getSuccessPageLocationMessage(location, t);
|
const locationToDisplay = getSuccessPageLocationMessage(location, t);
|
||||||
|
|
||||||
|
const hasSMSAttendeeAction =
|
||||||
|
eventType.workflows.find((workflowEventType) =>
|
||||||
|
workflowEventType.workflow.steps.find((step) => step.action === WorkflowActions.SMS_ATTENDEE)
|
||||||
|
) !== undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={isEmbed ? "" : "h-screen"} data-testid="success-page">
|
<div className={isEmbed ? "" : "h-screen"} data-testid="success-page">
|
||||||
{userIsOwner && !isEmbed && (
|
{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="mt-9 font-medium">{t("number_sms_notifications")}</div>
|
||||||
<div className="col-span-2 mb-2 mt-9">
|
<div className="col-span-2 mb-2 mt-9">
|
||||||
|
@ -777,6 +782,15 @@ const getEventTypesFromDB = async (id: number) => {
|
||||||
hideBranding: true,
|
hideBranding: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
workflows: {
|
||||||
|
select: {
|
||||||
|
workflow: {
|
||||||
|
select: {
|
||||||
|
steps: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
metadata: true,
|
metadata: true,
|
||||||
seatsPerTimeSlot: true,
|
seatsPerTimeSlot: true,
|
||||||
seatsShowAttendees: true,
|
seatsShowAttendees: true,
|
||||||
|
|
|
@ -153,7 +153,7 @@ export const extendedBookingCreateBody = bookingCreateBodySchema.merge(
|
||||||
allRecurringDates: z.string().array().optional(),
|
allRecurringDates: z.string().array().optional(),
|
||||||
currentRecurringIndex: z.number().optional(),
|
currentRecurringIndex: z.number().optional(),
|
||||||
rescheduleReason: z.string().optional(),
|
rescheduleReason: z.string().optional(),
|
||||||
smsReminderNumber: z.string().optional(),
|
smsReminderNumber: z.string().optional().nullable(),
|
||||||
appsStatus: z
|
appsStatus: z
|
||||||
.array(
|
.array(
|
||||||
z.object({
|
z.object({
|
||||||
|
|
Loading…
Reference in New Issue