mirror of
https://github.com/nasa/openmct.git
synced 2025-02-06 19:19:23 +00:00
Fix import export (#2407)
* working import/export, need to check with objects that have name-spaces * use keystrings instead of key
This commit is contained in:
parent
f5c48b7bf6
commit
c38d810658
@ -80,15 +80,17 @@ define(['zepto'], function ($) {
|
|||||||
var newObj;
|
var newObj;
|
||||||
|
|
||||||
seen.push(parent.getId());
|
seen.push(parent.getId());
|
||||||
parentModel.composition.forEach(function (childId, index) {
|
|
||||||
if (!tree[childId] || seen.includes(childId)) {
|
parentModel.composition.forEach(function (childId) {
|
||||||
|
let keystring = this.openmct.objects.makeKeyString(childId);
|
||||||
|
|
||||||
|
if (!tree[keystring] || seen.includes(keystring)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
newObj = this.instantiate(tree[childId], childId);
|
newObj = this.instantiate(tree[keystring], keystring);
|
||||||
parent.getCapability("composition").add(newObj);
|
|
||||||
newObj.getCapability("location")
|
newObj.getCapability("location")
|
||||||
.setPrimaryLocation(tree[childId].location);
|
.setPrimaryLocation(tree[keystring].location);
|
||||||
this.deepInstantiate(newObj, tree, seen);
|
this.deepInstantiate(newObj, tree, seen);
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user