From 01dfec310d2c1b23c026bb408d64688baaac7107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Voron?= Date: Thu, 7 Nov 2024 15:55:57 +0100 Subject: [PATCH] clients/web: fix custom field error validation display --- .../components/CustomFields/CreateCustomFieldModalContent.tsx | 2 +- .../apps/web/src/components/CustomFields/CustomFieldForm.tsx | 3 ++- .../components/CustomFields/UpdateCustomFieldModalContent.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/clients/apps/web/src/components/CustomFields/CreateCustomFieldModalContent.tsx b/clients/apps/web/src/components/CustomFields/CreateCustomFieldModalContent.tsx index 7ab06380fe..f9d2b22637 100644 --- a/clients/apps/web/src/components/CustomFields/CreateCustomFieldModalContent.tsx +++ b/clients/apps/web/src/components/CustomFields/CreateCustomFieldModalContent.tsx @@ -54,7 +54,7 @@ const CreateCustomFieldModalContent = ({ const body = await e.response.json() if (e.response.status === 422) { const validationErrors = body['detail'] as ValidationError[] - setValidationErrors(validationErrors, setError, 1) + setValidationErrors(validationErrors, setError, 2) } } } finally { diff --git a/clients/apps/web/src/components/CustomFields/CustomFieldForm.tsx b/clients/apps/web/src/components/CustomFields/CustomFieldForm.tsx index a94e2c8192..004196836b 100644 --- a/clients/apps/web/src/components/CustomFields/CustomFieldForm.tsx +++ b/clients/apps/web/src/components/CustomFields/CustomFieldForm.tsx @@ -259,7 +259,8 @@ const CustomFieldForm: React.FC = ({ update }) => { Will be used as a key when storing the value. Must be unique - across your organization. + across your organization. It can only contain ASCII letters, + numbers and hyphens. ) diff --git a/clients/apps/web/src/components/CustomFields/UpdateCustomFieldModalContent.tsx b/clients/apps/web/src/components/CustomFields/UpdateCustomFieldModalContent.tsx index 73d2b2b182..1062cf741c 100644 --- a/clients/apps/web/src/components/CustomFields/UpdateCustomFieldModalContent.tsx +++ b/clients/apps/web/src/components/CustomFields/UpdateCustomFieldModalContent.tsx @@ -50,7 +50,7 @@ const UpdateCustomFieldModalContent = ({ const body = await e.response.json() if (e.response.status === 422) { const validationErrors = body['detail'] as ValidationError[] - setValidationErrors(validationErrors, setError, 1) + setValidationErrors(validationErrors, setError, 2) } } } finally {