Compare commits

...

2 Commits

Author SHA1 Message Date
555497604c Test persistence with multiple namespaces 2022-01-14 09:53:19 -08:00
e581ccb120 Generate keystring from identifier, not key 2022-01-14 09:51:09 -08:00
2 changed files with 30 additions and 2 deletions

View File

@ -75,8 +75,36 @@
const TWO_HOURS = ONE_HOUR * 2;
const ONE_DAY = ONE_HOUR * 24;
openmct.install(openmct.plugins.LocalStorage());
openmct.install(openmct.plugins.LocalStorage('namespace1', 'namespace1'));
openmct.install(openmct.plugins.LocalStorage('namespace2', 'namespace2'));
openmct.install((openmct) => {
openmct.objects.addRoot({
namespace: 'namespace1',
key: 'root'
});
openmct.objects.addRoot({
namespace: 'namespace2',
key: 'root'
});
openmct.objects.addGetInterceptor({
appliesTo: (identifier, object) => {
return (identifier.namespace === 'namespace1'
|| identifier.namespace === 'namespace2')
&& identifier.key === 'root'
&& (object === undefined || object.type === 'missing');
},
invoke: (identifier, domainObject) => {
return {
identifier: identifier,
type: 'folder',
location: 'mine',
name: identifier.namespace,
composition: []
}
}
});
});
openmct.install(openmct.plugins.Espresso());
openmct.install(openmct.plugins.MyItems());

View File

@ -106,7 +106,7 @@ export default class CreateAction extends PropertiesAction {
}
const url = '#/browse/' + objectPath
.map(object => object && this.openmct.objects.makeKeyString(object.identifier.key))
.map(object => object && this.openmct.objects.makeKeyString(object.identifier))
.reverse()
.join('/');