From bf7f0d5cbccb30f9ea6ebe29dd946a2ca82440a6 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 11 Dec 2019 16:29:15 +0200 Subject: [PATCH] settings get rid of required --- .../metadata/authenticationMethods/LDAP.json | 81 +++++++++++++++++++ .../metadata/entityDefs/Settings.json | 18 +---- client/src/views/admin/outbound-emails.js | 20 +++++ 3 files changed, 104 insertions(+), 15 deletions(-) diff --git a/application/Espo/Resources/metadata/authenticationMethods/LDAP.json b/application/Espo/Resources/metadata/authenticationMethods/LDAP.json index c48ff8d8f5..b2a1318e93 100644 --- a/application/Espo/Resources/metadata/authenticationMethods/LDAP.json +++ b/application/Espo/Resources/metadata/authenticationMethods/LDAP.json @@ -34,6 +34,39 @@ ], "dynamicLogic": { "fields": { + "ldapHost": { + "required": { + "conditionGroup": [ + { + "type": "equals", + "attribute": "authenticationMethod", + "value": "LDAP" + } + ] + } + }, + "ldapUserNameAttribute": { + "required": { + "conditionGroup": [ + { + "type": "equals", + "attribute": "authenticationMethod", + "value": "LDAP" + } + ] + } + }, + "ldapUserObjectClass": { + "required": { + "conditionGroup": [ + { + "type": "equals", + "attribute": "authenticationMethod", + "value": "LDAP" + } + ] + } + }, "ldapUsername": { "visible": { "conditionGroup": [ @@ -42,6 +75,14 @@ "attribute": "ldapAuth" } ] + }, + "required": { + "conditionGroup": [ + { + "type": "isTrue", + "attribute": "ldapAuth" + } + ] } }, "ldapPassword": { @@ -94,6 +135,14 @@ "attribute": "ldapCreateEspoUser" } ] + }, + "required": { + "conditionGroup": [ + { + "type": "isTrue", + "attribute": "ldapCreateEspoUser" + } + ] } }, "ldapUserFirstNameAttribute": { @@ -104,6 +153,14 @@ "attribute": "ldapCreateEspoUser" } ] + }, + "required": { + "conditionGroup": [ + { + "type": "isTrue", + "attribute": "ldapCreateEspoUser" + } + ] } }, "ldapUserLastNameAttribute": { @@ -114,6 +171,14 @@ "attribute": "ldapCreateEspoUser" } ] + }, + "required": { + "conditionGroup": [ + { + "type": "isTrue", + "attribute": "ldapCreateEspoUser" + } + ] } }, "ldapUserEmailAddressAttribute": { @@ -124,6 +189,14 @@ "attribute": "ldapCreateEspoUser" } ] + }, + "required": { + "conditionGroup": [ + { + "type": "isTrue", + "attribute": "ldapCreateEspoUser" + } + ] } }, "ldapUserPhoneNumberAttribute": { @@ -134,6 +207,14 @@ "attribute": "ldapCreateEspoUser" } ] + }, + "required": { + "conditionGroup": [ + { + "type": "isTrue", + "attribute": "ldapCreateEspoUser" + } + ] } }, "ldapUserTeams": { diff --git a/application/Espo/Resources/metadata/entityDefs/Settings.json b/application/Espo/Resources/metadata/entityDefs/Settings.json index 81338cf3b5..af635db5f7 100644 --- a/application/Espo/Resources/metadata/entityDefs/Settings.json +++ b/application/Espo/Resources/metadata/entityDefs/Settings.json @@ -101,12 +101,10 @@ "type": "int", "min": 0, "max": 9999, - "required": true, "default": 587 }, "smtpAuth": { - "type": "bool", - "default": true + "type": "bool" }, "smtpSecurity": { "type": "enum", @@ -114,8 +112,7 @@ "options": ["", "SSL", "TLS"] }, "smtpUsername": { - "type": "varchar", - "required": true + "type": "varchar" }, "smtpPassword": { "type": "password" @@ -193,8 +190,7 @@ "type": "bool" }, "ldapHost": { - "type": "varchar", - "required": true + "type": "varchar" }, "ldapPort": { "type": "varchar", @@ -210,7 +206,6 @@ }, "ldapUsername": { "type": "varchar", - "required": true, "tooltip": true }, "ldapPassword": { @@ -265,37 +260,30 @@ }, "ldapUserNameAttribute": { "type": "varchar", - "required": true, "tooltip": true }, "ldapUserObjectClass": { "type": "varchar", - "required": true, "tooltip": true }, "ldapUserFirstNameAttribute": { "type": "varchar", - "required": true, "tooltip": true }, "ldapUserLastNameAttribute": { "type": "varchar", - "required": true, "tooltip": true }, "ldapUserTitleAttribute": { "type": "varchar", - "required": true, "tooltip": true }, "ldapUserEmailAddressAttribute": { "type": "varchar", - "required": true, "tooltip": true }, "ldapUserPhoneNumberAttribute": { "type": "varchar", - "required": true, "tooltip": true }, "ldapUserDefaultTeam": { diff --git a/client/src/views/admin/outbound-emails.js b/client/src/views/admin/outbound-emails.js index 6934a3b4f5..6982ea7c92 100644 --- a/client/src/views/admin/outbound-emails.js +++ b/client/src/views/admin/outbound-emails.js @@ -46,6 +46,18 @@ define('views/admin/outbound-emails', 'views/settings/record/edit', function (De attribute: 'smtpAuth', } ] + }, + required: { + conditionGroup: [ + { + type: 'isNotEmpty', + attribute: 'smtpServer', + }, + { + type: 'isTrue', + attribute: 'smtpAuth', + } + ] } }, smtpPassword: { @@ -70,6 +82,14 @@ define('views/admin/outbound-emails', 'views/settings/record/edit', function (De attribute: 'smtpServer', }, ] + }, + required: { + conditionGroup: [ + { + type: 'isNotEmpty', + attribute: 'smtpServer', + }, + ] } }, smtpSecurity: {