removed refs from dom elements and added index to call to isLastCriterion

This commit is contained in:
Joel McKinnon 2020-03-24 09:43:54 -07:00
parent 87513a14b7
commit 0a2e912091
2 changed files with 9 additions and 11 deletions

View File

@ -41,7 +41,6 @@
></span>
<span class="c-condition__name">{{ condition.configuration.name }}</span>
<!-- TODO: description should be derived from criteria -->
<span v-if="condition.isDefault"
class="c-condition__summary"
>
@ -59,7 +58,7 @@
:key="index"
>
{{ getRule(criterion, index) }}
<template v-if="!isLastCriterion">
<template v-if="!isLastCriterion(index)">
{{ getConjunction }}
</template>
</span>
@ -198,7 +197,7 @@
:key="index"
>
{{ getRule(criterion, index) }}
<template v-if="!isLastCriterion">
<template v-if="!isLastCriterion(index)">
{{ getConjunction }}
</template>
</span>

View File

@ -4,8 +4,8 @@
<span class="c-cdef__label">{{ setRowLabel }}</span>
<span class="c-cdef__controls">
<span class="c-cdef__control">
<select ref="telemetrySelect"
v-model="criterion.telemetry"
<select v-model="criterion.telemetry"
class="js-telemetry-select"
@change="updateMetadataOptions"
>
<option value="">- Select Telemetry -</option>
@ -20,8 +20,8 @@
<span v-if="criterion.telemetry"
class="c-cdef__control"
>
<select ref="metadataSelect"
v-model="criterion.metadata"
<select v-model="criterion.metadata"
class="js-metadata-select"
@change="updateOperations"
>
<option value="">- Select Field -</option>
@ -36,8 +36,7 @@
<span v-if="criterion.telemetry && criterion.metadata"
class="c-cdef__control"
>
<select ref="operationSelect"
v-model="criterion.operation"
<select v-model="criterion.operation"
@change="updateOperationInputVisibility"
>
<option value="">- Select Comparison -</option>
@ -202,10 +201,10 @@ export default {
}
},
clearDependentFields(el) {
if (el === this.$refs.telemetrySelect) {
if (el.classList.contains('js-telemetry-select')) {
this.criterion.metadata = '';
this.criterion.operation = '';
} else if (el === this.$refs.metadataSelect) {
} else if (el.classList.contains('js-metadata-select')) {
this.criterion.operation = '';
}
this.criterion.input = [];