Scheduling infrastructure for absolutely everyone.
Reformat /booking attendees, add guests to success page, fix i18n (#5532)
Alex van Andel0402e4632867
diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsxindex 7819faa307f..48692cf6e81 100644--- a/apps/web/components/booking/BookingListItem.tsx+++ b/apps/web/components/booking/BookingListItem.tsx@@ -471,8 +471,9 @@ const FirstAttendee = ({user: UserProps;currentEmail: string | null | undefined;}) => {+ const { t } = useLocale();return user.email === currentEmail ? (- <div className="inline-block">You</div>+ <div className="inline-block">{t("you")}</div>) : (<akey={user.email}@@ -484,19 +485,19 @@ const FirstAttendee = ({);};-const Attendee: React.FC<{ email: string; children: React.ReactNode }> = ({ email, children }) => {+type AttendeeProps = {+ name?: string;+ email: string;+};++const Attendee = ({ email, name }: AttendeeProps) => {return (- <a className=" hover:text-blue-500" href={"mailto:" + email} onClick={(e) => e.stopPropagation()}>- {children}+ <a className="hover:text-blue-500" href={"mailto:" + email} onClick={(e) => e.stopPropagation()}>+ {name || email}</a>);};-interface AttendeeProps {- name: string;- email: string;-}-const DisplayAttendees = ({attendees,user,@@ -504,42 +505,33 @@ const DisplayAttendees = ({}: {attendees: AttendeeProps[];user: UserProps | null;- currentEmail: string | null | undefined;+ currentEmail?: string | null;}) => {- if (attendees.length === 1) {- return (- <div className="text-sm text-gray-900">- {user && <FirstAttendee user={user} currentEmail={currentEmail} />}- <span> and </span>- <Attendee email={attendees[0].email}>{attendees[0].name}</Attendee>- </div>- );- } else if (attendees.length === 2) {- return (- <div className="text-sm text-gray-900">- {user && <FirstAttendee user={user} currentEmail={currentEmail} />}- <span>, </span>- <Attendee email={attendees[0].email}>{attendees[0].name}</Attendee>- <div className="inline-block text-sm text-gray-900"> and </div>- <Attendee email={attendees[1].email}>{attendees[1].name}</Attendee>- </div>- );- } else {- return (- <div className="text-sm text-gray-900">- {user && <FirstAttendee user={user} currentEmail={currentEmail} />}- <span>, </span>- <Attendee email={attendees[0].email}>{attendees[0].name}</Attendee>- <span> & </span>- <Tooltip- content={attendees.slice(1).map((attendee, key) => (- <p key={key}>{attendee.name}</p>- ))}>- <div className="inline-block">{attendees.length - 1} more</div>- </Tooltip>- </div>- );- }+ const { t } = useLocale();+ return (+ <div className="text-sm text-gray-900">+ {user && <FirstAttendee user={user} currentEmail={currentEmail} />}+ {attendees.length > 1 ? <span>, </span> : <span> {t("and")} </span>}+ <Attendee {...attendees[0]} />+ {attendees.length > 1 && (+ <>+ <div className="inline-block text-sm text-gray-900"> {t("and")} </div>+ {attendees.length > 2 ? (+ <Tooltip+ content={attendees.slice(1).map((attendee) => (+ <p key={attendee.email}>+ <Attendee {...attendee} />+ </p>+ ))}>+ <div className="inline-block">{t("plus_more", { count: attendees.length - 1 })}</div>+ </Tooltip>+ ) : (+ <Attendee {...attendees[1]} />+ )}+ </>+ )}+ </div>+ );};const Tag = ({ children, className = "" }: React.PropsWithChildren<{ className?: string }>) => {diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsxindex 254ce386e50..944786dc387 100644--- a/apps/web/components/booking/pages/BookingPage.tsx+++ b/apps/web/components/booking/pages/BookingPage.tsx@@ -515,7 +515,7 @@ const BookingPage = ({<p key={key}>{timeFormatted}</p>))}><p className="dark:text-darkgray-600 text-sm">- {t("plus_more", { count: recurringStrings.length - 5 })}+ + {t("plus_more", { count: recurringStrings.length - 5 })}</p></Tooltip></div>diff --git a/apps/web/pages/cancel/[uid].tsx b/apps/web/pages/cancel/[uid].tsxindex 43fd77cecd3..467c93d3b4b 100644--- a/apps/web/pages/cancel/[uid].tsx+++ b/apps/web/pages/cancel/[uid].tsx@@ -110,7 +110,7 @@ export default function Type(props: inferSSRProps<typeof getServerSideProps>) {"-ml-4 block w-full text-center",moreEventsVisible ? "hidden" : "")}>- {t("plus_more", { count: props.recurringInstances.length - 1 })}+ + {t("plus_more", { count: props.recurringInstances.length - 1 })}</CollapsibleTrigger><CollapsibleContent>{props.booking?.eventType.recurringEvent?.count &&diff --git a/apps/web/pages/success.tsx b/apps/web/pages/success.tsxindex 5fb9fa8172b..47858b61902 100644--- a/apps/web/pages/success.tsx+++ b/apps/web/pages/success.tsx@@ -369,9 +369,9 @@ export default function Success(props: SuccessProps) {<p className="text-bookinglight">{bookingInfo.user.email}</p></div>)}- {bookingInfo?.attendees.map((attendee, index) => (+ {bookingInfo?.attendees.map((attendee) => (<div key={attendee.name} className="mb-3 last:mb-0">- <p>{attendee.name}</p>+ {attendee.name && <p>{attendee.name}</p>}<p className="text-bookinglight">{attendee.email}</p></div>))}@@ -667,7 +667,7 @@ export function RecurringBookings({<CollapsibleTriggertype="button"className={classNames("flex w-full", moreEventsVisible ? "hidden" : "")}>- {t("plus_more", { count: recurringBookingsSorted.length - 4 })}+ + {t("plus_more", { count: recurringBookingsSorted.length - 4 })}</CollapsibleTrigger><CollapsibleContent>{eventType.recurringEvent?.count &&@@ -738,6 +738,7 @@ const getEventTypesFromDB = async (id: number) => {},},metadata: true,+ seatsPerTimeSlot: true,seatsShowAttendees: true,},});@@ -777,7 +778,7 @@ const schema = z.object({const handleSeatsEventTypeOnBooking = (eventType: {- seatsPerTimeSlot?: boolean | null;+ seatsPerTimeSlot?: number | null;seatsShowAttendees: boolean | null;[x: string | number | symbol]: unknown;},@@ -789,6 +790,8 @@ const handleSeatsEventTypeOnBooking = (if (eventType?.seatsPerTimeSlot !== null) {// @TODO: right now bookings with seats doesn't save every description that its entered by every userdelete booking.description;+ } else {+ return;}if (!eventType.seatsShowAttendees) {const attendee = booking?.attendees?.find((a) => a.email === email);@@ -895,6 +898,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {},},});+if (bookingInfo !== null && email) {handleSeatsEventTypeOnBooking(eventType, bookingInfo, email);}diff --git a/apps/web/public/static/locales/ar/common.json b/apps/web/public/static/locales/ar/common.jsonindex 8cf50926d6a..b341565b863 100644--- a/apps/web/public/static/locales/ar/common.json+++ b/apps/web/public/static/locales/ar/common.json@@ -597,7 +597,7 @@"monthly_other": "أشهر","yearly_one": "سنة","yearly_other": "سنوات",- "plus_more": "+ {{count}} أكثر",+ "plus_more": "{{count}} أكثر","max": "الحد الأقصى","single_theme": "سمة واحدة","brand_color": "لون العلامة التجارية",diff --git a/apps/web/public/static/locales/cs/common.json b/apps/web/public/static/locales/cs/common.jsonindex ee403f7a42a..fdf0bccd836 100644--- a/apps/web/public/static/locales/cs/common.json+++ b/apps/web/public/static/locales/cs/common.json@@ -597,7 +597,7 @@"monthly_other": "měs.","yearly_one": "rok","yearly_other": "roky/let",- "plus_more": "+ ještě {{count}}",+ "plus_more": "ještě {{count}}","max": "Max.","single_theme": "Jednotná šablona","brand_color": "Barva značky",diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.jsonindex 021c6813caa..f45f99f7c5f 100644--- a/apps/web/public/static/locales/en/common.json+++ b/apps/web/public/static/locales/en/common.json@@ -599,7 +599,7 @@"monthly_other": "months","yearly_one": "year","yearly_other": "years",- "plus_more": "+ {{count}} more",+ "plus_more": "{{count}} more","max": "Max","single_theme": "Single Theme","brand_color": "Brand Color",diff --git a/apps/web/public/static/locales/es/common.json b/apps/web/public/static/locales/es/common.jsonindex 4d5751ea5c2..1a0cb24e780 100644--- a/apps/web/public/static/locales/es/common.json+++ b/apps/web/public/static/locales/es/common.json@@ -596,7 +596,7 @@"monthly_other": "meses","yearly_one": "año","yearly_other": "años",- "plus_more": "+ {{count}} más",+ "plus_more": "{{count}} más","max": "Máx.","single_theme": "Tema","brand_color": "Color de marca",diff --git a/apps/web/public/static/locales/fr/common.json b/apps/web/public/static/locales/fr/common.jsonindex fe9e5aba5c2..313897563b1 100644--- a/apps/web/public/static/locales/fr/common.json+++ b/apps/web/public/static/locales/fr/common.json@@ -596,7 +596,7 @@"monthly_other": "mois","yearly_one": "année","yearly_other": "années",- "plus_more": "+ {{count}} de plus",+ "plus_more": "{{count}} de plus","max": "Max.","single_theme": "Thème unique","brand_color": "Couleur de la marque",diff --git a/apps/web/public/static/locales/it/common.json b/apps/web/public/static/locales/it/common.jsonindex fa8d1be91e6..28af07fdfcd 100644--- a/apps/web/public/static/locales/it/common.json+++ b/apps/web/public/static/locales/it/common.json@@ -596,7 +596,7 @@"monthly_other": "mesi","yearly_one": "anno","yearly_other": "anni",- "plus_more": "+ altri {{count}}",+ "plus_more": "altri {{count}}","max": "Max","single_theme": "Tema Singolo","brand_color": "Colore del Marchio",diff --git a/apps/web/public/static/locales/ja/common.json b/apps/web/public/static/locales/ja/common.jsonindex a8ff7f19b7b..55cdc55bfdb 100644--- a/apps/web/public/static/locales/ja/common.json+++ b/apps/web/public/static/locales/ja/common.json@@ -596,7 +596,7 @@"monthly_other": "月","yearly_one": "年","yearly_other": "年",- "plus_more": "+ {{count}} 回以上",+ "plus_more": "{{count}} 回以上","max": "最大","single_theme": "シングルテーマ","brand_color": "ブランドカラー",diff --git a/apps/web/public/static/locales/ko/common.json b/apps/web/public/static/locales/ko/common.jsonindex 02cd36d742e..451013b6865 100644--- a/apps/web/public/static/locales/ko/common.json+++ b/apps/web/public/static/locales/ko/common.json@@ -596,7 +596,7 @@"monthly_other": "개월","yearly_one": "년","yearly_other": "년",- "plus_more": "+ {{count}} 이상",+ "plus_more": "{{count}} 이상","max": "최대","single_theme": "단일 테마","brand_color": "브랜드 색상",diff --git a/apps/web/public/static/locales/nl/common.json b/apps/web/public/static/locales/nl/common.jsonindex 636932e382e..f88566dd9b6 100644--- a/apps/web/public/static/locales/nl/common.json+++ b/apps/web/public/static/locales/nl/common.json@@ -596,7 +596,7 @@"monthly_other": "maanden","yearly_one": "jaar","yearly_other": "jaar",- "plus_more": "Nog {{count}}",+ "plus_more": "{{count}} meer","max": "Max.","single_theme": "Enkel Thema","brand_color": "Merkkleur",diff --git a/apps/web/public/static/locales/pl/common.json b/apps/web/public/static/locales/pl/common.jsonindex fc123cb9f55..f92cedd28fb 100644--- a/apps/web/public/static/locales/pl/common.json+++ b/apps/web/public/static/locales/pl/common.json@@ -596,7 +596,7 @@"monthly_other": "miesiące","yearly_one": "rok","yearly_other": "lata",- "plus_more": "+ {{count}} więcej",+ "plus_more": "{{count}} więcej","max": "Maks.","single_theme": "Pojedynczy motyw","brand_color": "Kolor Marki",diff --git a/apps/web/public/static/locales/pt-BR/common.json b/apps/web/public/static/locales/pt-BR/common.jsonindex 31b22644cd4..5520252d5f7 100644--- a/apps/web/public/static/locales/pt-BR/common.json+++ b/apps/web/public/static/locales/pt-BR/common.json@@ -596,7 +596,7 @@"monthly_other": "meses","yearly_one": "ano","yearly_other": "anos",- "plus_more": "+ {{count}} mais",+ "plus_more": "{{count}} mais","max": "Máx","single_theme": "Tema","brand_color": "Cor da Marca",diff --git a/apps/web/public/static/locales/pt/common.json b/apps/web/public/static/locales/pt/common.jsonindex 470f73eb2da..ee8767a2c7a 100644--- a/apps/web/public/static/locales/pt/common.json+++ b/apps/web/public/static/locales/pt/common.json@@ -596,7 +596,7 @@"monthly_other": "meses","yearly_one": "ano","yearly_other": "anos",- "plus_more": "+ {{count}} mais",+ "plus_more": "{{count}} mais","max": "Máximo","single_theme": "Tema","brand_color": "Cor da marca",diff --git a/apps/web/public/static/locales/ro/common.json b/apps/web/public/static/locales/ro/common.jsonindex 5fbe4d787ef..6ceba4b8502 100644--- a/apps/web/public/static/locales/ro/common.json+++ b/apps/web/public/static/locales/ro/common.json@@ -596,7 +596,7 @@"monthly_other": "luni","yearly_one": "an","yearly_other": "ani",- "plus_more": "+ încă {{count}}",+ "plus_more": "încă {{count}}","max": "Max.","single_theme": "Temă unică","brand_color": "Culoare marcă",diff --git a/apps/web/public/static/locales/ru/common.json b/apps/web/public/static/locales/ru/common.jsonindex 305410ea0d9..7f449fb4d4e 100644--- a/apps/web/public/static/locales/ru/common.json+++ b/apps/web/public/static/locales/ru/common.json@@ -596,7 +596,7 @@"monthly_other": "мес.","yearly_one": "год","yearly_other": "г.",- "plus_more": "+ еще {{count}}",+ "plus_more": "еще {{count}}","max": "Макс.","single_theme": "Тема оформления","brand_color": "Цвет бренда",diff --git a/apps/web/public/static/locales/sr/common.json b/apps/web/public/static/locales/sr/common.jsonindex 4c439e5d0ef..3d52f54cf81 100644--- a/apps/web/public/static/locales/sr/common.json+++ b/apps/web/public/static/locales/sr/common.json@@ -597,7 +597,7 @@"monthly_other": "meseci","yearly_one": "godinu","yearly_other": "godina",- "plus_more": "+ još {{count}}",+ "plus_more": "još {{count}}","max": "Maks.","single_theme": "Tema","brand_color": "Boja brenda",diff --git a/apps/web/public/static/locales/sv/common.json b/apps/web/public/static/locales/sv/common.jsonindex 6d4960fe8bf..025d13aa656 100644--- a/apps/web/public/static/locales/sv/common.json+++ b/apps/web/public/static/locales/sv/common.json@@ -596,7 +596,7 @@"monthly_other": "månader","yearly_one": "år","yearly_other": "år",- "plus_more": "+ {{count}} till",+ "plus_more": "{{count}} till","max": "Max","single_theme": "Ett tema","brand_color": "Primär färg",diff --git a/apps/web/public/static/locales/tr/common.json b/apps/web/public/static/locales/tr/common.jsonindex 4710c195424..7eabeda97d9 100644--- a/apps/web/public/static/locales/tr/common.json+++ b/apps/web/public/static/locales/tr/common.json@@ -597,7 +597,7 @@"monthly_other": "ay","yearly_one": "yıl","yearly_other": "yıl",- "plus_more": "+ {{count}} tane daha",+ "plus_more": "{{count}} tane daha","max": "Maks.","single_theme": "Tek Tema","brand_color": "Marka Rengi",diff --git a/apps/web/public/static/locales/vi/common.json b/apps/web/public/static/locales/vi/common.jsonindex 3890439ea0f..d00cb9212d1 100644--- a/apps/web/public/static/locales/vi/common.json+++ b/apps/web/public/static/locales/vi/common.json@@ -596,7 +596,7 @@"monthly_other": "tháng","yearly_one": "năm","yearly_other": "năm",- "plus_more": "+ {{count}} nữa",+ "plus_more": "{{count}} nữa","max": "Tối đa","single_theme": "Chủ đề đơn","brand_color": "Màu thương hiệu",diff --git a/apps/web/public/static/locales/zh-CN/common.json b/apps/web/public/static/locales/zh-CN/common.jsonindex 484238e3e28..1aeb63aeec8 100644--- a/apps/web/public/static/locales/zh-CN/common.json+++ b/apps/web/public/static/locales/zh-CN/common.json@@ -596,7 +596,7 @@"monthly_other": "月","yearly_one": "年","yearly_other": "年",- "plus_more": "+ 另外 {{count}}",+ "plus_more": "另外 {{count}}","max": "最大","single_theme": "主题","brand_color": "品牌颜色",