From f6635314127a8c1cc9c7de5ff1e751861b215fd3 Mon Sep 17 00:00:00 2001 From: salexdv Date: Wed, 27 Jan 2021 20:45:45 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BC=D0=B5=D1=82=D0=B0=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=B4=D0=BB=D1=8F=20=D1=81=D1=83=D1=89=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B5=D0=B3=D0=BE=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bsl_helper.js | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/bsl_helper.js b/src/bsl_helper.js index c41f1cf..9c91517 100644 --- a/src/bsl_helper.js +++ b/src/bsl_helper.js @@ -1156,19 +1156,37 @@ class bslHelper { if (value[this.nameField].toLowerCase() == metadataName) { - for (const [ikey, ivalue] of Object.entries(value.items)) { + if (Object.keys(value.items).length) { - if (ikey.toLowerCase() == metadataItem) { + for (const [ikey, ivalue] of Object.entries(value.items)) { - let methodDef = this.getMetadataMethodByName(value, metadataFunc); - let methodsName = (methodDef && methodDef.hasOwnProperty('ref') && methodDef.ref.indexOf(':obj') != -1) ? 'objMethods' : 'refMethods'; + if (ikey.toLowerCase() == metadataItem) { + + if (ivalue.hasOwnProperty('properties')) { + + let methodDef = this.getMetadataMethodByName(value, metadataFunc); + let methodsName = (methodDef && methodDef.hasOwnProperty('ref') && methodDef.ref.indexOf(':obj') != -1) ? 'objMethods' : 'refMethods'; + + itemExists = true; + this.fillSuggestionsForMetadataItem(suggestions, ivalue); + this.getMetadataMethods(suggestions, value, methodsName, key, ikey); + + } + else { + + requestMetadata(metadataName.toLowerCase() + '.' + metadataItem.toLowerCase()); + + } + } - itemExists = true; - this.fillSuggestionsForMetadataItem(suggestions, ivalue); - this.getMetadataMethods(suggestions, value, methodsName, key, ikey); } } + else { + + requestMetadata(metadataName.toLowerCase()); + + } }