[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:
@@ -34,8 +34,9 @@ define(
|
|||||||
* @memberof platform/core
|
* @memberof platform/core
|
||||||
* @param $injector Angular's `$injector`
|
* @param $injector Angular's `$injector`
|
||||||
*/
|
*/
|
||||||
function CreationCapability($injector) {
|
function CreationCapability($injector, domainObject) {
|
||||||
this.$injector = $injector;
|
this.$injector = $injector;
|
||||||
|
this.domainObject = domainObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,6 +65,12 @@ define(
|
|||||||
CreationCapability.prototype.create = function (model) {
|
CreationCapability.prototype.create = function (model) {
|
||||||
var id = uuid(),
|
var id = uuid(),
|
||||||
capabilities = this.getCapabilities(model);
|
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);
|
return new DomainObjectImpl(id, model, capabilities);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user