Scheduling infrastructure for absolutely everyone.
fix: email displayed as organizer eventtype settings (#14102)
Amit Sharma5aa922559aba
diff --git a/apps/web/components/eventtype/EventAdvancedTab.tsx b/apps/web/components/eventtype/EventAdvancedTab.tsxindex caee60c5cc2..1ee0e6e70fe 100644--- a/apps/web/components/eventtype/EventAdvancedTab.tsx+++ b/apps/web/components/eventtype/EventAdvancedTab.tsx@@ -1,6 +1,5 @@import { InfoIcon } from "lucide-react";import dynamic from "next/dynamic";-import Link from "next/link";import type { EventTypeSetupProps } from "pages/event-types/[type]";import { useEffect, useState } from "react";import { Controller, useFormContext } from "react-hook-form";@@ -20,6 +19,7 @@ import { FormBuilder } from "@calcom/features/form-builder/FormBuilder";import type { EditableSchema } from "@calcom/features/form-builder/schema";import { BookerLayoutSelector } from "@calcom/features/settings/BookerLayoutSelector";import { classNames } from "@calcom/lib";+import cx from "@calcom/lib/classNames";import { APP_NAME, IS_VISUAL_REGRESSION_TESTING, WEBSITE_URL } from "@calcom/lib/constants";import { generateHashedLink } from "@calcom/lib/generateHashedLink";import { useLocale } from "@calcom/lib/hooks/useLocale";@@ -148,96 +148,89 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,* This will fallback to each user selected destination calendar.*/}<div className="border-subtle space-y-6 rounded-lg border p-6">- {displayDestinationCalendarSelector && (- <div className="flex flex-col">- <div className="flex justify-between">- <div>- <Label className="text-emphasis mb-0 font-medium">{t("add_to_calendar")}</Label>- </div>- <Link- href="/apps/categories/calendar"- target="_blank"- className="hover:text-emphasis text-default text-sm">- {t("add_another_calendar")}- </Link>+ <div className="flex flex-col space-y-4 lg:flex-row lg:space-x-4 lg:space-y-0">+ {displayDestinationCalendarSelector && (+ <div className="flex w-full flex-col">+ <Label className="text-emphasis mb-0 font-medium">{t("add_to_calendar")}</Label>+ <Controller+ name="destinationCalendar"+ render={({ field: { onChange, value } }) => (+ <DestinationCalendarSelector+ value={value ? value.externalId : undefined}+ onChange={onChange}+ hidePlaceholder+ hideAdvancedText+ />+ )}+ />+ <p className="text-subtle text-sm">{t("select_which_cal")}</p></div>- <Controller- name="destinationCalendar"- render={({ field: { onChange, value } }) => (- <DestinationCalendarSelector- value={value ? value.externalId : undefined}- onChange={onChange}- hidePlaceholder- hideAdvancedText- />- )}- />- <p className="text-subtle text-sm">{t("select_which_cal")}</p>- </div>- )}- <div className="w-full">- <TextField- label={t("event_name_in_calendar")}- type="text"- {...shouldLockDisableProps("eventName")}- placeholder={eventNamePlaceholder}- {...formMethods.register("eventName")}- addOnSuffix={- <Button- color="minimal"- size="sm"- {...(shouldLockDisableProps("eventName").disabled ? { disabled: true } : {})}- aria-label="edit custom name"- className="hover:stroke-3 hover:text-emphasis min-w-fit !py-0 px-0 hover:bg-transparent"- onClick={() => setShowEventNameTip((old) => !old)}>- <Edit className="h-4 w-4" />- </Button>- }- />- </div>- {displayDestinationCalendarSelector && (- <div className="w-full">- <Switch- tooltip={t("reconnect_calendar_to_use")}- label={- <>- {t("display_add_to_calendar_organizer")}- <InfoIcon className="text-default hover:text-attention hover:bg-attention ms-1 inline h-4 w-4 rounded-md" />- </>- }- checked={useEventTypeDestinationCalendarEmail}- onCheckedChange={(val) => {- setUseEventTypeDestinationCalendarEmail(val);- formMethods.setValue("useEventTypeDestinationCalendarEmail", val, { shouldDirty: true });- if (val) {- showToast(t("reconnect_calendar_to_use"), "warning");- }- }}- />- </div>- )}- {!useEventTypeDestinationCalendarEmail && verifiedSecondaryEmails.length > 1 && !team && (+ )}<div className="w-full">- <SelectField- label={t("send_event_details_to")}- placeholder={- selectedSecondaryEmailId === -1 && (- <span className="text-default min-w-0 overflow-hidden truncate whitespace-nowrap">- <Badge variant="blue">{t("default")}</Badge> {user?.email || ""}- </span>- )- }- onChange={(option) =>- formMethods.setValue("secondaryEmailId", option?.value, { shouldDirty: true })+ <TextField+ label={t("event_name_in_calendar")}+ type="text"+ {...shouldLockDisableProps("eventName")}+ placeholder={eventNamePlaceholder}+ {...formMethods.register("eventName")}+ addOnSuffix={+ <Button+ color="minimal"+ size="sm"+ aria-label="edit custom name"+ className="hover:stroke-3 hover:text-emphasis min-w-fit !py-0 px-0 hover:bg-transparent"+ onClick={() => setShowEventNameTip((old) => !old)}>+ <Edit className="h-4 w-4" />+ </Button>}- value={verifiedSecondaryEmails.find(- (secondaryEmail) =>- selectedSecondaryEmailId !== -1 && secondaryEmail.value === selectedSecondaryEmailId- )}- options={verifiedSecondaryEmails}/></div>- )}+ </div>+ <div className="space-y-2">+ {displayDestinationCalendarSelector && (+ <div className="w-full">+ <Switch+ tooltip={t("if_enabled_email_address_as_organizer")}+ label={+ <>+ {t("display_add_to_calendar_organizer")}+ <InfoIcon className="text-default hover:text-attention hover:bg-attention ms-1 inline h-4 w-4 rounded-md" />+ </>+ }+ checked={useEventTypeDestinationCalendarEmail}+ onCheckedChange={(val) => {+ setUseEventTypeDestinationCalendarEmail(val);+ formMethods.setValue("useEventTypeDestinationCalendarEmail", val, { shouldDirty: true });+ if (val) {+ showToast(t("reconnect_calendar_to_use"), "warning");+ }+ }}+ />+ </div>+ )}+ {!useEventTypeDestinationCalendarEmail && verifiedSecondaryEmails.length > 0 && !team && (+ <div className={cx("flex w-full flex-col", displayDestinationCalendarSelector && "pl-11")}>+ <SelectField+ placeholder={+ selectedSecondaryEmailId === -1 && (+ <span className="text-default min-w-0 overflow-hidden truncate whitespace-nowrap">+ <Badge variant="blue">{t("default")}</Badge> {user?.email || ""}+ </span>+ )+ }+ onChange={(option) =>+ formMethods.setValue("secondaryEmailId", option?.value, { shouldDirty: true })+ }+ value={verifiedSecondaryEmails.find(+ (secondaryEmail) =>+ selectedSecondaryEmailId !== -1 && secondaryEmail.value === selectedSecondaryEmailId+ )}+ options={verifiedSecondaryEmails}+ />+ <p className="text-subtle mt-2 text-sm">{t("display_email_as_organizer")}</p>+ </div>+ )}+ </div></div><BookerLayoutSelector fallbackToUserSettings isDark={selectedThemeIsDark} isOuterBorder={true} /><div className="border-subtle space-y-6 rounded-lg border p-6">diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.jsonindex 02b88085890..3acc201ff62 100644--- a/apps/web/public/static/locales/en/common.json+++ b/apps/web/public/static/locales/en/common.json@@ -804,14 +804,16 @@"add_attendees": "Add attendees","show_advanced_settings": "Show advanced settings","event_name": "Event Name",- "event_name_in_calendar": "Event name in calendar",+ "event_name_in_calendar": "With event name","event_name_tooltip": "The name that will appear in calendars","meeting_with_user": "{Event type title} between {Organiser} & {Scheduler}","additional_inputs": "Additional Inputs","additional_input_description": "Require scheduler to input additional inputs prior the booking is confirmed","label": "Label","placeholder": "Placeholder",- "display_add_to_calendar_organizer": "Display 'Add to calendar' email as the organizer",+ "display_add_to_calendar_organizer":"Use \"Add to calendar\" email as the organizer",+ "display_email_as_organizer": "We'll display this email address as the organizer, and send confirmation emails here.",+ "if_enabled_email_address_as_organizer": "If enabled, we'll display the email address from your \"Add to calendar\" as organizer and send confirmation emails there","reconnect_calendar_to_use": "Please note that you may need to disconnect and then reconnect your 'Add to Calendar' account to use this feature.","type": "Type","edit": "Edit",@@ -1316,7 +1318,7 @@"event_setup_multiple_duration_default_error": "Event Setup: Please select a valid default duration.","event_setup_booking_limits_error": "Booking limits must be in ascending order. [day, week, month, year]","event_setup_duration_limits_error": "Duration limits must be in ascending order. [day, week, month, year]",- "select_which_cal": "Select which calendar to add bookings to",+ "select_which_cal": "The calendar to add bookings to","custom_event_name": "Custom event name","custom_event_name_description": "Create customised event names to display on calendar event","2fa_required": "Two factor authentication required",diff --git a/packages/features/calendars/DestinationCalendarSelector.tsx b/packages/features/calendars/DestinationCalendarSelector.tsxindex 1d75a173190..b4cc86e803b 100644--- a/packages/features/calendars/DestinationCalendarSelector.tsx+++ b/packages/features/calendars/DestinationCalendarSelector.tsx@@ -126,7 +126,9 @@ const DestinationCalendarSelector = ({const queryDestinationCalendar = query.data.destinationCalendar;return (- <div className="relative" title={`${t("create_events_on")}: ${selectedOption?.label || ""}`}>+ <div+ className="relative table w-full table-fixed"+ title={`${t("create_events_on")}: ${selectedOption?.label || ""}`}><Selectname="primarySelectedCalendar"placeholder={