Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add readme support

Kiran K695de1e5180e
diff --git a/apps/web/app/api/oauth/apps/[appId]/route.ts b/apps/web/app/api/oauth/apps/[appId]/route.ts
index 0e157cbff1..3695b19c05 100644
--- a/apps/web/app/api/oauth/apps/[appId]/route.ts
+++ b/apps/web/app/api/oauth/apps/[appId]/route.ts
@@ -39,6 +39,7 @@ export const PATCH = withWorkspace(
developer,
website,
description,
+ readme,
redirectUri,
logo,
pkce,
@@ -55,6 +56,7 @@ export const PATCH = withWorkspace(
developer,
website,
description,
+ readme,
redirectUri,
logo,
pkce,
diff --git a/apps/web/app/api/oauth/apps/route.ts b/apps/web/app/api/oauth/apps/route.ts
index c47b758b95..e4282c8e15 100644
--- a/apps/web/app/api/oauth/apps/route.ts
+++ b/apps/web/app/api/oauth/apps/route.ts
@@ -43,6 +43,7 @@ export const POST = withWorkspace(
developer,
website,
description,
+ readme,
redirectUri,
logo,
pkce,
@@ -66,6 +67,7 @@ export const POST = withWorkspace(
developer,
website,
description,
+ readme,
redirectUri,
logo,
clientId,
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/add-edit-integration-form.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/add-edit-integration-form.tsx
index 0c60ab36e5..df2df5495e 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/add-edit-integration-form.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/add-edit-integration-form.tsx
@@ -18,6 +18,7 @@ const defaultValues: NewIntegration = {
name: "",
slug: "",
description: "",
+ readme: "",
developer: "",
website: "",
redirectUri: "",
@@ -100,6 +101,7 @@ export default function AddEditIntegrationForm({
name,
slug,
description,
+ readme,
developer,
website,
redirectUri,
@@ -162,11 +164,12 @@ export default function AddEditIntegrationForm({
</label>
<div className="relative mt-2 rounded-md shadow-sm">
<TextareaAutosize
- name="comments"
- minRows={3}
+ name="description"
+ minRows={2}
className="block w-full rounded-md border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
placeholder="Add a description"
value={description || ""}
+ maxLength={50}
onChange={(e) => {
setData({ ...data, description: e.target.value });
}}
@@ -174,6 +177,26 @@ export default function AddEditIntegrationForm({
</div>
</div>
+ <div>
+ <label htmlFor="slug" className="flex items-center space-x-2">
+ <h2 className="text-sm font-medium text-gray-900">Overview</h2>
+ <InfoTooltip content="Provide some details about your integration. This will be displayed on the integration page. Markdown is supported." />
+ </label>
+ <div className="relative mt-2 rounded-md shadow-sm">
+ <TextareaAutosize
+ name="readme"
+ minRows={10}
+ className="block w-full rounded-md border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
+ placeholder="## My Awesome Integration"
+ value={readme || ""}
+ maxLength={1000}
+ onChange={(e) => {
+ setData({ ...data, readme: e.target.value });
+ }}
+ />
+ </div>
+ </div>
+
<div>
<label htmlFor="developer" className="flex items-center space-x-2">
<h2 className="text-sm font-medium text-gray-900">
diff --git a/apps/web/lib/zod/schemas/oauth.ts b/apps/web/lib/zod/schemas/oauth.ts
index 7c88d8925b..9fafa3337a 100644
--- a/apps/web/lib/zod/schemas/oauth.ts
+++ b/apps/web/lib/zod/schemas/oauth.ts
@@ -35,7 +35,18 @@ export const createOAuthAppSchema = z.object({
"redirect_uri must be a valid URL starting with 'https://' except for 'http://localhost'",
},
),
- description: z.string().max(5000).nullable(),
+ description: z
+ .string()
+ .max(50, {
+ message: "must be less than 50 characters",
+ })
+ .nullable(),
+ readme: z
+ .string()
+ .max(1000, {
+ message: "must be less than 1000 characters",
+ })
+ .nullable(),
pkce: z.boolean().default(false),
});
@@ -48,6 +59,7 @@ export const oAuthAppSchema = z.object({
name: z.string(),
slug: z.string(),
description: z.string().nullish(),
+ readme: z.string().nullish(),
developer: z.string(),
website: z.string(),
redirectUri: z.string(),
diff --git a/apps/web/prisma/schema/oauth.prisma b/apps/web/prisma/schema/oauth.prisma
index 0d2a55ebb4..9037754b6c 100644
--- a/apps/web/prisma/schema/oauth.prisma
+++ b/apps/web/prisma/schema/oauth.prisma
@@ -3,7 +3,8 @@ model OAuthApp {
clientId String @unique
name String
slug String @unique
- description String? @db.LongText
+ description String?
+ readme String? @db.LongText
developer String
website String
hashedClientSecret String