Scheduling infrastructure for absolutely everyone.
fix: Exclude location options for seated event (#15174)
Amit Sharma50eeb712e3a4
diff --git a/apps/web/components/eventtype/EventAdvancedTab.tsx b/apps/web/components/eventtype/EventAdvancedTab.tsxindex 4f0a777aa8a..c0cedaedc87 100644--- a/apps/web/components/eventtype/EventAdvancedTab.tsx+++ b/apps/web/components/eventtype/EventAdvancedTab.tsx@@ -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 supportedif (e) {diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsxindex f09bf48b978..90f70015020 100644--- a/apps/web/components/eventtype/EventSetupTab.tsx+++ b/apps/web/components/eventtype/EventSetupTab.tsx@@ -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>diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.jsonindex 99db111065a..7ffcf9f90f0 100644--- a/apps/web/public/static/locales/en/common.json+++ b/apps/web/public/static/locales/en/common.json@@ -163,6 +163,9 @@"link_expires": "p.s. It expires in {{expiresIn}} hours.","upgrade_to_per_seat": "Upgrade to Per-Seat","seat_options_doesnt_support_confirmation": "Seats option doesn't support confirmation requirement",+ "multilocation_doesnt_support_seats": "Multiple Locations doesn't support seats option",+ "no_show_fee_doesnt_support_seats": "No show fee doesn't support seats option",+ "seats_option_doesnt_support_multi_location" : "Seats option doesn't support Multiple Locations","team_upgrade_seats_details": "Of the {{memberCount}} members in your team, {{unpaidCount}} seat(s) are unpaid. At ${{seatPrice}}/month per seat the estimated total cost of your membership is ${{totalCost}}/month.","team_upgrade_banner_description": "You haven't finished your team setup. Your team \"{{teamName}}\" needs to be upgraded.","upgrade_banner_action": "Upgrade here",