diff --git a/components/booking/pages/BookingPage.tsx b/components/booking/pages/BookingPage.tsx index e9d52e7e8140b5..1bd379729b9932 100644 --- a/components/booking/pages/BookingPage.tsx +++ b/components/booking/pages/BookingPage.tsx @@ -29,7 +29,7 @@ import slugify from "@lib/slugify"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry"; import CustomBranding from "@components/CustomBranding"; -import { Form } from "@components/form/fields"; +import { EmailInput, Form } from "@components/form/fields"; import AvatarGroup from "@components/ui/AvatarGroup"; import { Button } from "@components/ui/Button"; import PhoneInput from "@components/ui/form/PhoneInput"; @@ -98,9 +98,10 @@ const BookingPage = (props: BookingPageProps) => { const [guestToggle, setGuestToggle] = useState(false); + type Location = { type: LocationType; address?: string }; // it would be nice if Prisma at some point in the future allowed for Json; as of now this is not the case. - const locations: { type: LocationType }[] = useMemo( - () => (props.eventType.locations as { type: LocationType }[]) || [], + const locations: Location[] = useMemo( + () => (props.eventType.locations as Location[]) || [], [props.eventType.locations] ); @@ -171,14 +172,14 @@ const BookingPage = (props: BookingPageProps) => { const { locationType } = booking; switch (locationType) { case LocationType.Phone: { - return booking.phone; + return booking.phone || ""; } case LocationType.InPerson: { - return locationInfo(locationType).address; + return locationInfo(locationType)?.address || ""; } // Catches all other location types, such as Google Meet, Zoom etc. default: - return selectedLocation; + return selectedLocation || ""; } }; @@ -244,12 +245,12 @@ const BookingPage = (props: BookingPageProps) => {
user.name !== props.profile.name) .map((user) => ({ - image: user.avatar, - title: user.name, + image: user.avatar || "", + alt: user.name || "", })) )} /> @@ -283,8 +284,8 @@ const BookingPage = (props: BookingPageProps) => { )}

- {date && - parseZone(date).format(timeFormat) + + {(date && parseZone(date)?.format(timeFormat)) || + "No date" + ", " + dayjs(date).toDate().toLocaleString(i18n.language, { dateStyle: "full" })}

@@ -315,12 +316,8 @@ const BookingPage = (props: BookingPageProps) => { {t("email_address")}
- (funct return ; }); +export const EmailInput = forwardRef(function EmailInput( + props, + ref +) { + return ( + + ); +}); + export const EmailField = forwardRef(function EmailField(props, ref) { - return ; + return ; }); type FormProps = { form: UseFormReturn; handleSubmit: SubmitHandler } & Omit< diff --git a/components/team/MemberInvitationModal.tsx b/components/team/MemberInvitationModal.tsx index 370462a933c3ee..6cde51c8d401fe 100644 --- a/components/team/MemberInvitationModal.tsx +++ b/components/team/MemberInvitationModal.tsx @@ -7,6 +7,7 @@ import { useLocale } from "@lib/hooks/useLocale"; import { TeamWithMembers } from "@lib/queries/teams"; import { trpc } from "@lib/trpc"; +import { EmailInput } from "@components/form/fields"; import Button from "@components/ui/Button"; export default function MemberInvitationModal(props: { team: TeamWithMembers | null; onExit: () => void }) { @@ -80,7 +81,7 @@ export default function MemberInvitationModal(props: { team: TeamWithMembers | n -
- +
@@ -176,7 +174,7 @@ export default function Login({ csrfToken }: inferSSRProps{errorMessage}

}
-
+
{t("dont_have_an_account")} {/* replace this with your account creation flow */} {t("create_an_account")} diff --git a/pages/success.tsx b/pages/success.tsx index 711f72ffe7530f..d5028ed6fa4961 100644 --- a/pages/success.tsx +++ b/pages/success.tsx @@ -19,6 +19,7 @@ import prisma from "@lib/prisma"; import { inferSSRProps } from "@lib/types/inferSSRProps"; import CustomBranding from "@components/CustomBranding"; +import { EmailInput } from "@components/form/fields"; import { HeadSeo } from "@components/seo/head-seo"; import Button from "@components/ui/Button"; @@ -254,11 +255,9 @@ export default function Success(props: inferSSRProps) router.push(`https://cal.com/signup?email=` + (e as any).target.email.value); }} className="flex mt-4"> - { body.createdAt = dynamic; body.payload.startTime = dynamic; body.payload.endTime = dynamic; + body.payload.location = dynamic; for (const attendee of body.payload.attendees) { attendee.timeZone = dynamic; } diff --git a/playwright/integrations.test.ts-snapshots/webhookResponse-chromium.txt b/playwright/integrations.test.ts-snapshots/webhookResponse-chromium.txt index eb1ce59be478d9..9851dbbedd413d 100644 --- a/playwright/integrations.test.ts-snapshots/webhookResponse-chromium.txt +++ b/playwright/integrations.test.ts-snapshots/webhookResponse-chromium.txt @@ -1 +1 @@ -{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30min","title":"30min between Pro Example and Test Testson","description":"","startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"name":"Pro Example","email":"pro@example.com","timeZone":"[redacted/dynamic]"},"attendees":[{"email":"test@example.com","name":"Test Testson","timeZone":"[redacted/dynamic]"}],"destinationCalendar":null,"uid":"[redacted/dynamic]","metadata":{},"additionInformation":"[redacted/dynamic]"}} \ No newline at end of file +{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30min","title":"30min between Pro Example and Test Testson","description":"","startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"name":"Pro Example","email":"pro@example.com","timeZone":"[redacted/dynamic]"},"attendees":[{"email":"test@example.com","name":"Test Testson","timeZone":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"uid":"[redacted/dynamic]","metadata":{},"additionInformation":"[redacted/dynamic]"}} \ No newline at end of file diff --git a/prisma/migrations/20211220192703_email_to_lowercase/migration.sql b/prisma/migrations/20211220192703_email_to_lowercase/migration.sql new file mode 100644 index 00000000000000..5a09a172ae98bf --- /dev/null +++ b/prisma/migrations/20211220192703_email_to_lowercase/migration.sql @@ -0,0 +1,2 @@ +-- UpdateTable +UPDATE users SET email=LOWER(email); diff --git a/public/static/locales/en/common.json b/public/static/locales/en/common.json index e9dba0fb1b8eff..6c8e40ee626f2c 100644 --- a/public/static/locales/en/common.json +++ b/public/static/locales/en/common.json @@ -563,5 +563,7 @@ "calendar": "Calendar", "not_installed": "Not installed", "error_password_mismatch": "Passwords don't match.", - "error_required_field": "This field is required." -} \ No newline at end of file + "error_required_field": "This field is required.", + "team_view_user_availability": "View user availability", + "team_view_user_availability_disabled": "User needs to accept invite to view availability" +}