From 91fe9ff387e30128aaae4759e3f9636882d103e1 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 27 Oct 2022 14:38:20 +0100 Subject: [PATCH 1/3] Add default value for mysql database --- packages/server/src/integrations/mysql.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index 69dbb40480..efae38226c 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -64,6 +64,7 @@ const SCHEMA: Integration = { database: { type: DatasourceFieldType.STRING, required: true, + default: "db", }, ssl: { type: DatasourceFieldType.OBJECT, From a322f13b597c7fab9721e7564ff279371293ecd9 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 27 Oct 2022 14:45:30 +0100 Subject: [PATCH 2/3] Use nullable --- packages/builder/src/helpers/validation/yup/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/helpers/validation/yup/index.js b/packages/builder/src/helpers/validation/yup/index.js index c064ffa583..20ddaebb1a 100644 --- a/packages/builder/src/helpers/validation/yup/index.js +++ b/packages/builder/src/helpers/validation/yup/index.js @@ -28,15 +28,13 @@ export const createValidationStore = () => { let propertyValidator switch (type) { case "number": - propertyValidator = number().transform(value => - isNaN(value) ? undefined : value - ) + propertyValidator = number().nullable() break case "email": - propertyValidator = string().email() + propertyValidator = string().email().nullable() break default: - propertyValidator = string() + propertyValidator = string().nullable() } if (required) { From b39735a887500441b6e33f092f16b08579876097 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 27 Oct 2022 14:51:04 +0100 Subject: [PATCH 3/3] Revert "Add default value for mysql database" This reverts commit 91fe9ff387e30128aaae4759e3f9636882d103e1. --- packages/server/src/integrations/mysql.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index efae38226c..69dbb40480 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -64,7 +64,6 @@ const SCHEMA: Integration = { database: { type: DatasourceFieldType.STRING, required: true, - default: "db", }, ssl: { type: DatasourceFieldType.OBJECT,