addressed some review comments

This commit is contained in:
Joel McKinnon
2020-02-14 12:45:32 -08:00
parent 24bbcb466f
commit 4ede6351ec
3 changed files with 15 additions and 16 deletions

View File

@ -93,7 +93,6 @@
:key="index" :key="index"
:telemetry="telemetry" :telemetry="telemetry"
:criterion="criterion" :criterion="criterion"
:condition="domainObject"
:index="index" :index="index"
:trigger="trigger" :trigger="trigger"
@persist="persist" @persist="persist"

View File

@ -107,6 +107,7 @@ export default {
}, },
destroyed() { destroyed() {
this.composition.off('add', this.addTelemetryObject); this.composition.off('add', this.addTelemetryObject);
this.composition.off('remove', this.removeTelemetryObject);
}, },
mounted() { mounted() {
this.instantiate = this.openmct.$injector.get('instantiate'); this.instantiate = this.openmct.$injector.get('instantiate');
@ -238,7 +239,7 @@ export default {
metadata: '', metadata: '',
identifier: { identifier: {
namespace: '', 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.conditionCollection.splice(index, 1);
this.persist(); this.persist();
this.updateCurrentConditionIdentifier(); this.updateCurrentConditionId();
}, },
reorder(reorderPlan) { reorder(reorderPlan) {
let oldConditions = this.conditionCollection.slice(); let oldConditions = this.conditionCollection.slice();

View File

@ -71,10 +71,6 @@ export default {
type: Number, type: Number,
required: true required: true
}, },
condition: {
type: Object,
required: true
},
trigger: { trigger: {
type: String, type: String,
required: true required: true
@ -104,7 +100,6 @@ export default {
this.initialize(); this.initialize();
}, },
updated() { updated() {
this.persist();
}, },
methods: { methods: {
initialize() { initialize() {
@ -114,7 +109,6 @@ export default {
this.comparisonInputValue = this.criterion.input; this.comparisonInputValue = this.criterion.input;
this.updateOperationInput(); this.updateOperationInput();
this.updateFieldOptions(); this.updateFieldOptions();
}, },
updateFieldOptions() { updateFieldOptions() {
if (this.selectedTelemetryObject) { if (this.selectedTelemetryObject) {
@ -122,16 +116,21 @@ export default {
this.telemetryMetadata = this.openmct.telemetry.getMetadata(telemetryObject).values(); this.telemetryMetadata = this.openmct.telemetry.getMetadata(telemetryObject).values();
}); });
} }
this.persist();
}, },
updateOperationInput() { updateOperationInput() {
if (this.selectedOperationOption && for (let i=0; i < this.operations.length; i++) {
(this.selectedOperationOption !== 'isUndefined' && if (this.selectedOperationOption === this.operations[i].name) {
this.selectedOperationOption !== 'isDefined')) { if (this.operations[i].inputCount > 0) {
this.isInputOperation = true; this.isInputOperation = true;
} else { } else {
this.isInputOperation = false; this.isInputOperation = false;
this.comparisonInputValue = ''; this.comparisonInputValue = '';
}
}
} }
this.persist();
}, },
persist() { persist() {
this.criterion.telemetry = this.selectedTelemetryObject; this.criterion.telemetry = this.selectedTelemetryObject;