From df53af7b4d8d35d4d36c8c7878d8edf4b00707b1 Mon Sep 17 00:00:00 2001 From: Deep Tailor Date: Thu, 21 Mar 2019 12:41:40 -0700 Subject: [PATCH] Inspector location (#2317) * working original location - todo link location * remove link location for now * remove legacy getPath and implement new getOriginalPath API call * simplify getOriginalPath, and use path to calculate parent paths in location.vue --- src/api/objects/ObjectAPI.js | 15 +++++++++- src/ui/inspector/Location.vue | 54 ++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 8 deletions(-) diff --git a/src/api/objects/ObjectAPI.js b/src/api/objects/ObjectAPI.js index b99015771f..d40b78a4c4 100644 --- a/src/api/objects/ObjectAPI.js +++ b/src/api/objects/ObjectAPI.js @@ -226,7 +226,20 @@ define([ (identifier.namespace === identifiers[0].namespace && identifier.key === identifiers[0].key); }); - } + }; + + ObjectAPI.prototype.getOriginalPath = function (identifier, path = []) { + return this.get(identifier).then((domainObject) => { + path.push(domainObject); + let location = domainObject.location; + + if (location) { + return this.getOriginalPath(utils.parseKeyString(location), path); + } else { + return path; + } + }); + }; /** * Uniquely identifies a domain object. diff --git a/src/ui/inspector/Location.vue b/src/ui/inspector/Location.vue index 4e51029c82..e2072a2628 100644 --- a/src/ui/inspector/Location.vue +++ b/src/ui/inspector/Location.vue @@ -2,24 +2,37 @@
Location