fix: Exclude location options for seated event (#15174)
Co-authored-by: Somay Chauhan <[email protected]> Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
3 files changed
+15
-1
No files matched your search
@@ -82,6 +82,7 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
|
||||
);
|
||||
const placeholderHashedLink = `${WEBSITE_URL}/d/${hashedUrl}/${formMethods.getValues("slug")}`;
|
||||
const seatsEnabled = formMethods.watch("seatsPerTimeSlotEnabled");
|
||||
const multiLocation = (formMethods.getValues("locations") || []).length > 1;
|
||||
const noShowFeeEnabled =
|
||||
formMethods.getValues("metadata")?.apps?.stripe?.enabled === true &&
|
||||
formMethods.getValues("metadata")?.apps?.stripe?.paymentOption === "HOLD";
|
||||
@@ -434,7 +435,14 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
|
||||
{...seatsLocked}
|
||||
description={t("offer_seats_description")}
|
||||
checked={value}
|
||||
disabled={noShowFeeEnabled}
|
||||
disabled={noShowFeeEnabled || multiLocation}
|
||||
tooltip={
|
||||
multiLocation
|
||||
? t("multilocation_doesnt_support_seats")
|
||||
: noShowFeeEnabled
|
||||
? t("no_show_fee_doesnt_support_seats")
|
||||
: undefined
|
||||
}
|
||||
onCheckedChange={(e) => {
|
||||
// Enabling seats will disable guests and requiring confirmation until fully supported
|
||||
if (e) {
|
||||
|
||||
@@ -158,6 +158,7 @@ export const EventSetupTab = (
|
||||
|
||||
const [animationRef] = useAutoAnimate<HTMLUListElement>();
|
||||
|
||||
const seatsEnabled = formMethods.getValues("seatsPerTimeSlotEnabled");
|
||||
const validLocations = formMethods.getValues("locations").filter((location) => {
|
||||
const eventLocation = getEventLocationType(location.type);
|
||||
if (!eventLocation) {
|
||||
@@ -444,6 +445,8 @@ export const EventSetupTab = (
|
||||
data-testid="add-location"
|
||||
StartIcon="plus"
|
||||
color="minimal"
|
||||
disabled={seatsEnabled}
|
||||
tooltip={seatsEnabled ? t("seats_option_doesnt_support_multi_location") : undefined}
|
||||
onClick={() => setShowEmptyLocationSelect(true)}>
|
||||
{t("add_location")}
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user