diff --git a/ui/src/routes/admin/users/create-user/index.tsx b/ui/src/routes/admin/users/create-user/index.tsx index b27ad67636..8cf88f14f1 100644 --- a/ui/src/routes/admin/users/create-user/index.tsx +++ b/ui/src/routes/admin/users/create-user/index.tsx @@ -60,7 +60,7 @@ import { ALL_ITEMS } from '@/lib/constants'; import { toast } from '@/lib/toast'; const formSchema = z.object({ - username: z.string().min(1), + username: z.string().trim().min(1), firstName: asOptionalField(z.string().min(1)), lastName: asOptionalField(z.string().min(1)), email: asOptionalField(z.email()), diff --git a/ui/src/routes/create-organization/index.tsx b/ui/src/routes/create-organization/index.tsx index 21b2a4d8ea..03bdbabb2c 100644 --- a/ui/src/routes/create-organization/index.tsx +++ b/ui/src/routes/create-organization/index.tsx @@ -48,7 +48,7 @@ import { ApiError } from '@/lib/api-error'; import { toast } from '@/lib/toast'; const formSchema = z.object({ - name: z.string().min(1), + name: z.string().trim().min(1), description: asOptionalField(z.string().min(1)), }); diff --git a/ui/src/routes/organizations/$orgId/create-product/index.tsx b/ui/src/routes/organizations/$orgId/create-product/index.tsx index ebf8712eb8..dff55c6a9a 100644 --- a/ui/src/routes/organizations/$orgId/create-product/index.tsx +++ b/ui/src/routes/organizations/$orgId/create-product/index.tsx @@ -50,7 +50,7 @@ import { ApiError } from '@/lib/api-error'; import { toast } from '@/lib/toast'; const formSchema = z.object({ - name: z.string().min(1), + name: z.string().trim().min(1), description: asOptionalField(z.string().min(1)), }); diff --git a/ui/src/routes/organizations/$orgId/infrastructure-services/create/index.tsx b/ui/src/routes/organizations/$orgId/infrastructure-services/create/index.tsx index 1b942182c3..87b10409ca 100644 --- a/ui/src/routes/organizations/$orgId/infrastructure-services/create/index.tsx +++ b/ui/src/routes/organizations/$orgId/infrastructure-services/create/index.tsx @@ -61,7 +61,7 @@ import { ALL_ITEMS } from '@/lib/constants'; import { toast } from '@/lib/toast'; const formSchema = z.object({ - name: z.string(), + name: z.string().trim(), url: z.url(), description: z.string().optional(), usernameSecretRef: z.string(), diff --git a/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/infrastructure-services/create/index.tsx b/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/infrastructure-services/create/index.tsx index 060b01d7ca..542363147f 100644 --- a/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/infrastructure-services/create/index.tsx +++ b/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/infrastructure-services/create/index.tsx @@ -61,7 +61,7 @@ import { ALL_ITEMS } from '@/lib/constants.ts'; import { toast } from '@/lib/toast.ts'; const formSchema = z.object({ - name: z.string(), + name: z.string().trim(), url: z.url(), description: z.string().optional(), usernameSecretRef: z.string(), diff --git a/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/secrets/create-secret/index.tsx b/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/secrets/create-secret/index.tsx index 9579ecc13d..d376546600 100644 --- a/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/secrets/create-secret/index.tsx +++ b/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/secrets/create-secret/index.tsx @@ -47,7 +47,7 @@ import { ApiError } from '@/lib/api-error'; import { toast } from '@/lib/toast'; const formSchema = z.object({ - name: z.string(), + name: z.string().trim(), value: z.string(), description: z.string().optional(), }); diff --git a/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/users/index.tsx b/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/users/index.tsx index fb625e21e8..d0110f1050 100644 --- a/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/users/index.tsx +++ b/ui/src/routes/organizations/$orgId/products/$productId/repositories/$repoId/_repo-layout/users/index.tsx @@ -65,7 +65,7 @@ import { groupsSchema } from '@/schemas'; import { RepositoryUsersTable } from './-components/repository-users-table'; const formSchema = z.object({ - username: z.string().min(1), + username: z.string().trim().min(1), groupId: groupsSchema, }); diff --git a/ui/src/routes/organizations/$orgId/products/$productId/secrets/create-secret/index.tsx b/ui/src/routes/organizations/$orgId/products/$productId/secrets/create-secret/index.tsx index bfbc71946b..8567c8e97a 100644 --- a/ui/src/routes/organizations/$orgId/products/$productId/secrets/create-secret/index.tsx +++ b/ui/src/routes/organizations/$orgId/products/$productId/secrets/create-secret/index.tsx @@ -47,7 +47,7 @@ import { ApiError } from '@/lib/api-error'; import { toast } from '@/lib/toast'; const formSchema = z.object({ - name: z.string(), + name: z.string().trim(), value: z.string(), description: z.string().optional(), }); diff --git a/ui/src/routes/organizations/$orgId/products/$productId/settings/index.tsx b/ui/src/routes/organizations/$orgId/products/$productId/settings/index.tsx index 5d8251474d..aade10c489 100644 --- a/ui/src/routes/organizations/$orgId/products/$productId/settings/index.tsx +++ b/ui/src/routes/organizations/$orgId/products/$productId/settings/index.tsx @@ -56,7 +56,7 @@ import { ApiError } from '@/lib/api-error'; import { toast } from '@/lib/toast'; const formSchema = z.object({ - name: z.string().min(1), + name: z.string().trim().min(1), description: z.string().optional(), }); diff --git a/ui/src/routes/organizations/$orgId/products/$productId/users/index.tsx b/ui/src/routes/organizations/$orgId/products/$productId/users/index.tsx index 19dd698b59..fde8ae33ff 100644 --- a/ui/src/routes/organizations/$orgId/products/$productId/users/index.tsx +++ b/ui/src/routes/organizations/$orgId/products/$productId/users/index.tsx @@ -65,7 +65,7 @@ import { groupsSchema } from '@/schemas'; import { ProductUsersTable } from './-components/product-users-table'; const formSchema = z.object({ - username: z.string().min(1), + username: z.string().trim().min(1), groupId: groupsSchema, }); diff --git a/ui/src/routes/organizations/$orgId/secrets/create-secret/index.tsx b/ui/src/routes/organizations/$orgId/secrets/create-secret/index.tsx index 1d97e0d8f0..49be0d4647 100644 --- a/ui/src/routes/organizations/$orgId/secrets/create-secret/index.tsx +++ b/ui/src/routes/organizations/$orgId/secrets/create-secret/index.tsx @@ -47,7 +47,7 @@ import { ApiError } from '@/lib/api-error'; import { toast } from '@/lib/toast'; const formSchema = z.object({ - name: z.string(), + name: z.string().trim(), value: z.string(), description: z.string().optional(), }); diff --git a/ui/src/routes/organizations/$orgId/settings/index.tsx b/ui/src/routes/organizations/$orgId/settings/index.tsx index 87763457c5..09fff9f9d6 100644 --- a/ui/src/routes/organizations/$orgId/settings/index.tsx +++ b/ui/src/routes/organizations/$orgId/settings/index.tsx @@ -56,7 +56,7 @@ import { ApiError } from '@/lib/api-error'; import { toast } from '@/lib/toast'; const formSchema = z.object({ - name: z.string().min(1), + name: z.string().trim().min(1), description: z.string().optional(), }); diff --git a/ui/src/routes/organizations/$orgId/users/index.tsx b/ui/src/routes/organizations/$orgId/users/index.tsx index f7d01c7e2a..b5b303a177 100644 --- a/ui/src/routes/organizations/$orgId/users/index.tsx +++ b/ui/src/routes/organizations/$orgId/users/index.tsx @@ -65,7 +65,7 @@ import { groupsSchema } from '@/schemas'; import { OrganizationUsersTable } from './-components/organization-users-table'; const formSchema = z.object({ - username: z.string().min(1), + username: z.string().trim().min(1), groupId: groupsSchema, });