X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Flibraries%2Futils.js;h=75afab33a17fb9766b635ea4a95656fbfe6aa84e;hp=418540fdca073f083044548aacfd31bd42afc4bd;hb=132f9b77e1c32b82eb1c27cea048a5c1f2bfcb56;hpb=4ce407211e3fa5a8ba7a43cb0c88406e83a25bdc diff --git a/skyquake/plugins/composer/src/src/libraries/utils.js b/skyquake/plugins/composer/src/src/libraries/utils.js index 418540fdc..75afab33a 100644 --- a/skyquake/plugins/composer/src/src/libraries/utils.js +++ b/skyquake/plugins/composer/src/src/libraries/utils.js @@ -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');