mirror of
https://github.com/nasa/openmct.git
synced 2025-04-13 22:23:13 +00:00
[Creation] Retain space prefix
Retain space prefix from a parent when creating a new domain object, if there is a space prefix.
This commit is contained in:
parent
fd4c1ea747
commit
99f3b986b6
@ -34,8 +34,9 @@ define(
|
||||
* @memberof platform/core
|
||||
* @param $injector Angular's `$injector`
|
||||
*/
|
||||
function CreationCapability($injector) {
|
||||
function CreationCapability($injector, domainObject) {
|
||||
this.$injector = $injector;
|
||||
this.domainObject = domainObject;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,6 +65,12 @@ define(
|
||||
CreationCapability.prototype.create = function (model) {
|
||||
var id = uuid(),
|
||||
capabilities = this.getCapabilities(model);
|
||||
|
||||
// Retain any space-prefixing from the parent
|
||||
if (this.domainObject.getId().indexOf(":") !== -1) {
|
||||
id = this.domainObject.getId().split(":")[0] + ":" + id;
|
||||
}
|
||||
|
||||
return new DomainObjectImpl(id, model, capabilities);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user