From aed44259a3f528a6c74320cdfdca9772db96515d Mon Sep 17 00:00:00 2001 From: mertmit Date: Fri, 23 Dec 2022 21:29:33 +0300 Subject: [PATCH] fix: validation for base forms Signed-off-by: mertmit --- .../dashboard/settings/data-sources/CreateBase.vue | 4 ++-- .../dashboard/settings/data-sources/EditBase.vue | 12 +++--------- .../nc-gui/pages/index/index/create-external.vue | 4 ++-- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue b/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue index 7314b9d9b1..9fe262966e 100644 --- a/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue +++ b/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue @@ -86,7 +86,7 @@ const validators = computed(() => { : formState.dataSource.client === ClientType.SNOWFLAKE ? { 'dataSource.connection.account': [fieldRequiredValidator()], - 'dataSource.connection.user': [fieldRequiredValidator()], + 'dataSource.connection.username': [fieldRequiredValidator()], 'dataSource.connection.password': [fieldRequiredValidator()], 'dataSource.connection.warehouse': [fieldRequiredValidator()], 'dataSource.connection.database': [fieldRequiredValidator()], @@ -399,7 +399,7 @@ watch( - + diff --git a/packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue b/packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue index 09dfd7364c..7d48c7c397 100644 --- a/packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue +++ b/packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue @@ -71,13 +71,7 @@ const customFormState = ref({ const validators = computed(() => { return { - 'title': [ - { - required: true, - message: 'Base name is required', - }, - projectTitleValidator, - ], + 'title': [projectTitleValidator], 'extraParameters': [extraParameterValidator], 'dataSource.client': [fieldRequiredValidator()], ...(formState.value.dataSource.client === ClientType.SQLITE @@ -87,7 +81,7 @@ const validators = computed(() => { : formState.value.dataSource.client === ClientType.SNOWFLAKE ? { 'dataSource.connection.account': [fieldRequiredValidator()], - 'dataSource.connection.user': [fieldRequiredValidator()], + 'dataSource.connection.username': [fieldRequiredValidator()], 'dataSource.connection.password': [fieldRequiredValidator()], 'dataSource.connection.warehouse': [fieldRequiredValidator()], 'dataSource.connection.database': [fieldRequiredValidator()], @@ -392,7 +386,7 @@ onMounted(async () => { - + diff --git a/packages/nc-gui/pages/index/index/create-external.vue b/packages/nc-gui/pages/index/index/create-external.vue index 1a51804442..2cc6265336 100644 --- a/packages/nc-gui/pages/index/index/create-external.vue +++ b/packages/nc-gui/pages/index/index/create-external.vue @@ -82,7 +82,7 @@ const validators = computed(() => { : formState.dataSource.client === ClientType.SNOWFLAKE ? { 'dataSource.connection.account': [fieldRequiredValidator()], - 'dataSource.connection.user': [fieldRequiredValidator()], + 'dataSource.connection.username': [fieldRequiredValidator()], 'dataSource.connection.password': [fieldRequiredValidator()], 'dataSource.connection.warehouse': [fieldRequiredValidator()], 'dataSource.connection.database': [fieldRequiredValidator()], @@ -401,7 +401,7 @@ onMounted(async () => { - +