Adds new check to clearData that enables data clearing on overlay plots.

This commit is contained in:
Peter Di Pasquale 2024-12-12 15:46:50 -08:00
parent 5be103ea72
commit aca47274a6

View File

@ -734,6 +734,21 @@ export default {
);
});
},
plotCompositionContainsId(domainObjectToFind) {
if (!this.domainObject.composition) {
return false;
}
if (!domainObjectToFind.identifier) {
return false;
}
return this.domainObject.composition.some((compositionIdentifier) => {
return this.openmct.objects.areIdsEqual(
compositionIdentifier,
domainObjectToFind.identifier
);
});
},
clearData(domainObjectToClear) {
// If we don't have an object to clear (global), or the IDs are equal, just clear the data.
@ -747,7 +762,8 @@ export default {
domainObjectToClear.identifier,
this.domainObject.identifier
) ||
this.compositionPathContainsId(domainObjectToClear)
this.compositionPathContainsId(domainObjectToClear) ||
this.plotCompositionContainsId(domainObjectToClear)
) {
this.clearSeries();
}