mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 09:52:04 +00:00
Update namespace of object after location selected
This commit is contained in:
parent
18b2a270c9
commit
888afd88b8
@ -112,6 +112,9 @@ define(
|
|||||||
formModel = this.createModel(formValue);
|
formModel = this.createModel(formValue);
|
||||||
|
|
||||||
formModel.location = parent.getId();
|
formModel.location = parent.getId();
|
||||||
|
|
||||||
|
this.updateNamespaceFromParent(parent);
|
||||||
|
|
||||||
this.domainObject.useCapability("mutation", function () {
|
this.domainObject.useCapability("mutation", function () {
|
||||||
return formModel;
|
return formModel;
|
||||||
});
|
});
|
||||||
@ -119,6 +122,14 @@ define(
|
|||||||
return this.domainObject;
|
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.
|
* Get the initial value for the form being described.
|
||||||
* This will include the values for all properties described
|
* This will include the values for all properties described
|
||||||
|
Loading…
x
Reference in New Issue
Block a user