mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 08:25:31 +00:00
Check for any and all criteria (#2948)
This commit is contained in:
parent
83c273b976
commit
4a39ddf425
@ -90,15 +90,18 @@ export default class ConditionManager extends EventEmitter {
|
||||
let conditionsChanged = false;
|
||||
this.conditionSetDomainObject.configuration.conditionCollection.forEach((conditionConfiguration) => {
|
||||
conditionConfiguration.configuration.criteria.forEach((criterion, index) => {
|
||||
const found = Object.values(this.telemetryObjects).find((telemetryObject) => {
|
||||
return this.openmct.objects.areIdsEqual(telemetryObject.identifier, criterion.telemetry);
|
||||
});
|
||||
if (!found) {
|
||||
criterion.telemetry = '';
|
||||
criterion.metadata = '';
|
||||
criterion.input = [];
|
||||
criterion.operation = '';
|
||||
conditionsChanged = true;
|
||||
const isAnyAllTelemetry = criterion.telemetry && (criterion.telemetry === 'any' || criterion.telemetry === 'all');
|
||||
if (!isAnyAllTelemetry) {
|
||||
const found = Object.values(this.telemetryObjects).find((telemetryObject) => {
|
||||
return this.openmct.objects.areIdsEqual(telemetryObject.identifier, criterion.telemetry);
|
||||
});
|
||||
if (!found) {
|
||||
criterion.telemetry = '';
|
||||
criterion.metadata = '';
|
||||
criterion.input = [];
|
||||
criterion.operation = '';
|
||||
conditionsChanged = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user