From 1332b76441b335663ae2c78152e885b2cb64e4e1 Mon Sep 17 00:00:00 2001 From: Peer Richelsen Date: Mon, 8 Aug 2022 07:57:09 +0200 Subject: [PATCH] added ping.gg app (#3728) * added ping.gg app, not sure why its not showing * nit * Fixes * fixed email Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> --- .../booking/pages/AvailabilityPage.tsx | 3 + .../components/booking/pages/BookingPage.tsx | 3 + .../components/dialog/EditLocationDialog.tsx | 56 +++++++++++++++++- apps/web/pages/event-types/[type].tsx | 17 ++++-- apps/web/public/static/locales/en/common.json | 3 +- packages/app-store-cli/readme.md | 11 ++-- packages/app-store-cli/src/CliApp.tsx | 6 +- packages/app-store/apps.browser.generated.tsx | 2 + packages/app-store/apps.server.generated.ts | 1 + packages/app-store/locations.ts | 1 + packages/app-store/ping/README.mdx | 10 ++++ packages/app-store/ping/_metadata.ts | 19 ++++++ packages/app-store/ping/api/_getAdd.ts | 25 ++++++++ packages/app-store/ping/api/add.ts | 5 ++ packages/app-store/ping/api/index.ts | 1 + packages/app-store/ping/config.json | 16 +++++ packages/app-store/ping/index.ts | 3 + packages/app-store/ping/package.json | 14 +++++ packages/app-store/ping/static/1.png | Bin 0 -> 1002075 bytes packages/app-store/ping/static/2.png | Bin 0 -> 120551 bytes packages/app-store/ping/static/3.png | Bin 0 -> 477528 bytes packages/app-store/ping/static/icon.svg | 1 + packages/prisma/seed-app-store.config.json | 7 +++ 23 files changed, 192 insertions(+), 12 deletions(-) create mode 100644 packages/app-store/ping/README.mdx create mode 100644 packages/app-store/ping/_metadata.ts create mode 100644 packages/app-store/ping/api/_getAdd.ts create mode 100644 packages/app-store/ping/api/add.ts create mode 100644 packages/app-store/ping/api/index.ts create mode 100644 packages/app-store/ping/config.json create mode 100644 packages/app-store/ping/index.ts create mode 100644 packages/app-store/ping/package.json create mode 100644 packages/app-store/ping/static/1.png create mode 100644 packages/app-store/ping/static/2.png create mode 100644 packages/app-store/ping/static/3.png create mode 100644 packages/app-store/ping/static/icon.svg diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx index d4d1dca257..3d1bcd814a 100644 --- a/apps/web/components/booking/pages/AvailabilityPage.tsx +++ b/apps/web/components/booking/pages/AvailabilityPage.tsx @@ -52,6 +52,9 @@ export const locationKeyToString = (location: LocationObject, t: TFunction) => { case LocationType.InPerson: return location.address || "In Person"; // If disabled address won't exist on the object case LocationType.Link: + case LocationType.Ping: + case LocationType.Riverside: + case LocationType.Whereby: return location.link || "Link"; // If disabled link won't exist on the object case LocationType.Phone: return t("your_number"); diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx index 438f0b3ccf..b45083bed8 100644 --- a/apps/web/components/booking/pages/BookingPage.tsx +++ b/apps/web/components/booking/pages/BookingPage.tsx @@ -334,6 +334,9 @@ const BookingPage = ({ case LocationType.Whereby: { return locationInfo(locationType)?.link || ""; } + case LocationType.Ping: { + return locationInfo(locationType)?.link || ""; + } // Catches all other location types, such as Google Meet, Zoom etc. default: return selectedLocation || ""; diff --git a/apps/web/components/dialog/EditLocationDialog.tsx b/apps/web/components/dialog/EditLocationDialog.tsx index 98a82fb7fa..f86b41f15d 100644 --- a/apps/web/components/dialog/EditLocationDialog.tsx +++ b/apps/web/components/dialog/EditLocationDialog.tsx @@ -85,6 +85,11 @@ export const EditLocationDialog = (props: ISetLocationDialog) => { .string() .regex(/^http(s)?:\/\/(www\.)?around.co\/[a-zA-Z0-9]*/) .optional() + : selection?.value === LocationType.Ping + ? z + .string() + .regex(/^http(s)?:\/\/(www\.)?ping.gg\/call\/[a-zA-Z0-9]*/) + .optional() : selection?.value === LocationType.Riverside ? z .string() @@ -324,6 +329,54 @@ export const EditLocationDialog = (props: ISetLocationDialog) => { )} + ) : selectedLocation === LocationType.Ping ? ( + <> +
+ +
+ location.type === LocationType.Ping + )?.address + : undefined + } + /> +
+ {!booking && ( +
+ ( + location.type === LocationType.Ping) + ?.displayLocationPublicly + : undefined + } + description={t("display_location_label")} + onChange={(e) => + locationFormMethods.setValue("displayLocationPublicly", e.target.checked) + } + informationIconText={t("display_location_info_badge")} + /> + )} + /> +
+ )} +
+ ) : selectedLocation === LocationType.Riverside ? ( <>
@@ -416,7 +469,8 @@ export const EditLocationDialog = (props: ISetLocationDialog) => { newLocation === LocationType.Link || newLocation === LocationType.Whereby || newLocation === LocationType.Around || - newLocation === LocationType.Riverside + newLocation === LocationType.Riverside || + newLocation === LocationType.Ping ) { details = { link: values.locationLink, displayLocationPublicly }; } diff --git a/apps/web/pages/event-types/[type].tsx b/apps/web/pages/event-types/[type].tsx index 008a3c4940..adee1ee3be 100644 --- a/apps/web/pages/event-types/[type].tsx +++ b/apps/web/pages/event-types/[type].tsx @@ -474,7 +474,8 @@ const EventTypePage = (props: inferSSRProps) => { newLocationType === LocationType.UserPhone || newLocationType === LocationType.Whereby || newLocationType === LocationType.Around || - newLocationType === LocationType.Riverside + newLocationType === LocationType.Riverside || + newLocationType === LocationType.Ping ) { openLocationModal(newLocationType); } else { @@ -485,6 +486,8 @@ const EventTypePage = (props: inferSSRProps) => { />
)} + + {/* TODO: all of this should be generated from the App Store */} {formMethods.getValues("locations").length > 0 && (