Merge "RIFT-15270: Drop downs not working for config-parameter-refs" into master_vca_intg
authorKIRAN KASHALKAR <kiran.kashalkar@riftio.com>
Wed, 18 Jan 2017 02:17:45 +0000 (03:17 +0100)
committerGerrit Code Review <root@osm.etsi.org>
Wed, 18 Jan 2017 02:17:45 +0000 (03:17 +0100)
1  2 
skyquake/plugins/composer/src/src/libraries/utils.js

@@@ -271,11 -271,11 +271,11 @@@ export default 
  
                // Check if relative path or not
                // TODO: Below works but
 -              // better to convert the pathCopy to absolute/rooted path 
 +              // better to convert the pathCopy to absolute/rooted path
                // and use the absolute module instead
                if (this.isRelativePath(leafRefPathCopy)) {
                        let i = pathArray.length;
 -                      while (pathArray[pathArray.length - i] == '..') {
 +                      while ((pathArray[pathArray.length - i] == '..') && fieldKeyArray.length > 1) {
                                fieldKeyArray.splice(-1, 1);
                                if (!isNaN(Number(fieldKeyArray[fieldKeyArray.length - 1]))) {
                                        // found a number, so an index. strip it
                                        for (let subKey in catalogs[key]) {
                                                let found = _.find(catalogs[key][subKey], {id: fieldKeyArray[0]});
                                                if (found) {
-                                                       results = this.getResults(found, pathArray.splice(-i, i));
+                                                       results = this.getAbsoluteResults(found, pathArray.splice(-i, i));
                                                        return results;
                                                }
                                        }
                                                        for (let foundKey in found) {
                                                                let topLevel = _.find(found[foundKey], {id: fieldKeyArray[1]});
                                                                if (topLevel) {
-                                                                       results = this.getResults(topLevel, pathArray.splice(-i, i));
+                                                                       results = this.getAbsoluteResults(topLevel, pathArray.splice(-i, i));
                                                                        return results;
                                                                }
                                                        }
                                                }
                                        }
                                }
 -                      } else {
 +                      }  else {
                                // not supported - too many levels deep ... maybe some day
                                console.log('The relative path is from a node too many levels deep from root. This is not supported at the time');
                        }