mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 09:52:04 +00:00
[Persistence] Use identifierService from persistence
User identifierService from the persistence capability, for consistent interpretation of spaces associated with domain object identifiers.
This commit is contained in:
parent
a2db98d275
commit
689f80bb23
@ -44,12 +44,16 @@ define(
|
||||
* @constructor
|
||||
* @implements {Capability}
|
||||
*/
|
||||
function PersistenceCapability(persistenceService, space, domainObject) {
|
||||
function PersistenceCapability(
|
||||
persistenceService,
|
||||
identifierService,
|
||||
domainObject
|
||||
) {
|
||||
// Cache modified timestamp
|
||||
this.modified = domainObject.getModel().modified;
|
||||
|
||||
this.domainObject = domainObject;
|
||||
this.space = space;
|
||||
this.identifierService = identifierService;
|
||||
this.persistenceService = persistenceService;
|
||||
}
|
||||
|
||||
@ -135,11 +139,8 @@ define(
|
||||
* be used to persist this object
|
||||
*/
|
||||
PersistenceCapability.prototype.getSpace = function () {
|
||||
if (this.domainObject.getId().indexOf(":") !== -1) {
|
||||
return this.domainObject.getId().split(":")[0];
|
||||
}
|
||||
|
||||
return this.space;
|
||||
var id = this.domainObject.getId();
|
||||
return this.identifierService.parse(id).getSpace();
|
||||
};
|
||||
|
||||
return PersistenceCapability;
|
||||
|
Loading…
x
Reference in New Issue
Block a user