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"
:telemetry="telemetry"
:criterion="criterion"
:condition="domainObject"
:index="index"
:trigger="trigger"
@persist="persist"

View File

@ -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();

View File

@ -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;