fix: Unable to modify the location of a booking when rescheduling (#11651)
parent
e2414b174a
commit
19eced00f5
|
@ -115,6 +115,13 @@ export default function Success(props: SuccessProps) {
|
||||||
const tz = props.tz ? props.tz : isSuccessBookingPage && attendeeTimeZone ? attendeeTimeZone : timeZone();
|
const tz = props.tz ? props.tz : isSuccessBookingPage && attendeeTimeZone ? attendeeTimeZone : timeZone();
|
||||||
|
|
||||||
const location = props.bookingInfo.location as ReturnType<typeof getEventLocationValue>;
|
const location = props.bookingInfo.location as ReturnType<typeof getEventLocationValue>;
|
||||||
|
let rescheduleLocation: string | undefined;
|
||||||
|
if (
|
||||||
|
typeof props.bookingInfo.responses.location === "object" &&
|
||||||
|
"optionValue" in props.bookingInfo.responses.location
|
||||||
|
) {
|
||||||
|
rescheduleLocation = props.bookingInfo.responses.location.optionValue;
|
||||||
|
}
|
||||||
|
|
||||||
const locationVideoCallUrl: string | undefined = bookingMetadataSchema.parse(
|
const locationVideoCallUrl: string | undefined = bookingMetadataSchema.parse(
|
||||||
props?.bookingInfo?.metadata || {}
|
props?.bookingInfo?.metadata || {}
|
||||||
|
@ -295,7 +302,14 @@ export default function Success(props: SuccessProps) {
|
||||||
bookingInfo.status
|
bookingInfo.status
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const rescheduleLocationToDisplay = getSuccessPageLocationMessage(
|
||||||
|
rescheduleLocation ?? "",
|
||||||
|
t,
|
||||||
|
bookingInfo.status
|
||||||
|
);
|
||||||
|
|
||||||
const providerName = guessEventLocationType(location)?.label;
|
const providerName = guessEventLocationType(location)?.label;
|
||||||
|
const rescheduleProviderName = guessEventLocationType(rescheduleLocation)?.label;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={isEmbed ? "" : "h-screen"} data-testid="success-page">
|
<div className={isEmbed ? "" : "h-screen"} data-testid="success-page">
|
||||||
|
@ -467,18 +481,50 @@ export default function Success(props: SuccessProps) {
|
||||||
<>
|
<>
|
||||||
<div className="mt-3 font-medium">{t("where")}</div>
|
<div className="mt-3 font-medium">{t("where")}</div>
|
||||||
<div className="col-span-2 mt-3" data-testid="where">
|
<div className="col-span-2 mt-3" data-testid="where">
|
||||||
{locationToDisplay.startsWith("http") ? (
|
{!rescheduleLocation || locationToDisplay === rescheduleLocationToDisplay ? (
|
||||||
|
locationToDisplay.startsWith("http") ? (
|
||||||
<a
|
<a
|
||||||
href={locationToDisplay}
|
href={locationToDisplay}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
title={locationToDisplay}
|
title={locationToDisplay}
|
||||||
className="text-default flex items-center gap-2 underline"
|
className="text-default flex items-center gap-2"
|
||||||
rel="noreferrer">
|
rel="noreferrer">
|
||||||
{providerName || "Link"}
|
{providerName || "Link"}
|
||||||
<ExternalLink className="text-default inline h-4 w-4" />
|
<ExternalLink className="text-default inline h-4 w-4" />
|
||||||
</a>
|
</a>
|
||||||
) : (
|
) : (
|
||||||
locationToDisplay
|
locationToDisplay
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{!!formerTime &&
|
||||||
|
(locationToDisplay.startsWith("http") ? (
|
||||||
|
<a
|
||||||
|
href={locationToDisplay}
|
||||||
|
target="_blank"
|
||||||
|
title={locationToDisplay}
|
||||||
|
className="text-default flex items-center gap-2 line-through"
|
||||||
|
rel="noreferrer">
|
||||||
|
{providerName || "Link"}
|
||||||
|
<ExternalLink className="text-default inline h-4 w-4" />
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<p className="line-through">{locationToDisplay}</p>
|
||||||
|
))}
|
||||||
|
{rescheduleLocationToDisplay.startsWith("http") ? (
|
||||||
|
<a
|
||||||
|
href={rescheduleLocationToDisplay}
|
||||||
|
target="_blank"
|
||||||
|
title={rescheduleLocationToDisplay}
|
||||||
|
className="text-default flex items-center gap-2"
|
||||||
|
rel="noreferrer">
|
||||||
|
{rescheduleProviderName || "Link"}
|
||||||
|
<ExternalLink className="text-default inline h-4 w-4" />
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
rescheduleLocationToDisplay
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -77,6 +77,13 @@ export const BookingFields = ({
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Attendee location field can be edited during reschedule
|
||||||
|
if (field.name === SystemField.Enum.location) {
|
||||||
|
if (locationResponse?.value === "attendeeInPerson" || "phone") {
|
||||||
|
readOnly = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Dynamically populate location field options
|
// Dynamically populate location field options
|
||||||
if (field.name === SystemField.Enum.location && field.type === "radioInput") {
|
if (field.name === SystemField.Enum.location && field.type === "radioInput") {
|
||||||
if (!field.optionsInputs) {
|
if (!field.optionsInputs) {
|
||||||
|
|
Loading…
Reference in New Issue