From f668973f1114f7154bf036fabddd9b9666a5db54 Mon Sep 17 00:00:00 2001 From: Johannes Hoermann <j.hoermann@adito.de> Date: Mon, 29 Apr 2019 11:49:19 +0200 Subject: [PATCH] Revert: address: do not validate mandatory if fields are empty --- entity/Address_entity/Address_entity.aod | 2 -- .../entityfields/address/mandatoryProcess.js | 12 +---------- .../entityfields/city/mandatoryProcess.js | 12 +---------- .../contact_id/mandatoryProcess.js | 15 ------------- .../entityfields/country/mandatoryProcess.js | 15 ------------- .../entityfields/state/mandatoryProcess.js | 12 +---------- .../entityfields/zip/mandatoryProcess.js | 12 +---------- .../recordcontainers/db/conditionProcess.js | 1 + .../SalesprojectCompetitionPreview_view.aod | 1 - process/Entity_lib/process.js | 21 ------------------- 10 files changed, 5 insertions(+), 98 deletions(-) delete mode 100644 entity/Address_entity/entityfields/contact_id/mandatoryProcess.js delete mode 100644 entity/Address_entity/entityfields/country/mandatoryProcess.js diff --git a/entity/Address_entity/Address_entity.aod b/entity/Address_entity/Address_entity.aod index 2855ca7414..c43a760ab0 100644 --- a/entity/Address_entity/Address_entity.aod +++ b/entity/Address_entity/Address_entity.aod @@ -50,7 +50,6 @@ <title>Country</title> <consumer>Countries</consumer> <mandatory v="true" /> - <mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/country/mandatoryProcess.js</mandatoryProcess> <valueProcess>%aditoprj%/entity/Address_entity/entityfields/country/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Address_entity/entityfields/country/displayValueProcess.js</displayValueProcess> </entityField> @@ -65,7 +64,6 @@ <entityField> <name>CONTACT_ID</name> <mandatory v="true" /> - <mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/contact_id/mandatoryProcess.js</mandatoryProcess> <valueProcess>%aditoprj%/entity/Address_entity/entityfields/contact_id/valueProcess.js</valueProcess> </entityField> <entityField> diff --git a/entity/Address_entity/entityfields/address/mandatoryProcess.js b/entity/Address_entity/entityfields/address/mandatoryProcess.js index e3fe2aaca0..7c898f0182 100644 --- a/entity/Address_entity/entityfields/address/mandatoryProcess.js +++ b/entity/Address_entity/entityfields/address/mandatoryProcess.js @@ -2,14 +2,4 @@ import("Entity_lib"); import("system.result"); import("AddressEntity_lib"); -result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([ - "$field.ADDR_TYPE", - "$field.ADDRESS", - "$field.BUILDINGNO", - "$field.ZIP", - "$field.CITY", - "$field.COUNTRY", - "$field.STATE", - "$field.REGION", - "$field.ADDRIDENTIFIER" - ], AddressEntityValidation.isMandatoryField())); \ No newline at end of file +result.object(AddressEntityValidation.isMandatoryField()); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/city/mandatoryProcess.js b/entity/Address_entity/entityfields/city/mandatoryProcess.js index e3fe2aaca0..7c898f0182 100644 --- a/entity/Address_entity/entityfields/city/mandatoryProcess.js +++ b/entity/Address_entity/entityfields/city/mandatoryProcess.js @@ -2,14 +2,4 @@ import("Entity_lib"); import("system.result"); import("AddressEntity_lib"); -result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([ - "$field.ADDR_TYPE", - "$field.ADDRESS", - "$field.BUILDINGNO", - "$field.ZIP", - "$field.CITY", - "$field.COUNTRY", - "$field.STATE", - "$field.REGION", - "$field.ADDRIDENTIFIER" - ], AddressEntityValidation.isMandatoryField())); \ No newline at end of file +result.object(AddressEntityValidation.isMandatoryField()); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/contact_id/mandatoryProcess.js b/entity/Address_entity/entityfields/contact_id/mandatoryProcess.js deleted file mode 100644 index 9f96f58a0f..0000000000 --- a/entity/Address_entity/entityfields/contact_id/mandatoryProcess.js +++ /dev/null @@ -1,15 +0,0 @@ -import("Entity_lib"); -import("system.result"); -import("AddressEntity_lib"); - -result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([ - "$field.ADDR_TYPE", - "$field.ADDRESS", - "$field.BUILDINGNO", - "$field.ZIP", - "$field.CITY", - "$field.COUNTRY", - "$field.STATE", - "$field.REGION", - "$field.ADDRIDENTIFIER" - ], true)); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/country/mandatoryProcess.js b/entity/Address_entity/entityfields/country/mandatoryProcess.js deleted file mode 100644 index 9f96f58a0f..0000000000 --- a/entity/Address_entity/entityfields/country/mandatoryProcess.js +++ /dev/null @@ -1,15 +0,0 @@ -import("Entity_lib"); -import("system.result"); -import("AddressEntity_lib"); - -result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([ - "$field.ADDR_TYPE", - "$field.ADDRESS", - "$field.BUILDINGNO", - "$field.ZIP", - "$field.CITY", - "$field.COUNTRY", - "$field.STATE", - "$field.REGION", - "$field.ADDRIDENTIFIER" - ], true)); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/state/mandatoryProcess.js b/entity/Address_entity/entityfields/state/mandatoryProcess.js index e3fe2aaca0..7c898f0182 100644 --- a/entity/Address_entity/entityfields/state/mandatoryProcess.js +++ b/entity/Address_entity/entityfields/state/mandatoryProcess.js @@ -2,14 +2,4 @@ import("Entity_lib"); import("system.result"); import("AddressEntity_lib"); -result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([ - "$field.ADDR_TYPE", - "$field.ADDRESS", - "$field.BUILDINGNO", - "$field.ZIP", - "$field.CITY", - "$field.COUNTRY", - "$field.STATE", - "$field.REGION", - "$field.ADDRIDENTIFIER" - ], AddressEntityValidation.isMandatoryField())); \ No newline at end of file +result.object(AddressEntityValidation.isMandatoryField()); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/zip/mandatoryProcess.js b/entity/Address_entity/entityfields/zip/mandatoryProcess.js index e3fe2aaca0..7c898f0182 100644 --- a/entity/Address_entity/entityfields/zip/mandatoryProcess.js +++ b/entity/Address_entity/entityfields/zip/mandatoryProcess.js @@ -2,14 +2,4 @@ import("Entity_lib"); import("system.result"); import("AddressEntity_lib"); -result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([ - "$field.ADDR_TYPE", - "$field.ADDRESS", - "$field.BUILDINGNO", - "$field.ZIP", - "$field.CITY", - "$field.COUNTRY", - "$field.STATE", - "$field.REGION", - "$field.ADDRIDENTIFIER" - ], AddressEntityValidation.isMandatoryField())); \ No newline at end of file +result.object(AddressEntityValidation.isMandatoryField()); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/conditionProcess.js b/entity/Organisation_entity/recordcontainers/db/conditionProcess.js index 8743459e60..20bdc71771 100644 --- a/entity/Organisation_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Organisation_entity/recordcontainers/db/conditionProcess.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.vars"); import("system.db"); import("system.result"); diff --git a/neonView/SalesprojectCompetitionPreview_view/SalesprojectCompetitionPreview_view.aod b/neonView/SalesprojectCompetitionPreview_view/SalesprojectCompetitionPreview_view.aod index bac5b4dc39..a49d5d09c5 100644 --- a/neonView/SalesprojectCompetitionPreview_view/SalesprojectCompetitionPreview_view.aod +++ b/neonView/SalesprojectCompetitionPreview_view/SalesprojectCompetitionPreview_view.aod @@ -13,7 +13,6 @@ <name>Header</name> <iconField>IMAGE</iconField> <titleField>CONTACT_ID</titleField> - <subtitleField>CONTACT_ID</subtitleField> <descriptionField>INFO</descriptionField> <entityField>#ENTITY</entityField> </cardViewTemplate> diff --git a/process/Entity_lib/process.js b/process/Entity_lib/process.js index 5c7dfbf781..6db3b2deba 100644 --- a/process/Entity_lib/process.js +++ b/process/Entity_lib/process.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.result"); import("system.neon"); import("system.vars"); @@ -48,26 +47,6 @@ ProcessHandlingUtils.initialParamToResult = function(pParamVarName) } -ProcessHandlingUtils.getMandatoryIgnoreAllEmpty = function(pFields, pIsMandatory) -{ - var allEmpty = true; - logging.log("-------------") - pFields.forEach(function(pField) { - logging.log(pField + " " + vars.getString(pField)) - if (vars.getString(pField)) - { - - allEmpty = false; - } - }); - logging.log(allEmpty) - logging.log(pIsMandatory) - logging.log(!allEmpty && pIsMandatory) - - logging.log("-------------") - return !allEmpty && pIsMandatory; -} - /** * Workaround for detecting field changes of fields not managed by record containers. * Should be fixed in the future: Ticket 1030023 -- GitLab