Apps: Riverside/Whereby/Around (#3053)
* Add Whereby Boilerplate * Whereby App * around boilerplate * AroundCo App * Add Riverside App * Add Riverside to details * Fix URL validation * Remove Icons * Remove console.log * revert merge * Fix images * Update Iconds to be SVG * Add Disconnect button * Fix type * Fixing i18n merge * Refactor app installations * Update varient * Update default responder + riverside logo * Update apps/web/pages/event-types/[type].tsx Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Omar López <[email protected]>
This commit is contained in:
50 files changed
+677
-56
No files matched your search
@@ -6,6 +6,7 @@ import { useEffect } from "react";
|
||||
import { Controller, useForm, useWatch } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Button } from "@calcom/ui";
|
||||
import { Dialog, DialogContent } from "@calcom/ui/Dialog";
|
||||
@@ -79,7 +80,23 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
|
||||
const locationFormSchema = z.object({
|
||||
locationType: z.string(),
|
||||
locationAddress: z.string().optional(),
|
||||
locationLink: z.string().url().optional(),
|
||||
locationLink:
|
||||
selection?.value === LocationType.Whereby
|
||||
? z
|
||||
.string()
|
||||
.regex(/^http(s)?:\/\/www.whereby.com\/[a-zA-Z0-9]*/)
|
||||
.optional()
|
||||
: selection?.value === LocationType.Around
|
||||
? z
|
||||
.string()
|
||||
.regex(/^http(s)?:\/\/www.around.co\/[a-zA-Z0-9]*/)
|
||||
.optional()
|
||||
: selection?.value === LocationType.Riverside
|
||||
? z
|
||||
.string()
|
||||
.regex(/^http(s)?:\/\/www.riverside.fm\/studio\/[a-zA-Z0-9]*/)
|
||||
.optional()
|
||||
: z.string().url().optional(),
|
||||
displayLocationPublicly: z.boolean().optional(),
|
||||
locationPhoneNumber: z
|
||||
.string()
|
||||
@@ -153,8 +170,8 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
|
||||
<input
|
||||
type="text"
|
||||
{...locationFormMethods.register("locationLink")}
|
||||
id="link"
|
||||
required
|
||||
id="link"
|
||||
className="block w-full rounded-sm border-gray-300 sm:text-sm"
|
||||
defaultValue={
|
||||
defaultValues
|
||||
@@ -215,6 +232,147 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : selectedLocation === LocationType.Whereby ? (
|
||||
<>
|
||||
<div>
|
||||
<label htmlFor="address" className="block text-sm font-medium text-gray-700">
|
||||
{t("set_whereby_link")}
|
||||
</label>
|
||||
<div className="mt-1">
|
||||
<input
|
||||
type="text"
|
||||
{...locationFormMethods.register("locationLink")}
|
||||
id="wherebylink"
|
||||
placeholder="https://www.whereby.com/cal"
|
||||
required
|
||||
className={"block w-full rounded-sm border-gray-300 text-sm"}
|
||||
defaultValue={
|
||||
defaultValues
|
||||
? defaultValues.find(
|
||||
(location: { type: LocationType }) => location.type === LocationType.Whereby
|
||||
)?.address
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{!booking && (
|
||||
<div className="mt-3">
|
||||
<Controller
|
||||
name="displayLocationPublicly"
|
||||
control={locationFormMethods.control}
|
||||
render={() => (
|
||||
<CheckboxField
|
||||
defaultChecked={
|
||||
defaultValues
|
||||
? defaultValues.find((location) => location.type === LocationType.Whereby)
|
||||
?.displayLocationPublicly
|
||||
: undefined
|
||||
}
|
||||
description={t("display_location_label")}
|
||||
onChange={(e) =>
|
||||
locationFormMethods.setValue("displayLocationPublicly", e.target.checked)
|
||||
}
|
||||
informationIconText={t("display_location_info_badge")}></CheckboxField>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
) : selectedLocation === LocationType.Around ? (
|
||||
<>
|
||||
<div>
|
||||
<label htmlFor="address" className="block text-sm font-medium text-gray-700">
|
||||
{t("set_around_link")}
|
||||
</label>
|
||||
<div className="mt-1">
|
||||
<input
|
||||
type="text"
|
||||
{...locationFormMethods.register("locationLink")}
|
||||
id="aroundlink"
|
||||
placeholder="https://www.around.com/rick"
|
||||
required
|
||||
className={"block w-full rounded-sm border-gray-300 text-sm"}
|
||||
defaultValue={
|
||||
defaultValues
|
||||
? defaultValues.find(
|
||||
(location: { type: LocationType }) => location.type === LocationType.Around
|
||||
)?.address
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{!booking && (
|
||||
<div className="mt-3">
|
||||
<Controller
|
||||
name="displayLocationPublicly"
|
||||
control={locationFormMethods.control}
|
||||
render={() => (
|
||||
<CheckboxField
|
||||
defaultChecked={
|
||||
defaultValues
|
||||
? defaultValues.find((location) => location.type === LocationType.Around)
|
||||
?.displayLocationPublicly
|
||||
: undefined
|
||||
}
|
||||
description={t("display_location_label")}
|
||||
onChange={(e) =>
|
||||
locationFormMethods.setValue("displayLocationPublicly", e.target.checked)
|
||||
}
|
||||
informationIconText={t("display_location_info_badge")}></CheckboxField>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
) : selectedLocation === LocationType.Riverside ? (
|
||||
<>
|
||||
<div>
|
||||
<label htmlFor="address" className="block text-sm font-medium text-gray-700">
|
||||
{t("set_around_link")}
|
||||
</label>
|
||||
<div className="mt-1">
|
||||
<input
|
||||
type="text"
|
||||
{...locationFormMethods.register("locationLink")}
|
||||
id="aroundlink"
|
||||
placeholder="https://www.riverside.fm/studio/rick"
|
||||
required
|
||||
className={"block w-full rounded-sm border-gray-300 text-sm"}
|
||||
defaultValue={
|
||||
defaultValues
|
||||
? defaultValues.find(
|
||||
(location: { type: LocationType }) => location.type === LocationType.Riverside
|
||||
)?.address
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{!booking && (
|
||||
<div className="mt-3">
|
||||
<Controller
|
||||
name="displayLocationPublicly"
|
||||
control={locationFormMethods.control}
|
||||
render={() => (
|
||||
<CheckboxField
|
||||
defaultChecked={
|
||||
defaultValues
|
||||
? defaultValues.find((location) => location.type === LocationType.Riverside)
|
||||
?.displayLocationPublicly
|
||||
: undefined
|
||||
}
|
||||
description={t("display_location_label")}
|
||||
onChange={(e) =>
|
||||
locationFormMethods.setValue("displayLocationPublicly", e.target.checked)
|
||||
}
|
||||
informationIconText={t("display_location_info_badge")}></CheckboxField>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<p className="text-sm">{LocationOptionsToString(selectedLocation, t)}</p>
|
||||
);
|
||||
@@ -255,9 +413,15 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
|
||||
displayLocationPublicly,
|
||||
};
|
||||
}
|
||||
if (newLocation === LocationType.Link) {
|
||||
if (
|
||||
newLocation === LocationType.Link ||
|
||||
newLocation === LocationType.Whereby ||
|
||||
newLocation === LocationType.Around ||
|
||||
newLocation === LocationType.Riverside
|
||||
) {
|
||||
details = { link: values.locationLink, displayLocationPublicly };
|
||||
}
|
||||
|
||||
if (newLocation === LocationType.UserPhone) {
|
||||
details = { hostPhoneNumber: values.locationPhoneNumber };
|
||||
}
|
||||
|
||||
@@ -100,7 +100,6 @@ interface IntegrationsContainerProps {
|
||||
const IntegrationsContainer = ({ variant, className = "" }: IntegrationsContainerProps): JSX.Element => {
|
||||
const { t } = useLocale();
|
||||
const query = trpc.useQuery(["viewer.integrations", { variant, onlyInstalled: true }], { suspense: true });
|
||||
|
||||
return (
|
||||
<QueryCell
|
||||
query={query}
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
TrashIcon,
|
||||
UserAddIcon,
|
||||
UsersIcon,
|
||||
VideoCameraIcon,
|
||||
} from "@heroicons/react/solid";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { EventTypeCustomInput, MembershipRole, PeriodType, Prisma, SchedulingType } from "@prisma/client";
|
||||
@@ -524,7 +525,10 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
if (
|
||||
newLocationType === LocationType.InPerson ||
|
||||
newLocationType === LocationType.Link ||
|
||||
newLocationType === LocationType.UserPhone
|
||||
newLocationType === LocationType.UserPhone ||
|
||||
newLocationType === LocationType.Whereby ||
|
||||
newLocationType === LocationType.Around ||
|
||||
newLocationType === LocationType.Riverside
|
||||
) {
|
||||
openLocationModal(newLocationType);
|
||||
} else {
|
||||
@@ -570,6 +574,27 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<span className="text-sm ltr:ml-2 rtl:mr-2">{t("phone_call")}</span>
|
||||
</div>
|
||||
)}
|
||||
{location.type === LocationType.Whereby && (
|
||||
<div className="flex flex-grow items-center">
|
||||
<img src="/api/app-store/whereby/icon.svg" className="h-6 w-6" alt="whereby logo"></img>
|
||||
<span className="text-sm ltr:ml-2 rtl:mr-2">{location.link}</span>
|
||||
</div>
|
||||
)}
|
||||
{location.type === LocationType.Around && (
|
||||
<div className="flex flex-grow items-center">
|
||||
<img src="/api/app-store/around/icon.svg" className="h-6 w-6" alt="whereby logo"></img>
|
||||
<span className="text-sm ltr:ml-2 rtl:mr-2">{location.link}</span>
|
||||
</div>
|
||||
)}
|
||||
{location.type === LocationType.Riverside && (
|
||||
<div className="flex flex-grow items-center">
|
||||
<img
|
||||
src="/api/app-store/riverside/icon.svg"
|
||||
className="h-6 w-6"
|
||||
alt="whereby logo"></img>
|
||||
<span className="text-sm ltr:ml-2 rtl:mr-2">{location.link}</span>
|
||||
</div>
|
||||
)}
|
||||
{location.type === LocationType.GoogleMeet && (
|
||||
<div className="flex flex-grow items-center">
|
||||
<svg
|
||||
|
||||
@@ -907,6 +907,12 @@
|
||||
"are_you_sure_you_want_to_remove_this_app": "Are you sure you want to remove this app?",
|
||||
"web_conference": "Web conference",
|
||||
"requires_confirmation": "Requires confirmation",
|
||||
"set_whereby_link":"Set Whereby link",
|
||||
"invalid_whereby_link": "Please enter a valid Whereby Link",
|
||||
"set_around_link":"Set Around.Co link",
|
||||
"invalid_around_link": "Please enter a valid Around Link",
|
||||
"set_riverside_link":"Set Riverside link",
|
||||
"invalid_riverside_link": "Please enter a valid Riverside Link",
|
||||
"add_exchange2013": "Connect Exchange 2013 Server",
|
||||
"add_exchange2016": "Connect Exchange 2016 Server",
|
||||
"specific_issue": "Have a specific issue",
|
||||
|
||||
Reference in new issue
Block a user