diff --git a/src/plugins/condition/Condition.js b/src/plugins/condition/Condition.js index 9e0a26e041..36e72e7fed 100644 --- a/src/plugins/condition/Condition.js +++ b/src/plugins/condition/Condition.js @@ -37,7 +37,7 @@ import {computeCondition} from "@/plugins/condition/utils/evaluator"; * { * telemetry: '', * operation: '', -* input: '', +* input: [], * metadata: '' * } * ] diff --git a/src/plugins/condition/components/Condition.vue b/src/plugins/condition/components/Condition.vue index c930fee550..146cb566a5 100644 --- a/src/plugins/condition/components/Condition.vue +++ b/src/plugins/condition/components/Condition.vue @@ -82,7 +82,7 @@ :key="option" :value="option" > - {{ option.charAt(0).toUpperCase() + option.slice(1) }} + {{ initCap(option) }} { this.telemetryMetadata = this.openmct.telemetry.getMetadata(telemetryObject); this.telemetryMetadataOptions = this.telemetryMetadata.values(); + this.updateOperations(); + this.updateOperationInputVisibility(); }); + } else { + this.criterion.metadata = ''; } this.persist(); }, updateOperations(ev) { + if (ev) { + this.criterion.operation = ''; + this.criterion.input = []; + } let operationFormat = 'string'; this.telemetryMetadata.valueMetadatas.forEach((value, index) => { - if (value.key === ev.target.value) { + if (value.key === this.criterion.metadata) { let valueMetadata = this.telemetryMetadataOptions[index]; if (valueMetadata.formatString) { operationFormat = 'number'; @@ -128,7 +140,10 @@ export default { }); this.filteredOps = [...this.operations.filter(op => op.appliesTo.indexOf(operationFormat) !== -1)]; }, - updateOperationInputVisibility() { + updateOperationInputVisibility(ev) { + if (ev) { + this.criterion.input = []; + } if (this.criterion.operation === '') { this.isInputOperation = false; } else {