NOTICKET: Relative refs, 3 levels deep 22/1322/1
authorKIRAN KASHALKAR <kiran.kashalkar@riftio.com>
Thu, 16 Mar 2017 20:00:59 +0000 (16:00 -0400)
committerKIRAN KASHALKAR <kiran.kashalkar@riftio.com>
Thu, 16 Mar 2017 20:00:59 +0000 (16:00 -0400)
Signed-off-by: KIRAN KASHALKAR <kiran.kashalkar@riftio.com>
skyquake/plugins/composer/src/src/libraries/utils.js

index 418540f..75afab3 100644 (file)
@@ -332,6 +332,21 @@ export default {
                                                }
                                        }
                                }
+                       } else if (fieldKeyArray.length == 3) {
+                               for (let key in catalogs) {
+                                       for (let subKey in catalogs[key]) {
+                                               let found = _.find(catalogs[key][subKey], {id: fieldKeyArray[0]});
+                                               if (found) {
+                                                       for (let foundKey in found) {
+                                                               let topLevel = _.find(found[foundKey], {id: fieldKeyArray[1]});
+                                                               if (topLevel) {
+                                                                       results = this.getAbsoluteResults(topLevel, pathArray.splice(-i, i));
+                                                                       return results;
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
                        } 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');