feat: events apps new install flow (#14616)
* feat(appStore): add isOAuth config * refactor(appStore): EventTypeAppSettngsInterface * refactor(qr_code): split EventTypeAppCardInterface and EventTypeAppSettingsInterface * feat(appStore): redirect to onboarding for stripe and basecam * fix(ui/ScrollableArea): overflow indicator not working * feat(apps): new install app flow * fix(configureStep): get disabled props for settings * fix: getAppInstallsBySlug now use teamIds * chore: Alby to AppSettingsInterface * chore: Giphy to appsettings interface * chore: GTM migration * chore: GT4 - migration * chore: fathom migration * chore: paypal * feat: basecamp migration * feat: metapixel migration * feat:plausable * feat:stripe * fix merge issues * fix merge issues in new app install flow steps * wip: callback to onboarding * fix: imports * fix: more imports * feat: use redirect to onboarding on install flow * fix: redirect to event-type after oauth flow * When clicking on install new app button, only redirect to the new app install flow if it is an oAuth app or an app that extends the EventType feature in it's config * code refactor, skip event-type step * removed extra consoles * so that no one can change the eventTypeId in url * theme support enabled * only pass eventTypeId instead of whole evetType obj to OmniInstallAppButton * fix: clicking on event-type gives error and redirects to /apps * saved appOnboardingRedirectUrl to OAuth State * fix: a user having no team breaks the onboarding flow * add optional chaining to appMetadata.extendsFeature and appMetadata.isOAuth; * encode appOnboardingRedirectUrl * fix: dark theme ui issues * skip configure step if no-event types if user/team does not have event-type then skip configure step and goto apps/installed/[category] * exclude calendars from apps- onboarding flow * Update getAppOnboardingRedirectUrl.ts * fix: On configure step, inputs aren't showing errors * change route from `apps/onboarding` to `apps/installation` * fix: flow not correctly working for teams * should only allow team ADMIN or OWER to install an app to team * Prevent two payment apps to be enabled * removed loading state * Fix type error * undo new-app-flow from OmniInstallAppButton * remove OAuth Step, handle step numbering * fix: redirect url * getAppOnboardingRedirectUrl refactor * for debugging * Revert "for debugging" This reverts commit b9362c1a8f47f2280e684c213d7ec08d04a8ac4c. * fix: added toaster * feat: added support to select multiple events (almost) * hide button * Move inner form outside outer form using portal Due to limitations with nested forms in React Hook Form, moved the inner form outside the outer form using a portal to ensure proper form handling. * submit buttons refs madness * removed configure step we had to use query params to manage selected event-types, between routes which was causing 2 issues: * each time we selected or unselected an event the whole page was reloaded including getserversideprops being called again and again * the form was reloaded causing more issues * removed extra unwanted code * small fix * fix: type error * fix: types * implemented suggested changes * removed step footer * fixed error.message * removed commented styles * removed step footer * fix: Display team event types instead of user's on event types step when team selected * fix: typo * removed shouldLockDisableProps * refactor setUpdatedEventTypesStatus, fix type * removed extra code * can't delete while saving * added translations * fix: loading in select account step, fix handle onSelect params type * Fix typo * feat: add skip button to event-types step * use set-up-later button in tests * added skip button to configure step as well * feat: add test for analytics apps using the new app install flow * feat: add test for stripe 1 * feat: add test for stripe 2 * Fix: Redirect only those apps that extend 'EventType' to the new app install flow (#14527) * fix: type errors * fix: failing tests * fix: tests * fix test flakiness * better naming and code refactor for analytics apps tests * run tests parallelly * removed network idle, giving error * another shot at test flakiness * Fix: can't install apps without team selector dropdown on main app store page. * fix: test flakiness * fix: account select loading issue * removed getPaymentCredential (unused) * fix: only redirect after the app has been added to all the event-types * remove overflowIndicatorStyles * fixed failing test * fix: exclude org team events * undo some random merge changes --------- Co-authored-by: Morgan Vernay <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Keith Williams <[email protected]> Co-authored-by: Joe Au-Yeung <[email protected]> Co-authored-by: Joe Au-Yeung <[email protected]> Co-authored-by: Omar López <[email protected]>
This commit is contained in:
125 files changed
+2557
-689
No files matched your search
@@ -328,6 +328,14 @@ function generateFiles() {
|
||||
lazyImport: true,
|
||||
})
|
||||
);
|
||||
browserOutput.push(
|
||||
...getExportedObject("EventTypeSettingsMap", {
|
||||
importConfig: {
|
||||
fileToBeImported: "components/EventTypeAppSettingsInterface.tsx",
|
||||
},
|
||||
lazyImport: true,
|
||||
})
|
||||
);
|
||||
|
||||
const banner = `/**
|
||||
This file is autogenerated using the command \`yarn app-store:build --watch\`.
|
||||
|
||||
@@ -8,7 +8,7 @@ export function DynamicComponent<T extends Record<string, React.ComponentType<an
|
||||
const dirName = slug === "stripe" ? "stripepayment" : slug;
|
||||
|
||||
// There can be apps with no matching component
|
||||
if (!componentMap[slug]) return null;
|
||||
if (!componentMap[dirName]) return null;
|
||||
|
||||
const Component = componentMap[dirName];
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { EventTypeSettingsMap } from "@calcom/app-store/apps.browser.generated";
|
||||
|
||||
import type { EventTypeAppSettingsComponentProps } from "../types";
|
||||
import { DynamicComponent } from "./DynamicComponent";
|
||||
|
||||
export const EventTypeAppSettings = (props: EventTypeAppSettingsComponentProps) => {
|
||||
const { slug, ...rest } = props;
|
||||
return <DynamicComponent slug={slug} componentMap={EventTypeSettingsMap} {...rest} />;
|
||||
};
|
||||
@@ -7,6 +7,9 @@ export function decodeOAuthState(req: NextApiRequest) {
|
||||
return undefined;
|
||||
}
|
||||
const state: IntegrationOAuthCallbackState = JSON.parse(req.query.state);
|
||||
if (state.appOnboardingRedirectUrl) {
|
||||
state.appOnboardingRedirectUrl = decodeURIComponent(state.appOnboardingRedirectUrl);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
@@ -1,20 +1,15 @@
|
||||
import { usePathname, useSearchParams } from "next/navigation";
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import { useState, useMemo } from "react";
|
||||
|
||||
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import { currencyOptions } from "@calcom/app-store/alby/lib/currencyOptions";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Alert, Select, TextField } from "@calcom/ui";
|
||||
import { SatSymbol } from "@calcom/ui/components/icon/SatSymbol";
|
||||
|
||||
import checkForMultiplePaymentApps from "../../_utils/payments/checkForMultiplePaymentApps";
|
||||
import type { appDataSchema } from "../zod";
|
||||
import { PaypalPaymentOptions as paymentOptions } from "../zod";
|
||||
|
||||
type Option = { value: string; label: string };
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
app,
|
||||
@@ -22,38 +17,19 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
eventTypeFormMetadata,
|
||||
}) {
|
||||
const searchParams = useSearchParams();
|
||||
const { t } = useLocale();
|
||||
/** TODO "pathname" no longer contains square-bracket expressions. Rewrite the code relying on them if required. **/
|
||||
const pathname = usePathname();
|
||||
const asPath = useMemo(
|
||||
() => `${pathname}${searchParams ? `?${searchParams.toString()}` : ""}`,
|
||||
[pathname, searchParams]
|
||||
);
|
||||
const { getAppData, setAppData } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const price = getAppData("price");
|
||||
const currency = getAppData("currency");
|
||||
const [selectedCurrency, setSelectedCurrency] = useState(
|
||||
currencyOptions.find((c) => c.value === currency) || currencyOptions[0]
|
||||
);
|
||||
const paymentOption = getAppData("paymentOption");
|
||||
const paymentOptionSelectValue = paymentOptions?.find((option) => paymentOption === option.value) || {
|
||||
label: paymentOptions[0].label,
|
||||
value: paymentOptions[0].value,
|
||||
};
|
||||
const seatsEnabled = !!eventType.seatsPerTimeSlot;
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const [requirePayment, setRequirePayment] = useState(getAppData("enabled"));
|
||||
const { t } = useLocale();
|
||||
const recurringEventDefined = eventType.recurringEvent?.count !== undefined;
|
||||
const otherPaymentAppEnabled = checkForMultiplePaymentApps(eventTypeFormMetadata);
|
||||
|
||||
const shouldDisableSwitch = !requirePayment && otherPaymentAppEnabled;
|
||||
|
||||
// make sure a currency is selected
|
||||
useEffect(() => {
|
||||
if (!currency && requirePayment) {
|
||||
setAppData("currency", selectedCurrency.value);
|
||||
}
|
||||
}, [currency, selectedCurrency, setAppData, requirePayment]);
|
||||
|
||||
return (
|
||||
<AppCard
|
||||
returnTo={WEBAPP_URL + asPath}
|
||||
@@ -65,77 +41,13 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
description={<>Add bitcoin lightning payments to your events</>}
|
||||
disableSwitch={shouldDisableSwitch}
|
||||
switchTooltip={shouldDisableSwitch ? t("other_payment_app_enabled") : undefined}>
|
||||
<>
|
||||
{recurringEventDefined ? (
|
||||
<Alert className="mt-2" severity="warning" title={t("warning_recurring_event_payment")} />
|
||||
) : (
|
||||
requirePayment && (
|
||||
<>
|
||||
<div className="mt-2 block items-center sm:flex">
|
||||
<TextField
|
||||
label="Price"
|
||||
labelSrOnly
|
||||
addOnLeading={<SatSymbol className="h-4 w-4" />}
|
||||
addOnSuffix={selectedCurrency.unit || selectedCurrency.value}
|
||||
type="number"
|
||||
required
|
||||
className="block w-full rounded-sm border-gray-300 pl-2 pr-12 text-sm"
|
||||
placeholder="Price"
|
||||
onChange={(e) => {
|
||||
setAppData("price", Number(e.target.value));
|
||||
if (currency) {
|
||||
setAppData("currency", currency);
|
||||
}
|
||||
}}
|
||||
value={price && price > 0 ? price : undefined}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-5 w-60">
|
||||
<label className="text-default block text-sm font-medium" htmlFor="currency">
|
||||
{t("currency")}
|
||||
</label>
|
||||
<Select
|
||||
variant="default"
|
||||
options={currencyOptions}
|
||||
value={selectedCurrency}
|
||||
className="text-black"
|
||||
defaultValue={selectedCurrency}
|
||||
onChange={(e) => {
|
||||
if (e) {
|
||||
setSelectedCurrency(e);
|
||||
setAppData("currency", e.value);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-2 w-60">
|
||||
<label className="text-default block text-sm font-medium" htmlFor="currency">
|
||||
Payment option
|
||||
</label>
|
||||
<Select<Option>
|
||||
defaultValue={
|
||||
paymentOptionSelectValue
|
||||
? { ...paymentOptionSelectValue, label: t(paymentOptionSelectValue.label) }
|
||||
: { ...paymentOptions[0], label: t(paymentOptions[0].label) }
|
||||
}
|
||||
options={paymentOptions.map((option) => {
|
||||
return { ...option, label: t(option.label) || option.label };
|
||||
})}
|
||||
onChange={(input) => {
|
||||
if (input) setAppData("paymentOption", input.value);
|
||||
}}
|
||||
className="mb-1 h-[38px] w-full"
|
||||
isDisabled={seatsEnabled}
|
||||
/>
|
||||
</div>
|
||||
{seatsEnabled && paymentOption === "HOLD" && (
|
||||
<Alert className="mt-2" severity="warning" title={t("seats_and_no_show_fee_error")} />
|
||||
)}
|
||||
</>
|
||||
)
|
||||
)}
|
||||
</>
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import { currencyOptions } from "@calcom/app-store/alby/lib/currencyOptions";
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Alert, Select, TextField } from "@calcom/ui";
|
||||
import { SatSymbol } from "@calcom/ui/components/icon/SatSymbol";
|
||||
|
||||
import { PaypalPaymentOptions as paymentOptions } from "../zod";
|
||||
|
||||
type Option = { value: string; label: string };
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
|
||||
eventType,
|
||||
getAppData,
|
||||
setAppData,
|
||||
}) => {
|
||||
const { t } = useLocale();
|
||||
const price = getAppData("price");
|
||||
const currency = getAppData("currency");
|
||||
const [selectedCurrency, setSelectedCurrency] = useState(
|
||||
currencyOptions.find((c) => c.value === currency) || currencyOptions[0]
|
||||
);
|
||||
|
||||
const paymentOption = getAppData("paymentOption");
|
||||
const paymentOptionSelectValue = paymentOptions?.find((option) => paymentOption === option.value) || {
|
||||
label: paymentOptions[0].label,
|
||||
value: paymentOptions[0].value,
|
||||
};
|
||||
|
||||
const seatsEnabled = !!eventType.seatsPerTimeSlot;
|
||||
const [requirePayment] = useState(getAppData("enabled"));
|
||||
const recurringEventDefined = eventType.recurringEvent?.count !== undefined;
|
||||
|
||||
// make sure a currency is selected
|
||||
useEffect(() => {
|
||||
if (!currency && requirePayment) {
|
||||
setAppData("currency", selectedCurrency.value);
|
||||
}
|
||||
}, [currency, selectedCurrency, setAppData, requirePayment]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{recurringEventDefined ? (
|
||||
<Alert className="mt-2" severity="warning" title={t("warning_recurring_event_payment")} />
|
||||
) : (
|
||||
requirePayment && (
|
||||
<>
|
||||
<div className="mt-2 block items-center sm:flex">
|
||||
<TextField
|
||||
label="Price"
|
||||
labelSrOnly
|
||||
addOnLeading={<SatSymbol className="h-4 w-4" />}
|
||||
addOnSuffix={selectedCurrency.unit || selectedCurrency.value}
|
||||
type="number"
|
||||
required
|
||||
className="block w-full rounded-sm border-gray-300 pl-2 pr-12 text-sm"
|
||||
placeholder="Price"
|
||||
onChange={(e) => {
|
||||
setAppData("price", Number(e.target.value));
|
||||
if (currency) {
|
||||
setAppData("currency", currency);
|
||||
}
|
||||
}}
|
||||
value={price && price > 0 ? price : undefined}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-5 w-60">
|
||||
<label className="text-default block text-sm font-medium" htmlFor="currency">
|
||||
{t("currency")}
|
||||
</label>
|
||||
<Select
|
||||
variant="default"
|
||||
options={currencyOptions}
|
||||
value={selectedCurrency}
|
||||
className="text-black"
|
||||
defaultValue={selectedCurrency}
|
||||
onChange={(e) => {
|
||||
if (e) {
|
||||
setSelectedCurrency(e);
|
||||
setAppData("currency", e.value);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-2 w-60">
|
||||
<label className="text-default block text-sm font-medium" htmlFor="currency">
|
||||
Payment option
|
||||
</label>
|
||||
<Select<Option>
|
||||
defaultValue={
|
||||
paymentOptionSelectValue
|
||||
? { ...paymentOptionSelectValue, label: t(paymentOptionSelectValue.label) }
|
||||
: { ...paymentOptions[0], label: t(paymentOptions[0].label) }
|
||||
}
|
||||
options={paymentOptions.map((option) => {
|
||||
return { ...option, label: t(option.label) || option.label };
|
||||
})}
|
||||
onChange={(input) => {
|
||||
if (input) setAppData("paymentOption", input.value);
|
||||
}}
|
||||
className="mb-1 h-[38px] w-full"
|
||||
isDisabled={seatsEnabled}
|
||||
/>
|
||||
</div>
|
||||
{seatsEnabled && paymentOption === "HOLD" && (
|
||||
<Alert className="mt-2" severity="warning" title={t("seats_and_no_show_fee_error")} />
|
||||
)}
|
||||
</>
|
||||
)
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -14,5 +14,6 @@
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "event-type-app-card",
|
||||
"dirName": "alby"
|
||||
"dirName": "alby",
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -12,5 +12,6 @@
|
||||
"description": "The joyful productivity app\r\r",
|
||||
"__createdUsingCli": true,
|
||||
"dependencies": ["google-calendar"],
|
||||
"dirName": "amie"
|
||||
"dirName": "amie",
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -17,6 +17,7 @@ export const metadata = {
|
||||
url: "https://cal.com/",
|
||||
email: "[email protected]",
|
||||
dirName: "applecalendar",
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -42,3 +42,16 @@ export const EventTypeAddonMap = {
|
||||
import("./templates/event-type-app-card/components/EventTypeAppCardInterface")
|
||||
),
|
||||
};
|
||||
export const EventTypeSettingsMap = {
|
||||
alby: dynamic(() => import("./alby/components/EventTypeAppSettingsInterface")),
|
||||
basecamp3: dynamic(() => import("./basecamp3/components/EventTypeAppSettingsInterface")),
|
||||
fathom: dynamic(() => import("./fathom/components/EventTypeAppSettingsInterface")),
|
||||
ga4: dynamic(() => import("./ga4/components/EventTypeAppSettingsInterface")),
|
||||
giphy: dynamic(() => import("./giphy/components/EventTypeAppSettingsInterface")),
|
||||
gtm: dynamic(() => import("./gtm/components/EventTypeAppSettingsInterface")),
|
||||
metapixel: dynamic(() => import("./metapixel/components/EventTypeAppSettingsInterface")),
|
||||
paypal: dynamic(() => import("./paypal/components/EventTypeAppSettingsInterface")),
|
||||
plausible: dynamic(() => import("./plausible/components/EventTypeAppSettingsInterface")),
|
||||
qr_code: dynamic(() => import("./qr_code/components/EventTypeAppSettingsInterface")),
|
||||
stripepayment: dynamic(() => import("./stripepayment/components/EventTypeAppSettingsInterface")),
|
||||
};
|
||||
@@ -20,5 +20,6 @@
|
||||
"urlRegExp": "^http(s)?:\\/\\/(www\\.)?around.co\\/[a-zA-Z0-9]*",
|
||||
"organizerInputPlaceholder": "https://www.around.co/rick"
|
||||
}
|
||||
}
|
||||
},
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import prisma from "@calcom/prisma";
|
||||
|
||||
import getAppKeysFromSlug from "../../_utils/getAppKeysFromSlug";
|
||||
import getInstalledAppPath from "../../_utils/getInstalledAppPath";
|
||||
import { decodeOAuthState } from "../../_utils/oauth/decodeOAuthState";
|
||||
import appConfig from "../config.json";
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
@@ -86,5 +87,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
},
|
||||
});
|
||||
|
||||
const state = decodeOAuthState(req);
|
||||
|
||||
if (state?.appOnboardingRedirectUrl && state.appOnboardingRedirectUrl !== "") {
|
||||
return res.redirect(state.appOnboardingRedirectUrl);
|
||||
}
|
||||
|
||||
res.redirect(getInstalledAppPath({ variant: appConfig.variant, slug: appConfig.slug }));
|
||||
}
|
||||
@@ -1,76 +1,29 @@
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Select } from "@calcom/ui";
|
||||
|
||||
import useIsAppEnabled from "../../_utils/useIsAppEnabled";
|
||||
import type { appDataSchema } from "../zod";
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app }) {
|
||||
const { getAppData } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const [enabled, setEnabled] = useState(getAppData("enabled"));
|
||||
const [projects, setProjects] = useState();
|
||||
const [selectedProject, setSelectedProject] = useState<undefined | { label: string; value: string }>();
|
||||
const { data } = trpc.viewer.appBasecamp3.projects.useQuery();
|
||||
const setProject = trpc.viewer.appBasecamp3.projectMutation.useMutation();
|
||||
|
||||
useEffect(
|
||||
function refactorMeWithoutEffect() {
|
||||
setSelectedProject({
|
||||
value: data?.projects.currentProject,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
label: data?.projects?.find((project: any) => project.id === data?.currentProject)?.name,
|
||||
});
|
||||
setProjects(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data?.projects?.map((project: any) => {
|
||||
return {
|
||||
value: project.id,
|
||||
label: project.name,
|
||||
};
|
||||
})
|
||||
);
|
||||
},
|
||||
[data]
|
||||
);
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const { enabled, updateEnabled } = useIsAppEnabled(app);
|
||||
|
||||
return (
|
||||
<AppCard
|
||||
app={app}
|
||||
switchOnClick={(e) => {
|
||||
if (!e) {
|
||||
setEnabled(false);
|
||||
} else {
|
||||
setEnabled(true);
|
||||
}
|
||||
updateEnabled(e);
|
||||
}}
|
||||
switchChecked={enabled}>
|
||||
<div className="mt-2 text-sm">
|
||||
<div className="flex gap-3">
|
||||
<div className="items-center">
|
||||
<p className="py-2">Link a Basecamp project to this event:</p>
|
||||
</div>
|
||||
<Select
|
||||
placeholder="Select project"
|
||||
options={projects}
|
||||
isLoading={!projects}
|
||||
className="md:min-w-[120px]"
|
||||
onChange={(project) => {
|
||||
if (project) {
|
||||
setProject.mutate({ projectId: project?.value.toString() });
|
||||
setSelectedProject(project);
|
||||
}
|
||||
}}
|
||||
value={selectedProject}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-2">
|
||||
Please note that as of now you can only link <span className="italic">one</span> of your projects to
|
||||
cal.com
|
||||
</div>
|
||||
</div>
|
||||
<EventTypeAppSettingsInterface
|
||||
slug={app.slug}
|
||||
eventType={eventType}
|
||||
disabled={disabled}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Select } from "@calcom/ui";
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({}) => {
|
||||
const [projects, setProjects] = useState();
|
||||
const [selectedProject, setSelectedProject] = useState<undefined | { label: string; value: string }>();
|
||||
const { data } = trpc.viewer.appBasecamp3.projects.useQuery();
|
||||
const setProject = trpc.viewer.appBasecamp3.projectMutation.useMutation();
|
||||
|
||||
useEffect(
|
||||
function refactorMeWithoutEffect() {
|
||||
setSelectedProject({
|
||||
value: data?.projects.currentProject,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
label: data?.projects?.find((project: any) => project.id === data?.currentProject)?.name,
|
||||
});
|
||||
setProjects(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data?.projects?.map((project: any) => {
|
||||
return {
|
||||
value: project.id,
|
||||
label: project.name,
|
||||
};
|
||||
})
|
||||
);
|
||||
},
|
||||
[data]
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="mt-2 text-sm">
|
||||
<div className="flex gap-3">
|
||||
<div className="items-center">
|
||||
<p className="py-2">Link a Basecamp project to this event:</p>
|
||||
</div>
|
||||
<Select
|
||||
placeholder="Select project"
|
||||
options={projects}
|
||||
isLoading={!projects}
|
||||
className="md:min-w-[120px]"
|
||||
onChange={(project) => {
|
||||
if (project) {
|
||||
setProject.mutate({ projectId: project?.value.toString() });
|
||||
setSelectedProject(project);
|
||||
}
|
||||
}}
|
||||
value={selectedProject}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-2">
|
||||
Please note that as of now you can only link <span className="italic">one</span> of your projects to
|
||||
cal.com
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -13,5 +13,6 @@
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "event-type-app-card",
|
||||
"dirName": "basecamp3"
|
||||
"dirName": "basecamp3",
|
||||
"isOAuth": true
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
"__createdUsingCli": true,
|
||||
"__template": "basic",
|
||||
"dirName": "cal-ai",
|
||||
"isOAuth": false,
|
||||
"paid": {
|
||||
"priceInUsd": 8,
|
||||
"priceId": "price_1O1ziDH8UDiwIftkDHp3MCTP",
|
||||
|
||||
@@ -17,6 +17,7 @@ export const metadata = {
|
||||
url: "https://cal.com/",
|
||||
email: "[email protected]",
|
||||
dirName: "caldavcalendar",
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -19,5 +19,6 @@
|
||||
"organizerInputPlaceholder": "https://party.campfire.to/your-team",
|
||||
"urlRegExp": "^http(s)?:\\/\\/(www\\.)?party.campfire.to\\/[a-zA-Z0-9]*"
|
||||
}
|
||||
}
|
||||
},
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -11,5 +11,6 @@
|
||||
"publisher": "Cal.com, Inc.",
|
||||
"email": "[email protected]",
|
||||
"description": "Close is the inside sales CRM of choice for startups and SMBs. Make more calls, send more emails and close more deals starting today.",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -13,5 +13,6 @@
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "link-as-an-app",
|
||||
"dependencies": ["google-calendar"]
|
||||
"dependencies": ["google-calendar"],
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -26,6 +26,7 @@ export const metadata = {
|
||||
},
|
||||
key: { apikey: process.env.DAILY_API_KEY },
|
||||
dirName: "dailyvideo",
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -21,5 +21,6 @@
|
||||
"description": "Copy your server invite link and start scheduling calls in Discord! Discord is a VoIP and instant messaging social platform. Users have the ability to communicate with voice calls, video calls, text messaging, media and files in private chats or as part of communities.",
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "event-type-location-video-static"
|
||||
"__template": "event-type-location-video-static",
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -22,5 +22,6 @@
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "event-type-location-video-static",
|
||||
"dirName": "eightxeight"
|
||||
"dirName": "eightxeight",
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -22,5 +22,6 @@
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "event-type-location-video-static",
|
||||
"dirName": "element-call"
|
||||
"dirName": "element-call",
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -18,6 +18,7 @@ export const metadata = {
|
||||
url: "https://cal.com/",
|
||||
email: "[email protected]",
|
||||
dirName: "exchange2013calendar",
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -18,6 +18,7 @@ export const metadata = {
|
||||
url: "https://cal.com/",
|
||||
email: "[email protected]",
|
||||
dirName: "exchange2016calendar",
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -12,5 +12,6 @@
|
||||
"publisher": "Cal.com",
|
||||
"email": "[email protected]",
|
||||
"description": "Fetch Microsoft Exchange calendars and availabilities using Exchange Web Services (EWS).",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -21,5 +21,6 @@
|
||||
"urlRegExp": "^https?:\\/\\/facetime\\.apple\\.com\\/join.+$"
|
||||
}
|
||||
},
|
||||
"isTemplate": false
|
||||
"isTemplate": false,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -2,13 +2,12 @@ import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
import type { appDataSchema } from "../zod";
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const trackingId = getAppData("trackingId");
|
||||
const { enabled, updateEnabled } = useIsAppEnabled(app);
|
||||
|
||||
return (
|
||||
@@ -20,14 +19,12 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
}}
|
||||
switchChecked={enabled}
|
||||
teamId={eventType.team?.id || undefined}>
|
||||
<TextField
|
||||
dataTestid={app.slug}
|
||||
name="Tracking ID"
|
||||
value={trackingId}
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
|
||||
getAppData,
|
||||
setAppData,
|
||||
disabled,
|
||||
slug,
|
||||
}) => {
|
||||
const trackingId = getAppData("trackingId");
|
||||
|
||||
return (
|
||||
<TextField
|
||||
dataTestid={slug}
|
||||
name="Tracking ID"
|
||||
value={trackingId}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -23,5 +23,6 @@
|
||||
}
|
||||
},
|
||||
"description": "Fathom Analytics provides simple, privacy-focused website analytics. We're a GDPR-compliant, Google Analytics alternative.",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -2,13 +2,12 @@ import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
import type { appDataSchema } from "../zod";
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const trackingId = getAppData("trackingId");
|
||||
const { enabled, updateEnabled } = useIsAppEnabled(app);
|
||||
|
||||
return (
|
||||
@@ -20,14 +19,12 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
}}
|
||||
switchChecked={enabled}
|
||||
teamId={eventType.team?.id || undefined}>
|
||||
<TextField
|
||||
dataTestid={app.slug}
|
||||
name="Tracking ID"
|
||||
value={trackingId}
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
|
||||
getAppData,
|
||||
setAppData,
|
||||
disabled,
|
||||
}) => {
|
||||
const trackingId = getAppData("trackingId");
|
||||
|
||||
return (
|
||||
<TextField
|
||||
name="Tracking ID"
|
||||
value={trackingId}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -24,5 +24,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -17,6 +17,7 @@ export const metadata = {
|
||||
extendsFeature: "EventType",
|
||||
email: "[email protected]",
|
||||
dirName: "giphy",
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -1,15 +1,14 @@
|
||||
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
|
||||
import { SelectGifInput } from "@calcom/app-store/giphy/components";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
||||
import type { appDataSchema } from "../zod";
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const thankYouPage = getAppData("thankYouPage");
|
||||
const { enabled: showGifSelection, updateEnabled: setShowGifSelection } = useIsAppEnabled(app);
|
||||
|
||||
const { t } = useLocale();
|
||||
@@ -23,15 +22,13 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
}}
|
||||
switchChecked={showGifSelection}
|
||||
teamId={eventType.team?.id || undefined}>
|
||||
{showGifSelection && (
|
||||
<SelectGifInput
|
||||
defaultValue={thankYouPage}
|
||||
disabled={disabled}
|
||||
onChange={(url: string) => {
|
||||
setAppData("thankYouPage", url);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
|
||||
import SelectGifInput from "./SelectGifInput";
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
|
||||
getAppData,
|
||||
setAppData,
|
||||
disabled,
|
||||
}) => {
|
||||
const thankYouPage = getAppData("thankYouPage");
|
||||
|
||||
return (
|
||||
<SelectGifInput
|
||||
defaultValue={thankYouPage}
|
||||
disabled={disabled}
|
||||
onChange={(url: string) => {
|
||||
setAppData("thankYouPage", url);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -18,6 +18,7 @@ export const metadata = {
|
||||
url: "https://cal.com/",
|
||||
email: "[email protected]",
|
||||
dirName: "googlecalendar",
|
||||
isOAuth: true,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -27,6 +27,7 @@ export const metadata = {
|
||||
},
|
||||
dirName: "googlevideo",
|
||||
dependencies: ["google-calendar"],
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -2,13 +2,12 @@ import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
import type { appDataSchema } from "../zod";
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const trackingId = getAppData("trackingId");
|
||||
const { enabled, updateEnabled } = useIsAppEnabled(app);
|
||||
|
||||
return (
|
||||
@@ -20,14 +19,12 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
}}
|
||||
switchChecked={enabled}
|
||||
teamId={eventType.team?.id || undefined}>
|
||||
<TextField
|
||||
dataTestid={app.slug}
|
||||
name="Tracking ID"
|
||||
value={trackingId}
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
|
||||
getAppData,
|
||||
setAppData,
|
||||
disabled,
|
||||
}) => {
|
||||
const trackingId = getAppData("trackingId");
|
||||
|
||||
return (
|
||||
<TextField
|
||||
name="Tracking ID"
|
||||
data-testid="gtm-tracking-id-input"
|
||||
value={trackingId}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -21,5 +21,6 @@
|
||||
},
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "booking-pages-tag"
|
||||
"__template": "booking-pages-tag",
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -17,6 +17,7 @@ export const metadata = {
|
||||
title: "HubSpot CRM",
|
||||
email: "[email protected]",
|
||||
dirName: "hubspot",
|
||||
isOAuth: true,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -28,6 +28,7 @@ export const metadata = {
|
||||
key: { apikey: randomString(12) },
|
||||
dirName: "huddle01video",
|
||||
concurrentMeetings: true,
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -8,6 +8,7 @@ import prisma from "@calcom/prisma";
|
||||
import getAppKeysFromSlug from "../../_utils/getAppKeysFromSlug";
|
||||
import getInstalledAppPath from "../../_utils/getInstalledAppPath";
|
||||
import createOAuthAppCredential from "../../_utils/oauth/createOAuthAppCredential";
|
||||
import { decodeOAuthState } from "../../_utils/oauth/decodeOAuthState";
|
||||
|
||||
const log = logger.getSubLogger({ prefix: [`[[intercom/api/callback]`] });
|
||||
|
||||
@@ -85,6 +86,12 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
req
|
||||
);
|
||||
|
||||
const state = decodeOAuthState(req);
|
||||
|
||||
if (state?.appOnboardingRedirectUrl && state.appOnboardingRedirectUrl !== "") {
|
||||
return res.redirect(state.appOnboardingRedirectUrl);
|
||||
}
|
||||
|
||||
res.redirect(
|
||||
getSafeRedirectUrl(`${WEBAPP_URL}/apps/installed/automation?hl=intercom`) ??
|
||||
getInstalledAppPath({ variant: "automation", slug: "intercom" })
|
||||
|
||||
@@ -13,5 +13,6 @@
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "basic",
|
||||
"dirName": "intercom"
|
||||
"dirName": "intercom",
|
||||
"isOAuth": true
|
||||
}
|
||||
@@ -25,6 +25,7 @@ export const metadata = {
|
||||
},
|
||||
dirName: "jitsivideo",
|
||||
concurrentMeetings: true,
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -16,6 +16,7 @@ export const metadata = {
|
||||
url: "https://larksuite.com/",
|
||||
email: "[email protected]",
|
||||
dirName: "larkcalendar",
|
||||
isOAuth: true,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -14,5 +14,6 @@
|
||||
"__createdUsingCli": true,
|
||||
"__template": "basic",
|
||||
"imageSrc": "icon.svg",
|
||||
"dirName": "make"
|
||||
"dirName": "make",
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -2,13 +2,12 @@ import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
import type { appDataSchema } from "../zod";
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const trackingId = getAppData("trackingId");
|
||||
const { enabled, updateEnabled } = useIsAppEnabled(app);
|
||||
|
||||
return (
|
||||
@@ -18,14 +17,12 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
switchOnClick={updateEnabled}
|
||||
switchChecked={enabled}
|
||||
teamId={eventType.team?.id || undefined}>
|
||||
<TextField
|
||||
dataTestid={app.slug}
|
||||
name="Pixel ID"
|
||||
value={trackingId}
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
|
||||
getAppData,
|
||||
setAppData,
|
||||
disabled,
|
||||
}) => {
|
||||
const trackingId = getAppData("trackingId");
|
||||
|
||||
return (
|
||||
<TextField
|
||||
name="Pixel ID"
|
||||
value={trackingId}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -21,5 +21,6 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -22,5 +22,6 @@
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "event-type-location-video-static",
|
||||
"dirName": "mirotalk"
|
||||
"dirName": "mirotalk",
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -10,5 +10,6 @@
|
||||
"publisher": "Cal.com, Inc.",
|
||||
"email": "[email protected]",
|
||||
"description": "Automate without limits. The workflow automation platform that doesn't box you in, that you never outgrow",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -16,6 +16,7 @@ export const metadata = {
|
||||
dirName: "office365calendar",
|
||||
url: "https://cal.com/",
|
||||
email: "[email protected]",
|
||||
isOAuth: true,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -104,6 +104,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
|
||||
await createOAuthAppCredential({ appId: "msteams", type: "office365_video" }, responseBody, req);
|
||||
|
||||
if (state?.appOnboardingRedirectUrl && state.appOnboardingRedirectUrl !== "") {
|
||||
return res.redirect(state.appOnboardingRedirectUrl);
|
||||
}
|
||||
|
||||
return res.redirect(
|
||||
getSafeRedirectUrl(state?.returnTo) ?? getInstalledAppPath({ variant: "conferencing", slug: "msteams" })
|
||||
);
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
}
|
||||
},
|
||||
"dirName": "office365video",
|
||||
"concurrentMeetings": true
|
||||
"concurrentMeetings": true,
|
||||
"isOAuth": true
|
||||
}
|
||||
@@ -1,23 +1,15 @@
|
||||
import { usePathname, useSearchParams } from "next/navigation";
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import { useState, useMemo } from "react";
|
||||
|
||||
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import {
|
||||
currencyOptions,
|
||||
currencySymbols,
|
||||
isAcceptedCurrencyCode,
|
||||
} from "@calcom/app-store/paypal/lib/currencyOptions";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Alert, Select, TextField } from "@calcom/ui";
|
||||
|
||||
import checkForMultiplePaymentApps from "../../_utils/payments/checkForMultiplePaymentApps";
|
||||
import type { appDataSchema } from "../zod";
|
||||
import { PaypalPaymentOptions as paymentOptions } from "../zod";
|
||||
|
||||
type Option = { value: string; label: string };
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
app,
|
||||
@@ -31,40 +23,13 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
() => `${pathname}${searchParams ? `?${searchParams.toString()}` : ""}`,
|
||||
[pathname, searchParams]
|
||||
);
|
||||
const { getAppData, setAppData } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const price = getAppData("price");
|
||||
|
||||
const currency = getAppData("currency");
|
||||
const [selectedCurrency, setSelectedCurrency] = useState(currencyOptions.find((c) => c.value === currency));
|
||||
const [currencySymbol, setCurrencySymbol] = useState(
|
||||
isAcceptedCurrencyCode(currency) ? currencySymbols[currency] : ""
|
||||
);
|
||||
|
||||
const paymentOption = getAppData("paymentOption");
|
||||
const paymentOptionSelectValue = paymentOptions?.find((option) => paymentOption === option.value) || {
|
||||
label: paymentOptions[0].label,
|
||||
value: paymentOptions[0].value,
|
||||
};
|
||||
const seatsEnabled = !!eventType.seatsPerTimeSlot;
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const [requirePayment, setRequirePayment] = useState(getAppData("enabled"));
|
||||
const { t } = useLocale();
|
||||
const recurringEventDefined = eventType.recurringEvent?.count !== undefined;
|
||||
const otherPaymentAppEnabled = checkForMultiplePaymentApps(eventTypeFormMetadata);
|
||||
const { t } = useLocale();
|
||||
|
||||
const shouldDisableSwitch = !requirePayment && otherPaymentAppEnabled;
|
||||
|
||||
useEffect(() => {
|
||||
if (requirePayment) {
|
||||
if (!getAppData("currency")) {
|
||||
setAppData("currency", currencyOptions[0].value);
|
||||
}
|
||||
if (!getAppData("paymentOption")) {
|
||||
setAppData("paymentOption", paymentOptions[0].value);
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<AppCard
|
||||
returnTo={WEBAPP_URL + asPath}
|
||||
@@ -77,81 +42,13 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
disableSwitch={shouldDisableSwitch}
|
||||
switchTooltip={shouldDisableSwitch ? t("other_payment_app_enabled") : undefined}>
|
||||
<>
|
||||
{recurringEventDefined ? (
|
||||
<Alert className="mt-2" severity="warning" title={t("warning_recurring_event_payment")} />
|
||||
) : (
|
||||
requirePayment && (
|
||||
<>
|
||||
<div className="mt-2 block items-center sm:flex">
|
||||
<TextField
|
||||
label="Price"
|
||||
labelSrOnly
|
||||
addOnLeading={currencySymbol}
|
||||
addOnSuffix={currency}
|
||||
step="0.01"
|
||||
min="0.5"
|
||||
type="number"
|
||||
required
|
||||
className="block w-full rounded-sm pl-2 text-sm"
|
||||
placeholder="Price"
|
||||
data-testid="paypal-price-input"
|
||||
onChange={(e) => {
|
||||
setAppData("price", Number(e.target.value) * 100);
|
||||
if (selectedCurrency) {
|
||||
setAppData("currency", selectedCurrency.value);
|
||||
}
|
||||
}}
|
||||
value={price > 0 ? price / 100 : undefined}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-5 w-60">
|
||||
<label className="text-default mb-1 block text-sm font-medium" htmlFor="currency">
|
||||
{t("currency")}
|
||||
</label>
|
||||
<Select
|
||||
variant="default"
|
||||
data-testid="paypal-currency-select"
|
||||
options={currencyOptions}
|
||||
value={selectedCurrency}
|
||||
className="text-black"
|
||||
defaultValue={selectedCurrency}
|
||||
onChange={(e) => {
|
||||
if (e) {
|
||||
setSelectedCurrency(e);
|
||||
setCurrencySymbol(currencySymbols[e.value]);
|
||||
setAppData("currency", e.value);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 w-60">
|
||||
<label className="text-default mb-1 block text-sm font-medium" htmlFor="currency">
|
||||
Payment option
|
||||
</label>
|
||||
<Select<Option>
|
||||
data-testid="paypal-payment-option-select"
|
||||
defaultValue={
|
||||
paymentOptionSelectValue
|
||||
? { ...paymentOptionSelectValue, label: t(paymentOptionSelectValue.label) }
|
||||
: { ...paymentOptions[0], label: t(paymentOptions[0].label) }
|
||||
}
|
||||
options={paymentOptions.map((option) => {
|
||||
return { ...option, label: t(option.label) || option.label };
|
||||
})}
|
||||
onChange={(input) => {
|
||||
if (input) setAppData("paymentOption", input.value);
|
||||
}}
|
||||
className="mb-1 h-[38px] w-full"
|
||||
isDisabled={seatsEnabled}
|
||||
/>
|
||||
</div>
|
||||
{seatsEnabled && paymentOption === "HOLD" && (
|
||||
<Alert className="mt-2" severity="warning" title={t("seats_and_no_show_fee_error")} />
|
||||
)}
|
||||
</>
|
||||
)
|
||||
)}
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</>
|
||||
</AppCard>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import {
|
||||
currencyOptions,
|
||||
currencySymbols,
|
||||
isAcceptedCurrencyCode,
|
||||
} from "@calcom/app-store/paypal/lib/currencyOptions";
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Alert, Select, TextField } from "@calcom/ui";
|
||||
|
||||
import { PaypalPaymentOptions as paymentOptions } from "../zod";
|
||||
|
||||
type Option = { value: string; label: string };
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
|
||||
getAppData,
|
||||
setAppData,
|
||||
eventType,
|
||||
}) => {
|
||||
const price = getAppData("price");
|
||||
|
||||
const currency = getAppData("currency");
|
||||
const [selectedCurrency, setSelectedCurrency] = useState(currencyOptions.find((c) => c.value === currency));
|
||||
const [currencySymbol, setCurrencySymbol] = useState(
|
||||
isAcceptedCurrencyCode(currency) ? currencySymbols[currency] : ""
|
||||
);
|
||||
|
||||
const paymentOption = getAppData("paymentOption");
|
||||
const paymentOptionSelectValue = paymentOptions?.find((option) => paymentOption === option.value) || {
|
||||
label: paymentOptions[0].label,
|
||||
value: paymentOptions[0].value,
|
||||
};
|
||||
const seatsEnabled = !!eventType.seatsPerTimeSlot;
|
||||
const [requirePayment, setRequirePayment] = useState(getAppData("enabled"));
|
||||
const { t } = useLocale();
|
||||
const recurringEventDefined = eventType.recurringEvent?.count !== undefined;
|
||||
|
||||
useEffect(() => {
|
||||
if (requirePayment) {
|
||||
if (!getAppData("currency")) {
|
||||
setAppData("currency", currencyOptions[0].value);
|
||||
}
|
||||
if (!getAppData("paymentOption")) {
|
||||
setAppData("paymentOption", paymentOptions[0].value);
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (recurringEventDefined) {
|
||||
return <Alert className="mt-2" severity="warning" title={t("warning_recurring_event_payment")} />;
|
||||
}
|
||||
|
||||
if (!requirePayment) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mt-2 block items-center sm:flex">
|
||||
<TextField
|
||||
label="Price"
|
||||
labelSrOnly
|
||||
addOnLeading={currencySymbol}
|
||||
addOnSuffix={currency}
|
||||
step="0.01"
|
||||
min="0.5"
|
||||
type="number"
|
||||
required
|
||||
className="block w-full rounded-sm pl-2 text-sm"
|
||||
placeholder="Price"
|
||||
data-testid="paypal-price-input"
|
||||
onChange={(e) => {
|
||||
setAppData("price", Number(e.target.value) * 100);
|
||||
if (selectedCurrency) {
|
||||
setAppData("currency", selectedCurrency.value);
|
||||
}
|
||||
}}
|
||||
value={price > 0 ? price / 100 : undefined}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-5 w-60">
|
||||
<label className="text-default mb-1 block text-sm font-medium" htmlFor="currency">
|
||||
{t("currency")}
|
||||
</label>
|
||||
<Select
|
||||
variant="default"
|
||||
data-testid="paypal-currency-select"
|
||||
options={currencyOptions}
|
||||
value={selectedCurrency}
|
||||
className="text-black"
|
||||
defaultValue={selectedCurrency}
|
||||
onChange={(e) => {
|
||||
if (e) {
|
||||
setSelectedCurrency(e);
|
||||
setCurrencySymbol(currencySymbols[e.value]);
|
||||
setAppData("currency", e.value);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 w-60">
|
||||
<label className="text-default mb-1 block text-sm font-medium" htmlFor="currency">
|
||||
Payment option
|
||||
</label>
|
||||
<Select<Option>
|
||||
data-testid="paypal-payment-option-select"
|
||||
defaultValue={
|
||||
paymentOptionSelectValue
|
||||
? { ...paymentOptionSelectValue, label: t(paymentOptionSelectValue.label) }
|
||||
: { ...paymentOptions[0], label: t(paymentOptions[0].label) }
|
||||
}
|
||||
options={paymentOptions.map((option) => {
|
||||
return { ...option, label: t(option.label) || option.label };
|
||||
})}
|
||||
onChange={(input) => {
|
||||
if (input) setAppData("paymentOption", input.value);
|
||||
}}
|
||||
className="mb-1 h-[38px] w-full"
|
||||
isDisabled={seatsEnabled}
|
||||
/>
|
||||
</div>
|
||||
{seatsEnabled && paymentOption === "HOLD" && (
|
||||
<Alert className="mt-2" severity="warning" title={t("seats_and_no_show_fee_error")} />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -14,5 +14,6 @@
|
||||
"__createdUsingCli": true,
|
||||
"imageSrc": "icon.svg",
|
||||
"__template": "event-type-app-card",
|
||||
"dirName": "paypal"
|
||||
"dirName": "paypal",
|
||||
"isOAuth": true
|
||||
}
|
||||
@@ -20,5 +20,6 @@
|
||||
"organizerInputPlaceholder": "https://www.ping.gg/call/theo",
|
||||
"urlRegExp": "^http(s)?:\\/\\/(www\\.)?ping.gg\\/call\\/[a-zA-Z0-9]*"
|
||||
}
|
||||
}
|
||||
},
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -10,5 +10,6 @@
|
||||
"publisher": "Pipedream, Inc.",
|
||||
"email": "[email protected]",
|
||||
"description": "Connect APIs, remarkably fast. Stop writing boilerplate code, struggling with authentication and managing infrastructure. Start connecting APIs with code-level control when you need it — and no code when you don't",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -2,14 +2,13 @@ import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
import type { appDataSchema } from "../zod";
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const plausibleUrl = getAppData("PLAUSIBLE_URL");
|
||||
const trackingId = getAppData("trackingId");
|
||||
|
||||
const { enabled, updateEnabled } = useIsAppEnabled(app);
|
||||
|
||||
return (
|
||||
@@ -21,29 +20,13 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
}}
|
||||
switchChecked={enabled}
|
||||
teamId={eventType.team?.id || undefined}>
|
||||
<div className="flex flex-col gap-2">
|
||||
<TextField
|
||||
dataTestid={`${app.slug}-url`}
|
||||
name="Plausible URL"
|
||||
defaultValue="https://plausible.io/js/script.js"
|
||||
placeholder="https://plausible.io/js/script.js"
|
||||
value={plausibleUrl}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("PLAUSIBLE_URL", e.target.value);
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
dataTestid={`${app.slug}-tracking-id`}
|
||||
disabled={disabled}
|
||||
name="Tracked Domain"
|
||||
placeholder="yourdomain.com"
|
||||
value={trackingId}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { TextField } from "@calcom/ui";
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
|
||||
getAppData,
|
||||
setAppData,
|
||||
disabled,
|
||||
slug,
|
||||
}) => {
|
||||
const plausibleUrl = getAppData("PLAUSIBLE_URL");
|
||||
const trackingId = getAppData("trackingId");
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<TextField
|
||||
dataTestid={`${slug}-url`}
|
||||
name="Plausible URL"
|
||||
defaultValue="https://plausible.io/js/script.js"
|
||||
placeholder="https://plausible.io/js/script.js"
|
||||
value={plausibleUrl}
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("PLAUSIBLE_URL", e.target.value);
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
dataTestid={`${slug}-tracking-id`}
|
||||
disabled={disabled}
|
||||
name="Tracked Domain"
|
||||
placeholder="yourdomain.com"
|
||||
value={trackingId}
|
||||
onChange={(e) => {
|
||||
setAppData("trackingId", e.target.value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -23,5 +23,6 @@
|
||||
}
|
||||
},
|
||||
"description": "Simple, privacy-friendly Google Analytics alternative.",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -1,39 +1,14 @@
|
||||
import { useState } from "react";
|
||||
|
||||
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Tooltip, TextField } from "@calcom/ui";
|
||||
|
||||
import type { appDataSchema } from "../zod";
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ eventType, app }) {
|
||||
const { t } = useLocale();
|
||||
const { disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const [additionalParameters, setAdditionalParameters] = useState("");
|
||||
const { enabled, updateEnabled } = useIsAppEnabled(app);
|
||||
|
||||
const query = additionalParameters !== "" ? `?${additionalParameters}` : "";
|
||||
const eventTypeURL = eventType.URL + query;
|
||||
|
||||
function QRCode({ size, data }: { size: number; data: string }) {
|
||||
const QR_URL = `https://api.qrserver.com/v1/create-qr-code/?size=${size}&data=${data}`;
|
||||
return (
|
||||
<Tooltip content={eventTypeURL}>
|
||||
<a download href={QR_URL} target="_blank" rel="noreferrer">
|
||||
<img
|
||||
className="hover:bg-muted border-default border hover:shadow-sm"
|
||||
style={{ padding: size / 16, borderRadius: size / 20 }}
|
||||
width={size}
|
||||
src={QR_URL}
|
||||
alt={eventTypeURL}
|
||||
/>
|
||||
</a>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
const { disabled, getAppData, setAppData } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
|
||||
return (
|
||||
<AppCard
|
||||
@@ -43,24 +18,13 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
}}
|
||||
switchChecked={enabled}
|
||||
teamId={eventType.team?.id || undefined}>
|
||||
<div className="flex w-full flex-col gap-5 text-sm">
|
||||
<div className="flex w-full">
|
||||
<TextField
|
||||
name="hello"
|
||||
disabled={disabled}
|
||||
value={additionalParameters}
|
||||
onChange={(e) => setAdditionalParameters(e.target.value)}
|
||||
label={t("additional_url_parameters")}
|
||||
containerClassName="w-full"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="max-w-60 flex items-baseline gap-2">
|
||||
<QRCode size={256} data={eventTypeURL} />
|
||||
<QRCode size={128} data={eventTypeURL} />
|
||||
<QRCode size={64} data={eventTypeURL} />
|
||||
</div>
|
||||
</div>
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import { useState } from "react";
|
||||
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { classNames } from "@calcom/lib";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { TextField, Tooltip } from "@calcom/ui";
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({ eventType, disabled }) => {
|
||||
const { t } = useLocale();
|
||||
const [additionalParameters, setAdditionalParameters] = useState("");
|
||||
const query = additionalParameters !== "" ? `?${additionalParameters}` : "";
|
||||
const eventTypeURL = eventType.URL + query;
|
||||
|
||||
function QRCode({ size, data }: { size: number; data: string }) {
|
||||
const QR_URL = `https://api.qrserver.com/v1/create-qr-code/?size=${size}&data=${data}`;
|
||||
return (
|
||||
<Tooltip content={eventTypeURL}>
|
||||
<a download href={QR_URL} target="_blank" rel="noreferrer">
|
||||
<img
|
||||
className={classNames(
|
||||
"hover:bg-muted border-default border hover:shadow-sm",
|
||||
size >= 256 && "min-h-32"
|
||||
)}
|
||||
style={{ padding: size / 16, borderRadius: size / 20 }}
|
||||
width={size}
|
||||
src={QR_URL}
|
||||
alt={eventTypeURL}
|
||||
/>
|
||||
</a>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="flex w-full flex-col gap-5 text-sm">
|
||||
<div className="flex w-full">
|
||||
<TextField
|
||||
name="hello"
|
||||
disabled={disabled}
|
||||
value={additionalParameters}
|
||||
onChange={(e) => setAdditionalParameters(e.target.value)}
|
||||
label={t("additional_url_parameters")}
|
||||
containerClassName="w-full"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="max-w-60 flex items-baseline gap-2">
|
||||
<QRCode size={256} data={eventTypeURL} />
|
||||
<QRCode size={128} data={eventTypeURL} />
|
||||
<QRCode size={64} data={eventTypeURL} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -11,5 +11,6 @@
|
||||
"publisher": "Cal.com, Inc.",
|
||||
"email": "[email protected]",
|
||||
"description": "Easily generate a QR code for your links to print, share, or embed.",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -10,5 +10,6 @@
|
||||
"publisher": "Eric Luce",
|
||||
"email": "[email protected]",
|
||||
"description": "Quickly share your Cal.com meeting links with Raycast",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -18,5 +18,6 @@
|
||||
"type": "integrations:riverside_video",
|
||||
"linkType": "static"
|
||||
}
|
||||
}
|
||||
},
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -17,5 +17,6 @@
|
||||
"upgradeUrl": "/routing-forms/forms"
|
||||
},
|
||||
"description": "It would allow a booker to connect with the right person or choose the right event, faster. It would work by taking inputs from the booker and using that data to route to the correct booker/event as configured by Cal user",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -42,6 +42,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
await createOAuthAppCredential({ appId: appConfig.slug, type: appConfig.type }, salesforceTokenInfo, req);
|
||||
|
||||
const state = decodeOAuthState(req);
|
||||
|
||||
if (state?.appOnboardingRedirectUrl && state.appOnboardingRedirectUrl !== "") {
|
||||
return res.redirect(state.appOnboardingRedirectUrl);
|
||||
}
|
||||
|
||||
res.redirect(
|
||||
getSafeRedirectUrl(state?.returnTo) ?? getInstalledAppPath({ variant: "other", slug: "salesforce" })
|
||||
);
|
||||
|
||||
@@ -10,5 +10,6 @@
|
||||
"publisher": "Cal.com, Inc.",
|
||||
"email": "[email protected]",
|
||||
"description": "Salesforce (Sales Cloud) is a cloud-based application designed to help your salespeople sell smarter and faster by centralizing customer information, logging their interactions with your company, and automating many of the tasks salespeople do every day.",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": true
|
||||
}
|
||||
@@ -10,5 +10,6 @@
|
||||
"publisher": "Cal.com, Inc.",
|
||||
"email": "[email protected]",
|
||||
"description": "SendGrid delivers your transactional and marketing emails through the world's largest cloud-based email delivery platform.",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -19,5 +19,6 @@
|
||||
"organizerInputPlaceholder": "https://signal.me/#p/+11234567890",
|
||||
"urlRegExp": "^http(s)?:\\/\\/(www\\.)?signal.me\\/[a-zA-Z0-9]*"
|
||||
}
|
||||
}
|
||||
},
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -19,5 +19,6 @@
|
||||
"organizerInputPlaceholder": "https://sirius.video/sebastian",
|
||||
"urlRegExp": "^http(s)?:\\/\\/(www\\.)?sirius.video\\/[a-zA-Z0-9]*"
|
||||
}
|
||||
}
|
||||
},
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -23,6 +23,7 @@ export const metadata = {
|
||||
extendsFeature: "EventType",
|
||||
email: "[email protected]",
|
||||
dirName: "stripepayment",
|
||||
isOAuth: true,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -53,6 +53,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
req
|
||||
);
|
||||
|
||||
if (state?.appOnboardingRedirectUrl && state.appOnboardingRedirectUrl !== "") {
|
||||
return res.redirect(state.appOnboardingRedirectUrl);
|
||||
}
|
||||
|
||||
const returnTo = getReturnToValueFromQueryState(req);
|
||||
res.redirect(returnTo || getInstalledAppPath({ variant: "payment", slug: "stripe" }));
|
||||
}
|
||||
@@ -1,157 +1,48 @@
|
||||
import { usePathname } from "next/navigation";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Alert, Select, TextField } from "@calcom/ui";
|
||||
|
||||
import checkForMultiplePaymentApps from "../../_utils/payments/checkForMultiplePaymentApps";
|
||||
import { paymentOptions } from "../lib/constants";
|
||||
import {
|
||||
convertToSmallestCurrencyUnit,
|
||||
convertFromSmallestToPresentableCurrencyUnit,
|
||||
} from "../lib/currencyConversions";
|
||||
import { currencyOptions } from "../lib/currencyOptions";
|
||||
import useIsAppEnabled from "../../_utils/useIsAppEnabled";
|
||||
import type { appDataSchema } from "../zod";
|
||||
|
||||
type Option = { value: string; label: string };
|
||||
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
|
||||
|
||||
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||
app,
|
||||
eventType,
|
||||
eventTypeFormMetadata,
|
||||
}) {
|
||||
const { t } = useLocale();
|
||||
const pathname = usePathname();
|
||||
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const price = getAppData("price");
|
||||
const currency = getAppData("currency") || currencyOptions[0].value;
|
||||
const [selectedCurrency, setSelectedCurrency] = useState(
|
||||
currencyOptions.find((c) => c.value === currency) || {
|
||||
label: currencyOptions[0].label,
|
||||
value: currencyOptions[0].value,
|
||||
}
|
||||
);
|
||||
const paymentOption = getAppData("paymentOption");
|
||||
const paymentOptionSelectValue = paymentOptions.find((option) => paymentOption === option.value);
|
||||
const [requirePayment, setRequirePayment] = useState(getAppData("enabled"));
|
||||
const { enabled, updateEnabled } = useIsAppEnabled(app);
|
||||
const otherPaymentAppEnabled = checkForMultiplePaymentApps(eventTypeFormMetadata);
|
||||
|
||||
const [requirePayment, setRequirePayment] = useState(getAppData("enabled"));
|
||||
const shouldDisableSwitch = !requirePayment && otherPaymentAppEnabled;
|
||||
|
||||
const { t } = useLocale();
|
||||
const recurringEventDefined = eventType.recurringEvent?.count !== undefined;
|
||||
const seatsEnabled = !!eventType.seatsPerTimeSlot;
|
||||
const getCurrencySymbol = (locale: string, currency: string) =>
|
||||
(0)
|
||||
.toLocaleString(locale, {
|
||||
style: "currency",
|
||||
currency,
|
||||
minimumFractionDigits: 0,
|
||||
maximumFractionDigits: 0,
|
||||
})
|
||||
.replace(/\d/g, "")
|
||||
.trim();
|
||||
|
||||
useEffect(() => {
|
||||
if (requirePayment) {
|
||||
if (!getAppData("currency")) {
|
||||
setAppData("currency", currencyOptions[0].value);
|
||||
}
|
||||
if (!getAppData("paymentOption")) {
|
||||
setAppData("paymentOption", paymentOptions[0].value);
|
||||
}
|
||||
}
|
||||
}, [requirePayment, getAppData, setAppData]);
|
||||
|
||||
return (
|
||||
<AppCard
|
||||
returnTo={`${WEBAPP_URL}${pathname}?tabName=apps`}
|
||||
app={app}
|
||||
switchChecked={requirePayment}
|
||||
switchOnClick={(enabled) => {
|
||||
setRequirePayment(enabled);
|
||||
switchChecked={enabled}
|
||||
switchOnClick={(e) => {
|
||||
updateEnabled(e);
|
||||
}}
|
||||
teamId={eventType.team?.id || undefined}
|
||||
disableSwitch={shouldDisableSwitch}
|
||||
switchTooltip={shouldDisableSwitch ? t("other_payment_app_enabled") : undefined}>
|
||||
<>
|
||||
{recurringEventDefined && (
|
||||
<Alert className="mt-2" severity="warning" title={t("warning_recurring_event_payment")} />
|
||||
)}
|
||||
{!recurringEventDefined && requirePayment && (
|
||||
<>
|
||||
<div className="mt-4 block items-center justify-start sm:flex sm:space-x-2">
|
||||
<TextField
|
||||
data-testid="stripe-price-input"
|
||||
label={t("price")}
|
||||
className="h-[38px]"
|
||||
addOnLeading={
|
||||
<>{selectedCurrency.value ? getCurrencySymbol("en", selectedCurrency.value) : ""}</>
|
||||
}
|
||||
addOnSuffix={currency.toUpperCase()}
|
||||
addOnClassname="h-[38px]"
|
||||
step="0.01"
|
||||
min="0.5"
|
||||
type="number"
|
||||
required
|
||||
placeholder="Price"
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("price", convertToSmallestCurrencyUnit(Number(e.target.value), currency));
|
||||
}}
|
||||
value={price > 0 ? convertFromSmallestToPresentableCurrencyUnit(price, currency) : undefined}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-5 w-60">
|
||||
<label className="text-default mb-1 block text-sm font-medium" htmlFor="currency">
|
||||
{t("currency")}
|
||||
</label>
|
||||
<Select
|
||||
data-testid="stripe-currency-select"
|
||||
variant="default"
|
||||
options={currencyOptions}
|
||||
value={selectedCurrency}
|
||||
className="text-black"
|
||||
defaultValue={selectedCurrency}
|
||||
onChange={(e) => {
|
||||
if (e) {
|
||||
setSelectedCurrency(e);
|
||||
setAppData("currency", e.value);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-4 w-60">
|
||||
<label className="text-default mb-1 block text-sm font-medium" htmlFor="currency">
|
||||
Payment option
|
||||
</label>
|
||||
<Select<Option>
|
||||
data-testid="stripe-payment-option-select"
|
||||
defaultValue={
|
||||
paymentOptionSelectValue
|
||||
? { ...paymentOptionSelectValue, label: t(paymentOptionSelectValue.label) }
|
||||
: { ...paymentOptions[0], label: t(paymentOptions[0].label) }
|
||||
}
|
||||
options={paymentOptions.map((option) => {
|
||||
return { ...option, label: t(option.label) || option.label };
|
||||
})}
|
||||
onChange={(input) => {
|
||||
if (input) setAppData("paymentOption", input.value);
|
||||
}}
|
||||
className="mb-1 h-[38px] w-full"
|
||||
isDisabled={seatsEnabled || disabled}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{seatsEnabled && paymentOption === "HOLD" && (
|
||||
<Alert className="mt-2" severity="warning" title={t("seats_and_no_show_fee_error")} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
<EventTypeAppSettingsInterface
|
||||
eventType={eventType}
|
||||
slug={app.slug}
|
||||
disabled={disabled}
|
||||
getAppData={getAppData}
|
||||
setAppData={setAppData}
|
||||
/>
|
||||
</AppCard>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Alert, Select, TextField } from "@calcom/ui";
|
||||
|
||||
import { paymentOptions } from "../lib/constants";
|
||||
import {
|
||||
convertToSmallestCurrencyUnit,
|
||||
convertFromSmallestToPresentableCurrencyUnit,
|
||||
} from "../lib/currencyConversions";
|
||||
import { currencyOptions } from "../lib/currencyOptions";
|
||||
|
||||
type Option = { value: string; label: string };
|
||||
|
||||
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
|
||||
getAppData,
|
||||
setAppData,
|
||||
disabled,
|
||||
eventType,
|
||||
}) => {
|
||||
const price = getAppData("price");
|
||||
const currency = getAppData("currency") || currencyOptions[0].value;
|
||||
const [selectedCurrency, setSelectedCurrency] = useState(
|
||||
currencyOptions.find((c) => c.value === currency) || {
|
||||
label: currencyOptions[0].label,
|
||||
value: currencyOptions[0].value,
|
||||
}
|
||||
);
|
||||
const paymentOption = getAppData("paymentOption");
|
||||
const paymentOptionSelectValue = paymentOptions.find((option) => paymentOption === option.value);
|
||||
const requirePayment = getAppData("enabled");
|
||||
|
||||
const { t } = useLocale();
|
||||
const recurringEventDefined = eventType.recurringEvent?.count !== undefined;
|
||||
const seatsEnabled = !!eventType.seatsPerTimeSlot;
|
||||
const getCurrencySymbol = (locale: string, currency: string) =>
|
||||
(0)
|
||||
.toLocaleString(locale, {
|
||||
style: "currency",
|
||||
currency,
|
||||
minimumFractionDigits: 0,
|
||||
maximumFractionDigits: 0,
|
||||
})
|
||||
.replace(/\d/g, "")
|
||||
.trim();
|
||||
|
||||
useEffect(() => {
|
||||
if (requirePayment) {
|
||||
if (!getAppData("currency")) {
|
||||
setAppData("currency", currencyOptions[0].value);
|
||||
}
|
||||
if (!getAppData("paymentOption")) {
|
||||
setAppData("paymentOption", paymentOptions[0].value);
|
||||
}
|
||||
}
|
||||
}, [requirePayment, getAppData, setAppData]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{recurringEventDefined && (
|
||||
<Alert className="mt-2" severity="warning" title={t("warning_recurring_event_payment")} />
|
||||
)}
|
||||
{!recurringEventDefined && requirePayment && (
|
||||
<>
|
||||
<div className="mt-4 block items-center justify-start sm:flex sm:space-x-2">
|
||||
<TextField
|
||||
data-testid="stripe-price-input"
|
||||
label={t("price")}
|
||||
className="h-[38px]"
|
||||
addOnLeading={
|
||||
<>{selectedCurrency.value ? getCurrencySymbol("en", selectedCurrency.value) : ""}</>
|
||||
}
|
||||
addOnSuffix={currency.toUpperCase()}
|
||||
addOnClassname="h-[38px]"
|
||||
step="0.01"
|
||||
min="0.5"
|
||||
type="number"
|
||||
required
|
||||
placeholder="Price"
|
||||
disabled={disabled}
|
||||
onChange={(e) => {
|
||||
setAppData("price", convertToSmallestCurrencyUnit(Number(e.target.value), currency));
|
||||
}}
|
||||
value={price > 0 ? convertFromSmallestToPresentableCurrencyUnit(price, currency) : undefined}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-5 w-60">
|
||||
<label className="text-default mb-1 block text-sm font-medium" htmlFor="currency">
|
||||
{t("currency")}
|
||||
</label>
|
||||
<Select
|
||||
data-testid="stripe-currency-select"
|
||||
variant="default"
|
||||
options={currencyOptions}
|
||||
value={selectedCurrency}
|
||||
className="text-black"
|
||||
defaultValue={selectedCurrency}
|
||||
onChange={(e) => {
|
||||
if (e) {
|
||||
setSelectedCurrency(e);
|
||||
setAppData("currency", e.value);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-4 w-60">
|
||||
<label className="text-default mb-1 block text-sm font-medium" htmlFor="currency">
|
||||
Payment option
|
||||
</label>
|
||||
<Select<Option>
|
||||
data-testid="stripe-payment-option-select"
|
||||
defaultValue={
|
||||
paymentOptionSelectValue
|
||||
? { ...paymentOptionSelectValue, label: t(paymentOptionSelectValue.label) }
|
||||
: { ...paymentOptions[0], label: t(paymentOptions[0].label) }
|
||||
}
|
||||
options={paymentOptions.map((option) => {
|
||||
return { ...option, label: t(option.label) || option.label };
|
||||
})}
|
||||
onChange={(input) => {
|
||||
if (input) setAppData("paymentOption", input.value);
|
||||
}}
|
||||
className="mb-1 h-[38px] w-full"
|
||||
isDisabled={seatsEnabled || disabled}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{seatsEnabled && paymentOption === "HOLD" && (
|
||||
<Alert className="mt-2" severity="warning" title={t("seats_and_no_show_fee_error")} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventTypeAppSettingsInterface;
|
||||
@@ -18,5 +18,6 @@
|
||||
"type": "integrations:sylaps_video",
|
||||
"label": "Sylaps"
|
||||
}
|
||||
}
|
||||
},
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -24,6 +24,7 @@ export const metadata = {
|
||||
},
|
||||
},
|
||||
dirName: "tandemvideo",
|
||||
isOAuth: true,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -10,5 +10,6 @@
|
||||
"publisher": "Cal.com, Inc.",
|
||||
"email": "[email protected]",
|
||||
"description": "Adds a link to copy Typeform Redirect URL",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
Vendored
+20
@@ -10,6 +10,7 @@ export type IntegrationOAuthCallbackState = {
|
||||
onErrorReturnTo: string;
|
||||
fromApp: boolean;
|
||||
installGoogleVideo?: boolean;
|
||||
appOnboardingRedirectUrl?: string;
|
||||
teamId?: number;
|
||||
};
|
||||
|
||||
@@ -56,4 +57,23 @@ export type EventTypeAppCardComponentProps = {
|
||||
LockedIcon?: JSX.Element | false;
|
||||
eventTypeFormMetadata?: z.infer<typeof EventTypeFormMetadataSchema>;
|
||||
};
|
||||
|
||||
export type EventTypeAppSettingsComponentProps = {
|
||||
// Limit what data should be accessible to apps\
|
||||
eventType: Pick<
|
||||
z.infer<typeof EventTypeModel>,
|
||||
"id" | "title" | "description" | "teamId" | "length" | "recurringEvent" | "seatsPerTimeSlot" | "team"
|
||||
> & {
|
||||
URL: string;
|
||||
};
|
||||
getAppData: GetAppData;
|
||||
setAppData: SetAppData;
|
||||
disabled?: boolean;
|
||||
slug: string;
|
||||
};
|
||||
|
||||
export type EventTypeAppCardComponent = React.FC<EventTypeAppCardComponentProps>;
|
||||
|
||||
export type EventTypeAppSettingsComponent = React.FC<EventTypeAppSettingsComponentProps>;
|
||||
|
||||
export type EventTypeModel = z.infer<typeof EventTypeModel>;
|
||||
@@ -11,5 +11,6 @@
|
||||
"email": "[email protected]",
|
||||
"description": "The world's fastest calendar, beautifully designed for a remote world\r",
|
||||
"__createdUsingCli": true,
|
||||
"dependencies": ["google-calendar"]
|
||||
"dependencies": ["google-calendar"],
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -18,6 +18,7 @@ export const metadata = {
|
||||
variant: "other",
|
||||
email: "[email protected]",
|
||||
dirName: "vital",
|
||||
isOAuth: true,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -10,5 +10,6 @@
|
||||
"publisher": "Andreas Vejnø Andersen",
|
||||
"email": "[email protected]",
|
||||
"description": "Get the local weather forecast with icons in your calendar\r\r",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isOAuth": false
|
||||
}
|
||||
@@ -22,5 +22,6 @@
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "basic",
|
||||
"concurrentMeetings": true
|
||||
"concurrentMeetings": true,
|
||||
"isAuth": true
|
||||
}
|
||||
@@ -19,5 +19,6 @@
|
||||
"organizerInputPlaceholder": "https://wa.me/send?phone=1234567890",
|
||||
"urlRegExp": "^http(s)?:\\/\\/(www\\.)?wa.me\\/[a-zA-Z0-9]*"
|
||||
}
|
||||
}
|
||||
},
|
||||
"isAuth": false
|
||||
}
|
||||
@@ -20,5 +20,6 @@
|
||||
"organizerInputPlaceholder": "https://www.whereby.com/cal",
|
||||
"urlRegExp": "^(?:https?://)?(?:(?!.*-\\.)(?:\\w+(-\\w+)*\\.))*whereby\\.com(/[\\w\\-._~:?#\\[\\]@!$&'()*+,;%=]+)*$"
|
||||
}
|
||||
}
|
||||
},
|
||||
"isAuth": false
|
||||
}
|
||||
@@ -18,6 +18,7 @@ export const metadata = {
|
||||
variant: "other",
|
||||
email: "[email protected]",
|
||||
dirName: "wipemycalother",
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -10,5 +10,6 @@
|
||||
"publisher": "Cal.com, Inc.",
|
||||
"email": "[email protected]",
|
||||
"description": "Embedded booking pages right into your wordpress page",
|
||||
"__createdUsingCli": true
|
||||
"__createdUsingCli": true,
|
||||
"isAuth": false
|
||||
}
|
||||
@@ -17,6 +17,7 @@ export const metadata = {
|
||||
variant: "automation",
|
||||
email: "[email protected]",
|
||||
dirName: "zapier",
|
||||
isOAuth: false,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -55,6 +55,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
await createOAuthAppCredential({ appId: appConfig.slug, type: appConfig.type }, tokenInfo.data, req);
|
||||
|
||||
const state = decodeOAuthState(req);
|
||||
|
||||
if (state?.appOnboardingRedirectUrl && state.appOnboardingRedirectUrl !== "") {
|
||||
return res.redirect(state.appOnboardingRedirectUrl);
|
||||
}
|
||||
|
||||
res.redirect(
|
||||
getSafeRedirectUrl(state?.returnTo) ??
|
||||
getInstalledAppPath({ variant: appConfig.variant, slug: appConfig.slug })
|
||||
|
||||
@@ -13,5 +13,6 @@
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "basic",
|
||||
"scope": "ZohoBigin.modules.events.ALL,ZohoBigin.modules.contacts.ALL"
|
||||
"scope": "ZohoBigin.modules.events.ALL,ZohoBigin.modules.contacts.ALL",
|
||||
"isOAuth": true
|
||||
}
|
||||
@@ -10,5 +10,6 @@
|
||||
"logo": "icon.svg",
|
||||
"publisher": "Cal.com",
|
||||
"url": "https://cal.com/",
|
||||
"email": "[email protected]"
|
||||
"email": "[email protected]",
|
||||
"isAuth": true
|
||||
}
|
||||
@@ -55,6 +55,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
await createOAuthAppCredential({ appId: appConfig.slug, type: appConfig.type }, zohoCrmTokenInfo.data, req);
|
||||
|
||||
const state = decodeOAuthState(req);
|
||||
|
||||
if (state?.appOnboardingRedirectUrl && state.appOnboardingRedirectUrl !== "") {
|
||||
return res.redirect(state.appOnboardingRedirectUrl);
|
||||
}
|
||||
|
||||
res.redirect(
|
||||
getSafeRedirectUrl(state?.returnTo) ?? getInstalledAppPath({ variant: "other", slug: "zohocrm" })
|
||||
);
|
||||
|
||||
@@ -12,5 +12,6 @@
|
||||
"description": "Zoho CRM is a cloud-based application designed to help your salespeople sell smarter and faster by centralizing customer information, logging their interactions with your company, and automating many of the tasks salespeople do every day",
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "basic"
|
||||
"__template": "basic",
|
||||
"isOAuth": true
|
||||
}
|
||||
@@ -25,6 +25,7 @@ export const metadata = {
|
||||
},
|
||||
},
|
||||
dirName: "zoomvideo",
|
||||
isOAuth: true,
|
||||
} as AppMeta;
|
||||
|
||||
export default metadata;
|
||||
@@ -0,0 +1,5 @@
|
||||
export enum AppOnboardingSteps {
|
||||
ACCOUNTS_STEP = "accounts",
|
||||
EVENT_TYPES_STEP = "event-types",
|
||||
CONFIGURE_STEP = "configure",
|
||||
}
|
||||
Loaded 100 of 125 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user