fixed updateOperations, clearDependentFields, removed unnecessary ref

This commit is contained in:
Joel McKinnon 2020-03-27 08:52:23 -07:00
parent bf947a8835
commit 5f061001d6
2 changed files with 8 additions and 10 deletions

View File

@ -20,8 +20,7 @@
<span v-if="criterion.telemetry"
class="c-cdef__control"
>
<select ref="metadataSelect"
v-model="criterion.metadata"
<select v-model="criterion.metadata"
@change="updateOperations"
>
<option value="">- Select Field -</option>
@ -200,7 +199,7 @@ export default {
}
},
updateOperations(ev) {
if (ev && ev.target === this.$refs.telemetrySelect) {
if (ev) {
this.clearDependentFields(ev.target);
this.persist();
}
@ -208,8 +207,9 @@ export default {
},
updateOperationInputVisibility(ev) {
if (ev) {
this.criterion.input = this.enumerations.length ? [this.enumerations[0].value.toString()] : [];
this.inputCount = 0;
if (this.enumerations.length) {
this.criterion.input = [this.enumerations[0].value.toString()];
}
this.persist();
}
for (let i = 0; i < this.filteredOps.length; i++) {
@ -222,10 +222,8 @@ export default {
clearDependentFields(el) {
if (el === this.$refs.telemetrySelect) {
this.criterion.metadata = '';
this.criterion.operation = '';
} else if (el === this.$refs.metadataSelect) {
this.criterion.operation = '';
}
this.criterion.operation = '';
this.criterion.input = [];
this.inputCount = 0;
},

View File

@ -82,7 +82,7 @@ export const OPERATIONS = [
appliesTo: ['number'],
inputCount: 2,
getDescription: function (values) {
return ' is between ' + values.join(', ') + ' and ' + values[1];
return ' is between ' + values[0] + ' and ' + values[1];
}
},
{
@ -94,7 +94,7 @@ export const OPERATIONS = [
appliesTo: ['number'],
inputCount: 2,
getDescription: function (values) {
return ' is not between ' + values.join(', ') + ' and ' + values[1];
return ' is not between ' + values[0] + ' and ' + values[1];
}
},
{