mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
Merge pull request #3364 from nasa/create-namespace-fix
Update namespace of object after location selected
This commit is contained in:
commit
9f6bfa2351
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user