mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 18:57:01 +00:00
Sends new style object to the object API for save when calling it from legacy persistence adapter (#3431)
Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
This commit is contained in:
parent
6923f17645
commit
a192d46c2b
@ -20,6 +20,8 @@
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
import utils from 'objectUtils';
|
||||
|
||||
export default class LegacyPersistenceAdapter {
|
||||
constructor(openmct) {
|
||||
this.openmct = openmct;
|
||||
@ -33,8 +35,13 @@ export default class LegacyPersistenceAdapter {
|
||||
return Promise.resolve(Object.keys(this.openmct.objects.providers));
|
||||
}
|
||||
|
||||
updateObject(legacyDomainObject) {
|
||||
return this.openmct.objects.save(legacyDomainObject.useCapability('adapter'));
|
||||
updateObject(space, key, legacyDomainObject) {
|
||||
let object = utils.toNewFormat(legacyDomainObject, {
|
||||
namespace: space,
|
||||
key: key
|
||||
});
|
||||
|
||||
return this.openmct.objects.save(object);
|
||||
}
|
||||
|
||||
readObject(space, key) {
|
||||
|
@ -22,9 +22,10 @@
|
||||
|
||||
import CouchObjectProvider from './CouchObjectProvider';
|
||||
const NAMESPACE = '';
|
||||
const PERSISTENCE_SPACE = 'mct';
|
||||
|
||||
export default function CouchPlugin(url) {
|
||||
return function install(openmct) {
|
||||
openmct.objects.addProvider(NAMESPACE, new CouchObjectProvider(openmct, url, NAMESPACE));
|
||||
openmct.objects.addProvider(PERSISTENCE_SPACE, new CouchObjectProvider(openmct, url, NAMESPACE));
|
||||
};
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ describe('the plugin', () => {
|
||||
beforeEach((done) => {
|
||||
mockDomainObject = {
|
||||
identifier: {
|
||||
namespace: '',
|
||||
namespace: 'mct',
|
||||
key: 'some-value'
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user