mirror of
https://github.com/nasa/openmct.git
synced 2025-03-22 12:05:19 +00:00
more identifier fixes to search
This commit is contained in:
parent
3b316ed491
commit
526e31d10c
@ -223,6 +223,7 @@ class InMemorySearchProvider {
|
||||
|
||||
onMutationOfIndexedObject(domainObject) {
|
||||
const provider = this;
|
||||
|
||||
provider.index(domainObject);
|
||||
}
|
||||
|
||||
@ -236,14 +237,13 @@ class InMemorySearchProvider {
|
||||
*/
|
||||
async index(domainObject) {
|
||||
const provider = this;
|
||||
const identifier = domainObject.identifier;
|
||||
const keyString = this.openmct.objects.makeKeyString(identifier);
|
||||
const keyString = this.openmct.objects.makeKeyString(domainObject.identifier);
|
||||
|
||||
if (!this.indexedIds[keyString]) {
|
||||
this.indexedIds[keyString] = this.openmct.objects.observe(domainObject, '*', this.onMutationOfIndexedObject);
|
||||
}
|
||||
|
||||
if ((identifier.key !== 'ROOT')) {
|
||||
if ((keyString !== 'ROOT')) {
|
||||
if (this.worker) {
|
||||
this.worker.port.postMessage({
|
||||
request: 'index',
|
||||
@ -258,9 +258,9 @@ class InMemorySearchProvider {
|
||||
const composition = this.openmct.composition.get(domainObject);
|
||||
|
||||
if (composition !== undefined) {
|
||||
const childIdentifiers = await composition.load(domainObject);
|
||||
childIdentifiers.forEach(function (childIdentifier) {
|
||||
provider.scheduleForIndexing(childIdentifier);
|
||||
const children = await composition.load(domainObject);
|
||||
children.forEach(function (child) {
|
||||
provider.scheduleForIndexing(child.identifier);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -277,9 +277,9 @@ class InMemorySearchProvider {
|
||||
const provider = this;
|
||||
|
||||
this.pendingRequests += 1;
|
||||
const identifier = await this.openmct.objects.parseKeyString(keyString);
|
||||
const domainObject = await this.openmct.objects.get(identifier);
|
||||
const domainObject = await this.openmct.objects.get(keyString);
|
||||
delete provider.pendingIndex[keyString];
|
||||
|
||||
try {
|
||||
if (domainObject) {
|
||||
await provider.index(domainObject);
|
||||
|
Loading…
x
Reference in New Issue
Block a user