From 4ede6351eca6d9172337abad7ff0a5bff9bf5d00 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Fri, 14 Feb 2020 12:45:32 -0800 Subject: [PATCH] addressed some review comments --- .../condition/components/Condition.vue | 1 - .../components/ConditionCollection.vue | 5 ++-- .../condition/components/Criterion.vue | 25 +++++++++---------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/plugins/condition/components/Condition.vue b/src/plugins/condition/components/Condition.vue index 96bec08a80..237ad3330a 100644 --- a/src/plugins/condition/components/Condition.vue +++ b/src/plugins/condition/components/Condition.vue @@ -93,7 +93,6 @@ :key="index" :telemetry="telemetry" :criterion="criterion" - :condition="domainObject" :index="index" :trigger="trigger" @persist="persist" diff --git a/src/plugins/condition/components/ConditionCollection.vue b/src/plugins/condition/components/ConditionCollection.vue index 1a57b3f01a..0492cc338b 100644 --- a/src/plugins/condition/components/ConditionCollection.vue +++ b/src/plugins/condition/components/ConditionCollection.vue @@ -107,6 +107,7 @@ export default { }, destroyed() { this.composition.off('add', this.addTelemetryObject); + this.composition.off('remove', this.removeTelemetryObject); }, mounted() { this.instantiate = this.openmct.$injector.get('instantiate'); @@ -238,7 +239,7 @@ export default { metadata: '', identifier: { namespace: '', - key: this.telemetryObjs.length ? this.openmct.objects.makeKeyString(this.telemetryObjs[0].identifier) : null + key: '' } }] }, @@ -262,7 +263,7 @@ export default { }); this.conditionCollection.splice(index, 1); this.persist(); - this.updateCurrentConditionIdentifier(); + this.updateCurrentConditionId(); }, reorder(reorderPlan) { let oldConditions = this.conditionCollection.slice(); diff --git a/src/plugins/condition/components/Criterion.vue b/src/plugins/condition/components/Criterion.vue index c82bf817da..f8a15f5081 100644 --- a/src/plugins/condition/components/Criterion.vue +++ b/src/plugins/condition/components/Criterion.vue @@ -71,10 +71,6 @@ export default { type: Number, required: true }, - condition: { - type: Object, - required: true - }, trigger: { type: String, required: true @@ -104,7 +100,6 @@ export default { this.initialize(); }, updated() { - this.persist(); }, methods: { initialize() { @@ -114,7 +109,6 @@ export default { this.comparisonInputValue = this.criterion.input; this.updateOperationInput(); this.updateFieldOptions(); - }, updateFieldOptions() { if (this.selectedTelemetryObject) { @@ -122,16 +116,21 @@ export default { this.telemetryMetadata = this.openmct.telemetry.getMetadata(telemetryObject).values(); }); } + this.persist(); }, updateOperationInput() { - if (this.selectedOperationOption && - (this.selectedOperationOption !== 'isUndefined' && - this.selectedOperationOption !== 'isDefined')) { - this.isInputOperation = true; - } else { - this.isInputOperation = false; - this.comparisonInputValue = ''; + for (let i=0; i < this.operations.length; i++) { + if (this.selectedOperationOption === this.operations[i].name) { + if (this.operations[i].inputCount > 0) { + this.isInputOperation = true; + } else { + this.isInputOperation = false; + this.comparisonInputValue = ''; + } + } } + this.persist(); + }, persist() { this.criterion.telemetry = this.selectedTelemetryObject;