added isLastCriterion comp method

This commit is contained in:
Joel McKinnon 2020-03-18 10:24:43 -07:00
parent 316e0f24cf
commit 0cd2799d00

View File

@ -59,7 +59,7 @@
:key="index"
>
{{ getRule(criterion, index) }}
<template v-if="index !== condition.configuration.criteria.length - 1">
<template v-if="!isLastCriterion">
{{ getConjunction }}
</template>
</span>
@ -196,7 +196,7 @@
:key="index"
>
{{ getRule(criterion, index) }}
<template v-if="index !== condition.configuration.criteria.length - 1">
<template v-if="!isLastCriterion">
{{ getConjunction }}
</template>
</span>
@ -271,6 +271,9 @@ export default {
getRule(criterion, index) {
return `${criterion.telemetry.name} ${criterion.telemetry.fieldName} ${this.findDescription(criterion.operation, criterion.input)}`;
},
isLastCriterion(index) {
return index === this.condition.configuration.criteria.length - 1;
},
findDescription(operation, values) {
for (let i=0, ii= OPERATIONS.length; i < ii; i++) {
if (operation === OPERATIONS[i].name) {