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:
Deep Tailor 2019-05-24 12:04:41 -07:00 committed by Andrew Henry
parent f5c48b7bf6
commit c38d810658

View File

@ -80,15 +80,17 @@ define(['zepto'], function ($) {
var newObj;
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;
}
newObj = this.instantiate(tree[childId], childId);
parent.getCapability("composition").add(newObj);
newObj = this.instantiate(tree[keystring], keystring);
newObj.getCapability("location")
.setPrimaryLocation(tree[childId].location);
.setPrimaryLocation(tree[keystring].location);
this.deepInstantiate(newObj, tree, seen);
}, this);
}