Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

fix: app url not required (#2130)

Meier Lukasb38de29a882c
diff --git a/apps/nextjs/src/app/[locale]/manage/apps/_form.tsx b/apps/nextjs/src/app/[locale]/manage/apps/_form.tsx
index 2cf9bf9b3..9ec5b92d1 100644
--- a/apps/nextjs/src/app/[locale]/manage/apps/_form.tsx
+++ b/apps/nextjs/src/app/[locale]/manage/apps/_form.tsx
@@ -25,11 +25,11 @@ export const AppForm = (props: AppFormProps) => {
const t = useI18n();
const form = useZodForm(validation.app.manage, {
- initialValues: initialValues ?? {
- name: "",
- description: "",
- iconUrl: "",
- href: "",
+ initialValues: {
+ name: initialValues?.name ?? "",
+ description: initialValues?.description ?? "",
+ iconUrl: initialValues?.iconUrl ?? "",
+ href: initialValues?.href ?? "",
},
});
diff --git a/packages/validation/src/app.ts b/packages/validation/src/app.ts
index dfe1a749a..b8b73e35a 100644
--- a/packages/validation/src/app.ts
+++ b/packages/validation/src/app.ts
@@ -1,13 +1,21 @@
import { z } from "zod";
const manageAppSchema = z.object({
- name: z.string().min(1).max(64),
- description: z.string().max(512).nullable(),
- iconUrl: z.string().min(1),
+ name: z.string().trim().min(1).max(64),
+ description: z
+ .string()
+ .trim()
+ .max(512)
+ .transform((value) => (value.length === 0 ? null : value))
+ .nullable(),
+ iconUrl: z.string().trim().min(1),
href: z
.string()
+ .trim()
.url()
.regex(/^https?:\/\//) // Only allow http and https for security reasons (javascript: is not allowed)
+ .or(z.literal(""))
+ .transform((value) => (value.length === 0 ? null : value))
.nullable(),
});