diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 061157da3a..fa3e04544b 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -267,8 +267,6 @@ "guests": "Guests", "guest": "Guest", "web_conferencing_details_to_follow": "Web conferencing details to follow in the confirmation email.", - "confirmation":"Confirmation", - "what_booker_should_provide": "What your booker should provide to receive confirmations", "404_the_user": "The username", "username": "Username", "is_still_available": "is still available.", @@ -1712,8 +1710,6 @@ "show_available_seats_count": "Show the number of available seats", "how_booking_questions_as_variables": "How to use booking questions as variables?", "format": "Format", - "questions": "Questions", - "all_info_your_booker_provide": "All the info your booker should provide before booking with you.", "uppercase_for_letters": "Use uppercase for all letters", "replace_whitespaces_underscores": "Replace whitespaces with underscores", "platform_members": "Platform members", diff --git a/packages/features/bookings/lib/getBookingFields.ts b/packages/features/bookings/lib/getBookingFields.ts index 6fce4bc9ea..05c1d1bc35 100644 --- a/packages/features/bookings/lib/getBookingFields.ts +++ b/packages/features/bookings/lib/getBookingFields.ts @@ -160,22 +160,7 @@ export const ensureBookingInputsHaveSystemFields = ({ type: "email", name: "email", required: !isEmailFieldOptional, - editable: "system-but-optional", - sources: [ - { - label: "Default", - id: "default", - type: "default", - }, - ], - }, - { - defaultLabel: "phone_number", - type: "phone", - name: "attendeePhoneNumber", - required: false, - hidden: true, - editable: "system-but-optional", + editable: isOrgTeamEvent ? "system-but-optional" : "system", sources: [ { label: "Default", @@ -184,6 +169,7 @@ export const ensureBookingInputsHaveSystemFields = ({ }, ], }, + { defaultLabel: "location", type: "radioInput", @@ -218,6 +204,23 @@ export const ensureBookingInputsHaveSystemFields = ({ ], }, ]; + if (isOrgTeamEvent) { + systemBeforeFields.splice(2, 0, { + defaultLabel: "phone_number", + type: "phone", + name: "attendeePhoneNumber", + required: false, + hidden: true, + editable: "system-but-optional", + sources: [ + { + label: "Default", + id: "default", + type: "default", + }, + ], + }); + } // These fields should be added after other user fields const systemAfterFields: typeof bookingFields = [ diff --git a/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx b/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx index 253d12e3cd..62cc1e0e35 100644 --- a/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx +++ b/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx @@ -577,38 +577,27 @@ export const EventAdvancedTab = ({ /> )} -
-
-
- {t("booking_questions_title")} -
-

- {t("booking_questions_description")} -

-
-
- + { - // Location field has a default value at backend so API can send no location but we don't allow it in UI and thus we want to show it as required to user - return field.name === "location" ? true : field.required; - }} - /> -
+ }, + }} + shouldConsiderRequired={(field: BookingField) => { + // Location field has a default value at backend so API can send no location but we don't allow it in UI and thus we want to show it as required to user + return field.name === "location" ? true : field.required; + }} + />
-
-

{description}

- {showPhoneAndEmailToggle && ( - { - const phoneField = fields.find((field) => field.name === "attendeePhoneNumber"); - const emailField = fields.find((field) => field.name === "email"); - - if (phoneField && !phoneField.hidden && phoneField.required && !emailField?.required) { - return "phone"; - } - - return "email"; - })()} - options={[ - { - value: "email", - label: "Email", - iconLeft: , - }, - { - value: "phone", - label: "Phone", - iconLeft: , - }, - ]} - onValueChange={(value) => { - const phoneFieldIndex = fields.findIndex((field) => field.name === "attendeePhoneNumber"); - const emailFieldIndex = fields.findIndex((field) => field.name === "email"); - if (value === "email") { - update(emailFieldIndex, { - ...fields[emailFieldIndex], - hidden: false, - required: true, - }); - update(phoneFieldIndex, { - ...fields[phoneFieldIndex], - hidden: true, - required: false, - }); - } else if (value === "phone") { - update(emailFieldIndex, { - ...fields[emailFieldIndex], - hidden: true, - required: false, - }); - update(phoneFieldIndex, { - ...fields[phoneFieldIndex], - hidden: false, - required: true, - }); - } - }} - /> - )} -
-

- {t("questions")} -

-

- {t("all_info_your_booker_provide")} -

+

{description}