The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
move the oauth-apps to new layout
Kiran K9e026920cfce
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page.tsxdeleted file mode 100644index f9559f4881..0000000000--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page.tsx+++ /dev/null@@ -1,11 +0,0 @@-import IntegrationManagePageClient from "./page-client";--export default function IntegrationManagePage({- params,-}: {- params: { integrationId: string };-}) {- const { integrationId } = params;-- return <IntegrationManagePageClient integrationId={integrationId} />;-}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/page-client.tsxdeleted file mode 100644index f6688cc567..0000000000--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/page-client.tsx+++ /dev/null@@ -1,73 +0,0 @@-"use client";--import useWorkspace from "@/lib/swr/use-workspace";-import { OAuthAppProps } from "@/lib/types";-import OAuthAppPlaceholder from "@/ui/integrations/oauth-app-placeholder";-import EmptyState from "@/ui/shared/empty-state";-import { MaxWidthWrapper, buttonVariants } from "@dub/ui";-import { HexadecagonStar } from "@dub/ui/src/icons";-import { cn, fetcher } from "@dub/utils";-import Link from "next/link";-import { redirect } from "next/navigation";-import useSWR from "swr";-import OAuthAppCard from "../../../../../../ui/integrations/oauth-app-card";--export default function IntegrationConsolePageClient() {- const { slug, id: workspaceId, flags } = useWorkspace();-- if (!flags?.integrations) {- redirect(`/${slug}`);- }-- const { data: integrations, isLoading } = useSWR<OAuthAppProps[]>(- `/api/oauth/apps?workspaceId=${workspaceId}`,- fetcher,- );-- return (- <>- <div className="flex h-36 w-full items-center border-b border-gray-200 bg-white">- <MaxWidthWrapper>- <div className="flex items-center justify-between">- <h1 className="text-2xl font-semibold tracking-tight text-black">- My Integrations- </h1>- <div className="flex gap-2">- <Link- href={`/${slug}/integrations/new`}- className={cn(- buttonVariants({ variant: "primary" }),- "flex h-10 items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm",- )}- >- Create Integration- </Link>- </div>- </div>- </MaxWidthWrapper>- </div>-- <MaxWidthWrapper className="flex flex-col gap-3 py-4">- {integrations && integrations.length === 0 ? (- <div className="flex w-full items-center justify-center rounded-xl border border-gray-200 bg-white py-10">- <EmptyState- icon={HexadecagonStar}- title="No integrations found"- description="You haven't added any integrations yet."- />- </div>- ) : (- <div className="grid gap-4">- {isLoading || !integrations- ? Array.from({ length: 3 }).map((_, i) => (- <OAuthAppPlaceholder key={i} />- ))- : integrations.map((integration) => (- <OAuthAppCard key={integration.id} {...integration} />- ))}- </div>- )}- </MaxWidthWrapper>- </>- );-}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/page.tsxdeleted file mode 100644index 73a9ffafa4..0000000000--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/page.tsx+++ /dev/null@@ -1,5 +0,0 @@-import IntegrationConsolePageClient from "./page-client";--export default async function IntegrationConsolePage() {- return <IntegrationConsolePageClient />;-}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/new/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/new/page-client.tsxdeleted file mode 100644index bf6cb0af94..0000000000--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/new/page-client.tsx+++ /dev/null@@ -1,45 +0,0 @@-"use client";--import useWorkspace from "@/lib/swr/use-workspace";-import { buttonVariants, MaxWidthWrapper } from "@dub/ui";-import { cn } from "@dub/utils";-import Link from "next/link";-import { redirect } from "next/navigation";-import AddEditIntegrationForm from "../../../../../../ui/integrations/add-edit-integration-form";--export default function NewIntegrationPageClient() {- const { slug: workspaceSlug, flags } = useWorkspace();-- if (!flags?.integrations) {- redirect(`/${workspaceSlug}`);- }-- return (- <>- <div className="flex h-36 w-full items-center border-b border-gray-200 bg-white">- <MaxWidthWrapper>- <div className="flex items-center justify-between">- <h1 className="text-2xl font-semibold tracking-tight text-black">- Integrations- </h1>- <div className="flex gap-2">- <Link- href={`/${workspaceSlug}/integrations/manage`}- className={cn(- buttonVariants({ variant: "secondary" }),- "flex h-10 items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm",- )}- >- My Integrations- </Link>- </div>- </div>- </MaxWidthWrapper>- </div>-- <MaxWidthWrapper className="my-10 grid max-w-screen-lg gap-8">- <AddEditIntegrationForm integration={null} />- </MaxWidthWrapper>- </>- );-}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/new/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/new/page.tsxdeleted file mode 100644index 9405d0e4bf..0000000000--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/new/page.tsx+++ /dev/null@@ -1,5 +0,0 @@-import NewIntegrationPageClient from "./page-client";--export default async function IntegrationsPage() {- return <NewIntegrationPageClient />;-}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/page-client.tsxindex 94274a4043..4589e09fdf 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/page-client.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/page-client.tsx@@ -2,7 +2,7 @@import useWorkspace from "@/lib/swr/use-workspace";import { InstalledIntegrationProps } from "@/lib/types";-import IntegrationCard from "@/ui/integrations/integration-card";+import IntegrationCard from "@/ui/oauth-apps/integration-card";import { redirect } from "next/navigation";export default function IntegrationsPageClient({diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/page.tsxindex 58a590f6e5..1cf29e5fdf 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/page.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/page.tsx@@ -1,5 +1,5 @@import { prisma } from "@/lib/prisma";-import OAuthAppPlaceholder from "@/ui/integrations/oauth-app-placeholder";+import OAuthAppPlaceholder from "@/ui/oauth-apps/oauth-app-placeholder";import { MaxWidthWrapper } from "@dub/ui";import { Suspense } from "react";import IntegrationsPageClient from "./page-client";diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/[appId]/page-client.tsxsimilarity index 72%rename from apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page-client.tsxrename to apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/[appId]/page-client.tsxindex 62dfe44e7c..776a71dc99 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page-client.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/[appId]/page-client.tsx@@ -3,9 +3,9 @@import { generateClientSecret } from "@/lib/actions/generate-client-secret";import useWorkspace from "@/lib/swr/use-workspace";import { OAuthAppProps } from "@/lib/types";-import AddEditIntegrationForm from "@/ui/integrations/add-edit-integration-form";-import OAuthAppCredentials from "@/ui/integrations/oauth-app-credentials";-import { useRemoveIntegrationModal } from "@/ui/modals/remove-integration-modal";+import { useRemoveOAuthAppModal } from "@/ui/modals/remove-oauth-app-modal";+import AddOAuthAppForm from "@/ui/oauth-apps/add-edit-app-form";+import OAuthAppCredentials from "@/ui/oauth-apps/oauth-app-credentials";import { ThreeDots } from "@/ui/shared/icons";import {BlurImage,@@ -23,45 +23,44 @@ import { useState } from "react";import { toast } from "sonner";import useSWR from "swr";-export default function IntegrationManagePageClient({- integrationId,-}: {- integrationId: string;-}) {+export default function OAuthAppManagePageClient({ appId }: { appId: string }) {const searchParams = useSearchParams();const { slug, id: workspaceId } = useWorkspace();const [openPopover, setOpenPopover] = useState(false);const { executeAsync, result, status } = useAction(generateClientSecret);- const { data: integration, isLoading } = useSWR<OAuthAppProps>(- `/api/oauth/apps/${integrationId}?workspaceId=${workspaceId}`,++ const { data: oAuthApp, isLoading } = useSWR<OAuthAppProps>(+ `/api/oauth/apps/${appId}?workspaceId=${workspaceId}`,fetcher,);- const { RemoveIntegrationModal, setShowRemoveIntegrationModal } =- useRemoveIntegrationModal({- integration,+ const { RemoveOAuthAppModal, setShowRemoveOAuthAppModal } =+ useRemoveOAuthAppModal({+ oAuthApp,});- if (!isLoading && !integration) {+ if (!isLoading && !oAuthApp) {return notFound();}return (<>- <MaxWidthWrapper className="my-10 grid max-w-screen-lg gap-8">- <RemoveIntegrationModal />+ <MaxWidthWrapper className="grid max-w-screen-lg gap-8">+ <RemoveOAuthAppModal /><Link- href={`/${slug}/integrations/manage`}+ href={`/${slug}/settings/oauth-apps`}className="flex items-center gap-x-1"><ChevronLeft className="size-4" />- <p className="text-sm font-medium text-gray-500">My Integrations</p>+ <p className="text-sm font-medium text-gray-500">+ Back to OAuth Apps+ </p></Link><div className="flex justify-between">{isLoading ? (<div className="flex items-center gap-x-3"><div className="rounded-md border border-gray-200 bg-gradient-to-t from-gray-100 p-2">- <TokenAvatar id="placeholder-integration" className="size-8" />+ <TokenAvatar id="placeholder-oauth-app" className="size-8" /></div><div className="flex flex-col gap-2"><div className="h-3 w-20 rounded-full bg-gray-100"></div>@@ -71,25 +70,21 @@ export default function IntegrationManagePageClient({) : (<div className="flex items-center gap-x-3"><div className="rounded-md border border-gray-200 bg-gradient-to-t from-gray-100 p-2">- {integration?.logo ? (+ {oAuthApp?.logo ? (<BlurImage- src={integration.logo}- alt={`Logo for ${integration.name}`}+ src={oAuthApp.logo}+ alt={`Logo for ${oAuthApp.name}`}className="size-8 rounded-full border border-gray-200"width={20}height={20}/>) : (- <TokenAvatar id={integration?.clientId!} className="size-8" />+ <TokenAvatar id={oAuthApp?.clientId!} className="size-8" />)}</div><div>- <p className="font-semibold text-gray-700">- {integration?.name}- </p>- <p className="text-sm text-gray-500">- {integration?.description}- </p>+ <p className="font-semibold text-gray-700">{oAuthApp?.name}</p>+ <p className="text-sm text-gray-500">{oAuthApp?.description}</p></div></div>)}@@ -111,7 +106,7 @@ export default function IntegrationManagePageClient({onClick={async () => {await executeAsync({workspaceId: workspaceId!,- integrationId,+ integrationId: appId,});if (status === "hasSucceeded") {@@ -124,12 +119,12 @@ export default function IntegrationManagePageClient({}}/><Button- text="Remove Integration"+ text="Remove application"variant="danger-outline"icon={<Trash className="h-4 w-4" />}className="h-9 justify-start px-2"onClick={() => {- setShowRemoveIntegrationModal(true);+ setShowRemoveOAuthAppModal(true);}}/></div>@@ -152,19 +147,19 @@ export default function IntegrationManagePageClient({</MaxWidthWrapper><MaxWidthWrapper className="max-w-screen-lg space-y-6">- {integration && (+ {oAuthApp && (<><OAuthAppCredentials- clientId={integration.clientId}+ clientId={oAuthApp.clientId}clientSecret={result.data?.clientSecret ||searchParams.get("client_secret") ||null}- partialClientSecret={integration.partialClientSecret}+ partialClientSecret={oAuthApp.partialClientSecret}/><hr />- <AddEditIntegrationForm integration={integration} />+ <AddOAuthAppForm oAuthApp={oAuthApp} /></>)}</MaxWidthWrapper>diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/[appId]/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/[appId]/page.tsxnew file mode 100644index 0000000000..7ed6255b0f--- /dev/null+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/[appId]/page.tsx@@ -0,0 +1,11 @@+import OAuthAppManagePageClient from "./page-client";++export default function OAuthAppManagePage({+ params,+}: {+ params: { appId: string };+}) {+ const { appId } = params;++ return <OAuthAppManagePageClient appId={appId} />;+}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/new/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/new/page-client.tsxnew file mode 100644index 0000000000..74c13f6975--- /dev/null+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/new/page-client.tsx@@ -0,0 +1,36 @@+"use client";++import useWorkspace from "@/lib/swr/use-workspace";+import AddOAuthAppForm from "@/ui/oauth-apps/add-edit-app-form";+import { MaxWidthWrapper } from "@dub/ui";+import { ChevronLeft } from "lucide-react";+import Link from "next/link";+import { redirect } from "next/navigation";++export default function NewOAuthAppPageClient() {+ const { slug, flags } = useWorkspace();++ if (!flags?.integrations) {+ redirect(`/${slug}`);+ }++ return (+ <>+ <MaxWidthWrapper className="grid max-w-screen-lg gap-8">+ <Link+ href={`/${slug}/settings/oauth-apps`}+ className="flex items-center gap-x-1"+ >+ <ChevronLeft className="size-4" />+ <p className="text-sm font-medium text-gray-500">+ Back to OAuth Apps+ </p>+ </Link>+ </MaxWidthWrapper>++ <MaxWidthWrapper className="max-w-screen-lg space-y-6">+ <AddOAuthAppForm oAuthApp={null} />+ </MaxWidthWrapper>+ </>+ );+}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/new/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/new/page.tsxnew file mode 100644index 0000000000..0c0fe46678--- /dev/null+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/new/page.tsx@@ -0,0 +1,5 @@+import NewOAuthAppPageClient from "./page-client";++export default async function NewOAuthAppPage() {+ return <NewOAuthAppPageClient />;+}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/page-client.tsxnew file mode 100644index 0000000000..9973058a36--- /dev/null+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/page-client.tsx@@ -0,0 +1,81 @@+"use client";++import useWorkspace from "@/lib/swr/use-workspace";+import { OAuthAppProps } from "@/lib/types";+import OAuthAppCard from "@/ui/oauth-apps/oauth-app-card";+import OAuthAppPlaceholder from "@/ui/oauth-apps/oauth-app-placeholder";+import EmptyState from "@/ui/shared/empty-state";+import { buttonVariants, Cube, TooltipContent } from "@dub/ui";+import { InfoTooltip } from "@dub/ui/src/tooltip";+import { cn, fetcher } from "@dub/utils";+import Link from "next/link";+import { redirect } from "next/navigation";+import useSWR from "swr";++export default function OAuthAppsPageClient() {+ const { slug, id: workspaceId, flags } = useWorkspace();++ if (!flags?.integrations) {+ redirect(`/${slug}`);+ }++ const { data: oAuthApps, isLoading } = useSWR<OAuthAppProps[]>(+ `/api/oauth/apps?workspaceId=${workspaceId}`,+ fetcher,+ );++ return (+ <div className="grid gap-5">+ <div className="flex flex-wrap justify-between gap-6">+ <div className="flex items-center gap-x-2">+ <h1 className="text-2xl font-semibold tracking-tight text-black">+ OAuth Applications+ </h1>+ <InfoTooltip+ content={+ <TooltipContent+ title="Learn more about how to add, configure, and verify OAuth applications on Dub."+ href="https://dub.co/help/category/custom-domains"+ target="_blank"+ cta="Learn more"+ />+ }+ />+ </div>+ <div className="flex w-full items-center gap-3 sm:w-auto">+ <Link+ href={`/${slug}/settings/oauth-apps/new`}+ className={cn(+ buttonVariants({ variant: "primary" }),+ "flex h-10 items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm",+ )}+ >+ Add OAuth App+ </Link>+ </div>+ </div>++ <div className="animate-fade-in">+ {!isLoading ? (+ oAuthApps && oAuthApps.length > 0 ? (+ <div className="grid grid-cols-1 gap-3">+ {oAuthApps.map((oAuthApp) => (+ <OAuthAppCard {...oAuthApp} key={oAuthApp.id} />+ ))}+ </div>+ ) : (+ <div className="flex flex-col items-center gap-4 rounded-xl border border-gray-200 py-10">+ <EmptyState icon={Cube} title={"No OAuth applications found"} />+ </div>+ )+ ) : (+ <div className="grid grid-cols-1 gap-3">+ {Array.from({ length: 3 }).map((_, idx) => (+ <OAuthAppPlaceholder />+ ))}+ </div>+ )}+ </div>+ </div>+ );+}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/page.tsxnew file mode 100644index 0000000000..7353b17202--- /dev/null+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/oauth-apps/page.tsx@@ -0,0 +1,5 @@+import OAuthAppsPageClient from "./page-client";++export default async function OAuthAppsPage() {+ return <OAuthAppsPageClient />;+}diff --git a/apps/web/lib/edge-config/get-feature-flags.ts b/apps/web/lib/edge-config/get-feature-flags.tsindex 81dcbfe6cd..ad94a82dc6 100644--- a/apps/web/lib/edge-config/get-feature-flags.ts+++ b/apps/web/lib/edge-config/get-feature-flags.ts@@ -6,7 +6,7 @@ type BetaFeaturesRecord = Record<BetaFeatures, string[]>;export const getFeatureFlags = async (workspaceId: string) => {const workspaceFeatures: Record<BetaFeatures, boolean> = {conversions: false,- integrations: false,+ integrations: true,dublink: false,};diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.tsindex 8a2f032c31..ef945a5315 100644--- a/apps/web/lib/types.ts+++ b/apps/web/lib/types.ts@@ -188,12 +188,12 @@ export type TokenProps = z.infer<typeof tokenSchema>;export type OAuthAppProps = z.infer<typeof oAuthAppSchema>;-export type NewIntegration = Omit<+export type NewOAuthApp = Omit<OAuthAppProps,"id" | "clientId" | "verified" | "installations" | "screenshots">;-export type ExistingIntegration = OAuthAppProps;+export type ExistingOAuthApp = OAuthAppProps;export type InstalledIntegrationProps = Pick<OAuthAppProps,diff --git a/apps/web/ui/modals/remove-integration-modal.tsx b/apps/web/ui/modals/remove-oauth-app-modal.tsxsimilarity index 63%rename from apps/web/ui/modals/remove-integration-modal.tsxrename to apps/web/ui/modals/remove-oauth-app-modal.tsxindex 63ecbd01a2..ddf6e8edb2 100644--- a/apps/web/ui/modals/remove-integration-modal.tsx+++ b/apps/web/ui/modals/remove-oauth-app-modal.tsx@@ -11,14 +11,14 @@ import {} from "react";import { toast } from "sonner";-function RemoveIntegrationModal({- showRemoveIntegrationModal,- setShowRemoveIntegrationModal,- integration,+function RemoveOAuthAppModal({+ showRemoveOAuthAppModal,+ setShowRemoveOAuthAppModal,+ oAuthApp,}: {- showRemoveIntegrationModal: boolean;- setShowRemoveIntegrationModal: Dispatch<SetStateAction<boolean>>;- integration:+ showRemoveOAuthAppModal: boolean;+ setShowRemoveOAuthAppModal: Dispatch<SetStateAction<boolean>>;+ oAuthApp:| Pick<OAuthAppProps,"id" | "name" | "description" | "logo" | "installations"@@ -30,11 +30,11 @@ function RemoveIntegrationModal({const [deleting, setDeleting] = useState(false);const { id: workspaceId, slug: workspaceSlug, logo } = useWorkspace();- const deleteIntegration = async () => {+ const deleteOAuthApp = async () => {setDeleting(true);const response = await fetch(- `/api/oauth/apps/${integration?.id}?workspaceId=${workspaceId}`,+ `/api/oauth/apps/${oAuthApp?.id}?workspaceId=${workspaceId}`,{method: "DELETE",headers: { "Content-Type": "application/json" },@@ -48,18 +48,18 @@ function RemoveIntegrationModal({throw new Error(error.message);}- setShowRemoveIntegrationModal(false);- router.push(`/${workspaceSlug}/integrations/manage`);+ setShowRemoveOAuthAppModal(false);+ router.push(`/${workspaceSlug}/settings/oauth-apps`);};- if (!integration) {+ if (!oAuthApp) {return null;}return (<Modal- showModal={showRemoveIntegrationModal}- setShowModal={setShowRemoveIntegrationModal}+ showModal={showRemoveOAuthAppModal}+ setShowModal={setShowRemoveOAuthAppModal}><div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 px-4 py-4 pt-8 sm:px-16">{logo ? (@@ -73,9 +73,9 @@ function RemoveIntegrationModal({) : (<Logo />)}- <h3 className="text-lg font-medium">Delete {integration.name}</h3>+ <h3 className="text-lg font-medium">Delete {oAuthApp.name}</h3><p className="text-center text-sm text-gray-500">- Deleting this integration will invalidate any access tokens authorized+ Deleting this application will invalidate any access tokens authorizedby users. Are you sure you want to continue?</p></div>@@ -84,9 +84,9 @@ function RemoveIntegrationModal({onSubmit={async (e) => {e.preventDefault();- toast.promise(deleteIntegration(), {- loading: "Deleting integration...",- success: "Integration deleted successfully!",+ toast.promise(deleteOAuthApp(), {+ loading: "Deleting application...",+ success: "Application deleted successfully!",error: (err) => err,});}}@@ -95,7 +95,7 @@ function RemoveIntegrationModal({<div><label htmlFor="verification" className="block text-sm text-gray-700">To verify, type{" "}- <span className="font-semibold text-black">{integration.name}</span>{" "}+ <span className="font-semibold text-black">{oAuthApp.name}</span>{" "}below</label><div className="relative mt-1 rounded-md shadow-sm">@@ -103,7 +103,7 @@ function RemoveIntegrationModal({type="text"name="verification"id="verification"- pattern={integration.name}+ pattern={oAuthApp.name}requiredautoFocus={false}autoComplete="off"@@ -124,34 +124,33 @@ function RemoveIntegrationModal({);}-export function useRemoveIntegrationModal({- integration,+export function useRemoveOAuthAppModal({+ oAuthApp,}: {- integration:+ oAuthApp:| Pick<OAuthAppProps,"id" | "name" | "description" | "logo" | "installations">| undefined;}) {- const [showRemoveIntegrationModal, setShowRemoveIntegrationModal] =- useState(false);+ const [showRemoveOAuthAppModal, setShowRemoveOAuthAppModal] = useState(false);- const RemoveIntegrationModalCallback = useCallback(() => {+ const RemoveOAuthAppModalCallback = useCallback(() => {return (- <RemoveIntegrationModal- showRemoveIntegrationModal={showRemoveIntegrationModal}- setShowRemoveIntegrationModal={setShowRemoveIntegrationModal}- integration={integration}+ <RemoveOAuthAppModal+ showRemoveOAuthAppModal={showRemoveOAuthAppModal}+ setShowRemoveOAuthAppModal={setShowRemoveOAuthAppModal}+ oAuthApp={oAuthApp}/>);- }, [showRemoveIntegrationModal, setShowRemoveIntegrationModal]);+ }, [showRemoveOAuthAppModal, setShowRemoveOAuthAppModal]);return useMemo(() => ({- setShowRemoveIntegrationModal,- RemoveIntegrationModal: RemoveIntegrationModalCallback,+ setShowRemoveOAuthAppModal,+ RemoveOAuthAppModal: RemoveOAuthAppModalCallback,}),- [setShowRemoveIntegrationModal, RemoveIntegrationModalCallback],+ [setShowRemoveOAuthAppModal, RemoveOAuthAppModalCallback],);}diff --git a/apps/web/ui/integrations/add-edit-integration-form.tsx b/apps/web/ui/oauth-apps/add-edit-app-form.tsxsimilarity index 94%rename from apps/web/ui/integrations/add-edit-integration-form.tsxrename to apps/web/ui/oauth-apps/add-edit-app-form.tsxindex 4aca44166b..1df681d09b 100644--- a/apps/web/ui/integrations/add-edit-integration-form.tsx+++ b/apps/web/ui/oauth-apps/add-edit-app-form.tsx@@ -1,11 +1,7 @@"use client";import useWorkspace from "@/lib/swr/use-workspace";-import {- ExistingIntegration,- NewIntegration,- OAuthAppProps,-} from "@/lib/types";+import { ExistingOAuthApp, NewOAuthApp, OAuthAppProps } from "@/lib/types";import {Button,FileUpload,@@ -23,7 +19,7 @@ import TextareaAutosize from "react-textarea-autosize";import { toast } from "sonner";import { mutate } from "swr";-const defaultValues: NewIntegration = {+const defaultValues: NewOAuthApp = {name: "",slug: "",description: "",@@ -38,10 +34,10 @@ const defaultValues: NewIntegration = {updatedAt: new Date(),};-export default function AddEditIntegrationForm({- integration,+export default function AddOAuthAppForm({+ oAuthApp,}: {- integration: OAuthAppProps | null;+ oAuthApp: OAuthAppProps | null;}) {const router = useRouter();const [saving, setSaving] = useState(false);@@ -61,8 +57,8 @@ export default function AddEditIntegrationForm({redirect(`/${workspaceSlug}`);}- const [data, setData] = useState<NewIntegration | ExistingIntegration>(- integration || defaultValues,+ const [data, setData] = useState<NewOAuthApp | ExistingOAuthApp>(+ oAuthApp || defaultValues,);useEffect(() => {@@ -73,36 +69,34 @@ export default function AddEditIntegrationForm({}, [data.name]);useEffect(() => {- if (integration) {- setUrls(- integration.redirectUris.map((u) => ({ id: nanoid(), value: u })),- );+ if (oAuthApp) {+ setUrls(oAuthApp.redirectUris.map((u) => ({ id: nanoid(), value: u })));setScreenshots(- (integration.screenshots || []).map((s) => ({+ (oAuthApp.screenshots || []).map((s) => ({uploading: false,key: s,})),);}- }, [integration]);+ }, [oAuthApp]);// Determine the endpointconst endpoint = useMemo(() => {- if (integration) {+ if (oAuthApp) {return {method: "PATCH",- url: `/api/oauth/apps/${integration.id}?workspaceId=${workspaceId}`,- successMessage: "Integration updated!",+ url: `/api/oauth/apps/${oAuthApp.id}?workspaceId=${workspaceId}`,+ successMessage: "Application updated!",};} else {return {method: "POST",url: `/api/oauth/apps?workspaceId=${workspaceId}`,- successMessage: "Integration created!",+ successMessage: "Application created!",};}- }, [integration]);+ }, [oAuthApp]);// Save the form dataconst onSubmit = async (e: FormEvent) => {@@ -129,7 +123,7 @@ export default function AddEditIntegrationForm({toast.success(endpoint.successMessage);if (endpoint.method === "POST") {- const url = `/${workspaceSlug}/integrations/manage/${result.id}${+ const url = `/${workspaceSlug}/settings/oauth-apps/${result.id}${result.clientSecret ? `?client_secret=${result.clientSecret}` : ""}`;@@ -215,7 +209,7 @@ export default function AddEditIntegrationForm({readFileimageSrc={logo ||- `https://api.dicebear.com/7.x/shapes/svg?seed=${integration?.clientId}`+ `https://api.dicebear.com/7.x/shapes/svg?seed=${oAuthApp?.clientId}`}onChange={({ src }) => setData({ ...data, logo: src })}content={null}@@ -478,7 +472,7 @@ export default function AddEditIntegrationForm({</div><Button- text={integration ? "Save changes" : "Create"}+ text={oAuthApp ? "Save changes" : "Create"}disabled={buttonDisabled || uploading}loading={saving}type="submit"diff --git a/apps/web/ui/integrations/integration-card.tsx b/apps/web/ui/oauth-apps/integration-card.tsxsimilarity index 100%rename from apps/web/ui/integrations/integration-card.tsxrename to apps/web/ui/oauth-apps/integration-card.tsxdiff --git a/apps/web/ui/integrations/oauth-app-card.tsx b/apps/web/ui/oauth-apps/oauth-app-card.tsxsimilarity index 62%rename from apps/web/ui/integrations/oauth-app-card.tsxrename to apps/web/ui/oauth-apps/oauth-app-card.tsxindex 2fa84cac15..9e8aca4fa9 100644--- a/apps/web/ui/integrations/oauth-app-card.tsx+++ b/apps/web/ui/oauth-apps/oauth-app-card.tsx@@ -4,43 +4,38 @@ import { BlurImage, TokenAvatar } from "@dub/ui";import { formatDate } from "@dub/utils";import Link from "next/link";-export default function OAuthAppCard(integration: OAuthAppProps) {+export default function OAuthAppCard(oAuthApp: OAuthAppProps) {const { slug } = useWorkspace();return (<Link- href={`/${slug}/integrations/manage/${integration.id}`}+ href={`/${slug}/settings/oauth-apps/${oAuthApp.id}`}className="relative rounded-xl border border-gray-200 bg-white px-5 py-4 transition-[filter] hover:[filter:drop-shadow(0_8px_12px_#222A350d)_drop-shadow(0_32px_80px_#2f30370f)]"><div className="flex items-center gap-x-3"><div className="rounded-md border border-gray-200 bg-gradient-to-t from-gray-100 p-2.5">- {integration.logo ? (+ {oAuthApp.logo ? (<BlurImage- src={integration.logo}- alt={`Logo for ${integration.name}`}+ src={oAuthApp.logo}+ alt={`Logo for ${oAuthApp.name}`}className="size-6 rounded-full border border-gray-200"width={20}height={20}/>) : (- <TokenAvatar id={integration.clientId} className="size-6" />+ <TokenAvatar id={oAuthApp.clientId} className="size-6" />)}</div><div>- <p className="font-semibold text-gray-700">{integration.name}</p>+ <p className="font-semibold text-gray-700">{oAuthApp.name}</p><div className="flex items-center gap-1 text-sm text-gray-500">Last updated<span className="font-medium text-gray-700">- {formatDate(integration.updatedAt, { year: undefined })}+ {formatDate(oAuthApp.updatedAt, { year: undefined })}</span></div></div></div>- <div className="grid h-16 items-end">- <p className="line-clamp-3 text-sm text-gray-500">- {integration.description}- </p>- </div></Link>);}diff --git a/apps/web/ui/integrations/oauth-app-credentials.tsx b/apps/web/ui/oauth-apps/oauth-app-credentials.tsxsimilarity index 96%rename from apps/web/ui/integrations/oauth-app-credentials.tsxrename to apps/web/ui/oauth-apps/oauth-app-credentials.tsxindex 5ddd4f63a5..43e40d2fd3 100644--- a/apps/web/ui/integrations/oauth-app-credentials.tsx+++ b/apps/web/ui/oauth-apps/oauth-app-credentials.tsx@@ -16,7 +16,7 @@ export default function OAuthAppCredentials({}return (- <div className="flex flex-col space-y-3 bg-gray-50 text-left">+ <div className="flex flex-col space-y-3 text-left"><div className="space-y-2"><label className="text-sm font-medium text-gray-500">Client ID</label><div className="flex items-center justify-between rounded-md border border-gray-300 bg-white p-3">diff --git a/apps/web/ui/integrations/oauth-app-placeholder.tsx b/apps/web/ui/oauth-apps/oauth-app-placeholder.tsxsimilarity index 68%rename from apps/web/ui/integrations/oauth-app-placeholder.tsxrename to apps/web/ui/oauth-apps/oauth-app-placeholder.tsxindex 0500a7e54a..d9a4891299 100644--- a/apps/web/ui/integrations/oauth-app-placeholder.tsx+++ b/apps/web/ui/oauth-apps/oauth-app-placeholder.tsx@@ -2,17 +2,12 @@ export default function OAuthAppPlaceholder() {return (<div className="relative grid gap-4 rounded-xl border border-gray-200 bg-white px-5 py-4"><div className="flex items-center gap-2">- <div className="flex h-10 w-10 items-center justify-center rounded-full bg-gray-100" />+ <div className="flex h-10 w-10 items-center justify-center rounded bg-gray-100" /><div className="flex flex-col gap-1"><div className="h-3 w-20 rounded-full bg-gray-100"></div><div className="h-3 w-28 rounded-full bg-gray-100"></div></div></div>-- <div className="flex flex-col gap-2">- <div className="h-4 w-36 rounded-full bg-gray-100"></div>- <div className="h-4 w-48 rounded-full bg-gray-100"></div>- </div></div>);}