mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 04:38:15 +00:00
Remove telemetry from criteria when not editing a condition set (#2933)
This commit is contained in:
@ -70,7 +70,7 @@ export default class ConditionManager extends EventEmitter {
|
|||||||
this.subscriptions[id]();
|
this.subscriptions[id]();
|
||||||
delete this.subscriptions[id];
|
delete this.subscriptions[id];
|
||||||
delete this.telemetryObjects[id];
|
delete this.telemetryObjects[id];
|
||||||
this.updateConditionTelemetry();
|
this.removeConditionTelemetry();
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize() {
|
initialize() {
|
||||||
@ -86,6 +86,27 @@ export default class ConditionManager extends EventEmitter {
|
|||||||
this.conditionClassCollection.forEach((condition) => condition.updateTelemetry());
|
this.conditionClassCollection.forEach((condition) => condition.updateTelemetry());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
removeConditionTelemetry() {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (conditionsChanged) {
|
||||||
|
this.persistConditions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updateCondition(conditionConfiguration, index) {
|
updateCondition(conditionConfiguration, index) {
|
||||||
let condition = this.conditionClassCollection[index];
|
let condition = this.conditionClassCollection[index];
|
||||||
condition.update(conditionConfiguration);
|
condition.update(conditionConfiguration);
|
||||||
|
Reference in New Issue
Block a user