mirror of
https://github.com/nasa/openmct.git
synced 2025-06-12 20:28:14 +00:00
Legacy and new object providers work together (#3461)
* Strip mct namespace from ids when getting models from cache * Revert PersistenceCapability to use legacy code Enforce empty namespace for LegacyPersistenceAdapter for new object providers * Reverts change to caching provider * CouchObject provider is registered with the mct space. When saving objects via the persistence capability use the mct space to find the couchdb object provider
This commit is contained in:
@ -114,7 +114,12 @@ define(["objectUtils"],
|
||||
var self = this,
|
||||
domainObject = this.domainObject;
|
||||
|
||||
let newStyleObject = objectUtils.toNewFormat(domainObject.getModel(), domainObject.getId());
|
||||
const identifier = {
|
||||
namespace: this.getSpace(),
|
||||
key: this.getKey()
|
||||
};
|
||||
|
||||
let newStyleObject = objectUtils.toNewFormat(domainObject.getModel(), identifier);
|
||||
|
||||
return this.openmct.objects
|
||||
.save(newStyleObject)
|
||||
@ -146,6 +151,7 @@ define(["objectUtils"],
|
||||
return domainObject.useCapability("mutation", function () {
|
||||
return model;
|
||||
}, modified);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,11 +159,10 @@ define(["objectUtils"],
|
||||
return this.$q.when(true);
|
||||
}
|
||||
|
||||
return this.openmct.objects.get(domainObject.getId()).then((newStyleObject) => {
|
||||
let oldStyleObject = this.openmct.legacyObject(newStyleObject);
|
||||
|
||||
return updateModel(oldStyleObject.getModel());
|
||||
});
|
||||
return this.persistenceService.readObject(
|
||||
this.getSpace(),
|
||||
this.getKey()
|
||||
).then(updateModel);
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user