Skip to content

Scheduling infrastructure for absolutely everyone.

fix: #15968 update to show booking question variables in Available variables (#15981)

Vijayc6febad364e6
diff --git a/apps/web/components/eventtype/CustomEventTypeModal.tsx b/apps/web/components/eventtype/CustomEventTypeModal.tsx
index 441f191301c..fc402984274 100644
--- a/apps/web/components/eventtype/CustomEventTypeModal.tsx
+++ b/apps/web/components/eventtype/CustomEventTypeModal.tsx
@@ -65,37 +65,51 @@ const CustomEventTypeModalForm: FC<CustomEventTypeModalFormProps> = (props) => {
<div className="pt-6 text-sm">
<div className="bg-subtle mb-6 rounded-md p-2">
<h1 className="text-emphasis mb-2 ml-1 font-medium">{t("available_variables")}</h1>
- <div className="mb-2.5 flex font-normal">
- <p className="text-subtle ml-1 mr-5 w-28">{`{Event type title}`}</p>
- <p className="text-emphasis">{t("event_name_info")}</p>
- </div>
- <div className="mb-2.5 flex font-normal">
- <p className="text-subtle ml-1 mr-5 w-28">{`{Organiser}`}</p>
- <p className="text-emphasis">{t("your_full_name")}</p>
- </div>
- <div className="mb-2.5 flex font-normal">
- <p className="text-subtle ml-1 mr-5 w-28">{`{Organiser first name}`}</p>
- <p className="text-emphasis">{t("organizer_first_name")}</p>
- </div>
- <div className="mb-2.5 flex font-normal">
- <p className="text-subtle ml-1 mr-5 w-28">{`{Scheduler}`}</p>
- <p className="text-emphasis">{t("scheduler_full_name")}</p>
- </div>
- {isNameFieldSplit && (
+ <div className="scroll-bar h-[216px] overflow-y-auto">
+ <div className="mb-2.5 flex font-normal">
+ <p className="text-subtle ml-1 mr-5 w-32">{`{Event type title}`}</p>
+ <p className="text-emphasis">{t("event_name_info")}</p>
+ </div>
+ <div className="mb-2.5 flex font-normal">
+ <p className="text-subtle ml-1 mr-5 w-32">{`{Organiser}`}</p>
+ <p className="text-emphasis">{t("your_full_name")}</p>
+ </div>
+ <div className="mb-2.5 flex font-normal">
+ <p className="text-subtle ml-1 mr-5 w-32">{`{Organiser first name}`}</p>
+ <p className="text-emphasis">{t("organizer_first_name")}</p>
+ </div>
<div className="mb-2.5 flex font-normal">
- <p className="text-subtle ml-1 mr-5 w-28">{`{Scheduler first name}`}</p>
- <p className="text-emphasis">{t("scheduler_first_name")}</p>
+ <p className="text-subtle ml-1 mr-5 w-32">{`{Scheduler}`}</p>
+ <p className="text-emphasis">{t("scheduler_full_name")}</p>
</div>
- )}
- {isNameFieldSplit && (
+ {isNameFieldSplit && (
+ <div className="mb-2.5 flex font-normal">
+ <p className="text-subtle ml-1 mr-5 w-32">{`{Scheduler first name}`}</p>
+ <p className="text-emphasis">{t("scheduler_first_name")}</p>
+ </div>
+ )}
+ {isNameFieldSplit && (
+ <div className="mb-2.5 flex font-normal">
+ <p className="text-subtle ml-1 mr-5 w-32">{`{Scheduler last name}`}</p>
+ <p className="text-emphasis">{t("scheduler_last_name")}</p>
+ </div>
+ )}
<div className="mb-2.5 flex font-normal">
- <p className="text-subtle ml-1 mr-5 w-28">{`{Scheduler last name}`}</p>
- <p className="text-emphasis">{t("scheduler_last_name")}</p>
+ <p className="text-subtle ml-1 mr-5 w-32">{`{Location}`}</p>
+ <p className="text-emphasis">{t("location_info")}</p>
</div>
- )}
- <div className="mb-1 flex font-normal">
- <p className="text-subtle ml-1 mr-5 w-28">{`{Location}`}</p>
- <p className="text-emphasis">{t("location_info")}</p>
+ {event.bookingFields && (
+ <p className="text-subtle mb-2 ml-1 font-medium">{t("booking_question_response_variables")}</p>
+ )}
+ {event.bookingFields &&
+ Object.keys(event.bookingFields).map((bookingfield, index) => (
+ <div key={index} className="mb-2.5 flex font-normal">
+ <p className="text-subtle ml-1 mr-5 w-32">{`{${bookingfield}}`}</p>
+ <p className="text-emphasis capitalize">
+ {event.bookingFields?.[bookingfield]?.toString()}
+ </p>
+ </div>
+ ))}
</div>
</div>
<h1 className="mb-2 text-[14px] font-medium leading-4">{t("preview")}</h1>
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index 1a48c8fed2e..af842cd995a 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -2501,5 +2501,6 @@
"event_expired": "This event is expired",
"skip_contact_creation": "Skip creating contacts if they do not exist in {{appName}} ",
"skip_writing_to_calendar_note": "If your ICS link is read-only (e.g., Proton Calendar), check the box above to avoid errors. You'll also need to manually update your calendar for changes.",
+ "booking_question_response_variables": "Booking question response variables",
"ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Add your new strings above here ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"
}