From 61e6f76bc6d97e43865ebb23ad919a849b1df675 Mon Sep 17 00:00:00 2001 From: Leo Giovanetti Date: Tue, 13 Dec 2022 18:09:28 -0300 Subject: [PATCH] Direct links to accept/reject a booking (#5939) * Impl * Added reason * Secondary reject CTA * Update packages/emails/src/components/Info.tsx * Adjusting recurring info * Not showing reason for rejecting if none given * Feedback * Error handling + style fixes Co-authored-by: Peer Richelsen --- apps/web/pages/500.tsx | 42 +- apps/web/pages/api/email.ts | 17 +- apps/web/pages/booking/direct/[...link].tsx | 450 ++++++++++++++++++ apps/web/public/emails/linkIcon.svg | 5 + apps/web/public/static/locales/en/common.json | 3 + .../emails/src/components/CallToAction.tsx | 19 +- .../src/components/CallToActionTable.tsx | 2 - packages/emails/src/components/LinkIcon.tsx | 6 +- packages/emails/src/components/Separator.tsx | 3 + packages/emails/src/components/WhenInfo.tsx | 27 +- packages/emails/src/components/index.ts | 1 + .../src/templates/OrganizerRequestEmail.tsx | 65 ++- .../lib/{getWebhooks.tsx => getWebhooks.ts} | 0 .../lib/{sendPayload.tsx => sendPayload.ts} | 0 .../lib/server/queries/bookings/confirm.ts | 441 +++++++++++++++++ .../trpc/server/routers/viewer/bookings.tsx | 415 +--------------- 16 files changed, 1018 insertions(+), 478 deletions(-) create mode 100644 apps/web/pages/booking/direct/[...link].tsx create mode 100644 apps/web/public/emails/linkIcon.svg create mode 100644 packages/emails/src/components/Separator.tsx rename packages/features/webhooks/lib/{getWebhooks.tsx => getWebhooks.ts} (100%) rename packages/features/webhooks/lib/{sendPayload.tsx => sendPayload.ts} (100%) create mode 100644 packages/lib/server/queries/bookings/confirm.ts diff --git a/apps/web/pages/500.tsx b/apps/web/pages/500.tsx index 3fa4508a3b..47bb99684c 100644 --- a/apps/web/pages/500.tsx +++ b/apps/web/pages/500.tsx @@ -1,32 +1,48 @@ import Head from "next/head"; +import { useRouter } from "next/router"; import { APP_NAME, WEBSITE_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Button } from "@calcom/ui"; +import { Button, Icon, showToast } from "@calcom/ui"; export default function Error500() { const { t } = useLocale(); + const router = useRouter(); return ( -
+
Something unexpected occurred | {APP_NAME} -
-

- 5 - { - // eslint-disable-next-line @next/next/no-img-element - 0 - } - 0 -

-

It's not you, it's us.

-

+

+

500

+

It's not you, it's us.

+

Something went wrong on our end. Get in touch with our support team, and we’ll get it fixed right away for you.

+ {router.query.error && ( +
+

+ Please provide the following text when contacting support to better help you: +

+
+              {router.query.error}
+              
+ +
+
+ )}