trigger label and add divider

This commit is contained in:
Joel McKinnon 2020-02-12 15:58:17 -08:00
parent 6e5e8f0ce8
commit b6ce9c6ed7
3 changed files with 20 additions and 6 deletions

View File

@ -95,6 +95,7 @@
:criterion="criterion"
:condition="domainObject"
:index="index"
:trigger="trigger"
@persist="persist"
/>
</ul>
@ -176,7 +177,7 @@ export default {
domainObject: this.domainObject,
currentCriteria: this.currentCriteria,
expanded: true,
trigger: 'any',
trigger: 'all',
selectedOutputKey: '',
stringOutputField: false,
outputOptions: ['false', 'true', 'string']

View File

@ -1,6 +1,6 @@
<template>
<li class="has-local-controls t-condition">
<label>{{ index === 0 ? 'when' : 'and when' }}</label>
<label>{{ setRowLabel }}</label>
<span class="t-configuration">
<span class="controls">
<select v-model="selectedTelemetryObject"
@ -74,6 +74,10 @@ export default {
condition: {
type: Object,
required: true
},
trigger: {
type: String,
required: true
}
},
data() {
@ -85,12 +89,23 @@ export default {
selectedOperationOption: '',
operationValue: '',
comparisonInputValue: '',
isInputOperation: false
isInputOperation: false,
rowLabel: ''
}
},
computed: {
setRowLabel: function () {
let operator = this.trigger === 'all' ? 'and ': 'or ';
return (this.index !== 0 ? operator : '') + 'when';
}
},
mounted() {
this.initialize();
},
updated() {
this.persist();
},
methods: {
initialize() {
this.selectedTelemetryObject = this.criterion.telemetry;
@ -107,7 +122,6 @@ export default {
this.telemetryMetadata = this.openmct.telemetry.getMetadata(telemetryObject).values();
});
}
this.persist();
},
updateOperationInput() {
if (this.selectedOperationOption &&
@ -118,7 +132,6 @@ export default {
this.isInputOperation = false;
this.comparisonInputValue = '';
}
this.persist();
},
persist() {
this.criterion.telemetry = this.selectedTelemetryObject;

View File

@ -92,7 +92,7 @@
margin: 0 3px;
}
.widget-condition-content.expanded ul {
.widget-condition-content.expanded ul li {
border-top: solid 1px #ccc;
padding: 2px;
}