Update namespace of object after location selected

This commit is contained in:
Andrew Henry 2020-09-10 19:11:14 -07:00
parent 18b2a270c9
commit 888afd88b8

View File

@ -112,6 +112,9 @@ define(
formModel = this.createModel(formValue);
formModel.location = parent.getId();
this.updateNamespaceFromParent(parent);
this.domainObject.useCapability("mutation", function () {
return formModel;
});
@ -119,6 +122,14 @@ define(
return this.domainObject;
};
/** @private */
CreateWizard.prototype.updateNamespaceFromParent = function (parent) {
let childIdentifier = this.domainObject.useCapability('adapter').identifier;
let parentIdentifier = parent.useCapability('adapter').identifier;
childIdentifier.namespace = parentIdentifier.namespace;
this.domainObject.id = this.openmct.objects.makeKeyString(childIdentifier);
};
/**
* Get the initial value for the form being described.
* This will include the values for all properties described