mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 21:53:08 +00:00
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct into condition-trigger
This commit is contained in:
commit
e526626e09
@ -114,14 +114,27 @@
|
||||
<ul v-if="telemetry.length"
|
||||
class="t-widget-condition-config"
|
||||
>
|
||||
<Criterion v-for="(criterion, index) in domainObject.configuration.criteria"
|
||||
:key="index"
|
||||
:telemetry="telemetry"
|
||||
:criterion="criterion"
|
||||
:index="index"
|
||||
:trigger="domainObject.configuration.trigger"
|
||||
@persist="persist"
|
||||
/>
|
||||
<li v-for="(criterion, index) in domainObject.configuration.criteria"
|
||||
:key="index"
|
||||
class="has-local-controls t-condition"
|
||||
>
|
||||
<Criterion :telemetry="telemetry"
|
||||
:criterion="criterion"
|
||||
:index="index"
|
||||
:trigger="domainObject.configuration.trigger"
|
||||
:is-default="domainObject.configuration.criteria.length === 1"
|
||||
@persist="persist"
|
||||
/>
|
||||
<div class="c-c__criterion-controls">
|
||||
<span class="is-enabled c-c__duplicate"
|
||||
@click="cloneCriterion(index)"
|
||||
></span>
|
||||
<span v-if="!(domainObject.configuration.criteria.length === 1)"
|
||||
class="is-enabled c-c__trash"
|
||||
@click="removeCriterion(index)"
|
||||
></span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="holder c-c-button-wrapper align-left">
|
||||
<span class="c-c-label-spacer"></span>
|
||||
@ -202,7 +215,8 @@ export default {
|
||||
expanded: true,
|
||||
selectedOutputKey: '',
|
||||
stringOutputField: false,
|
||||
outputOptions: ['false', 'true', 'string']
|
||||
outputOptions: ['false', 'true', 'string'],
|
||||
criterionIndex: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -265,6 +279,16 @@ export default {
|
||||
index: Number(ev.target.closest('.widget-condition').getAttribute('data-condition-index'))
|
||||
});
|
||||
},
|
||||
removeCriterion(index) {
|
||||
this.domainObject.configuration.criteria.splice(index, 1);
|
||||
this.persist()
|
||||
},
|
||||
cloneCriterion(index) {
|
||||
const clonedCriterion = {...this.domainObject.configuration.criteria[index]};
|
||||
this.domainObject.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
||||
this.persist()
|
||||
},
|
||||
|
||||
setOutput() {
|
||||
let conditionOutput = this.domainObject.configuration.output;
|
||||
if (conditionOutput) {
|
||||
|
@ -87,7 +87,6 @@
|
||||
import Condition from '../../condition/components/Condition.vue';
|
||||
import uuid from 'uuid';
|
||||
|
||||
|
||||
export default {
|
||||
inject: ['openmct', 'domainObject'],
|
||||
components: {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<li class="has-local-controls t-condition">
|
||||
<div>
|
||||
<label>{{ setRowLabel }}</label>
|
||||
<span class="t-configuration">
|
||||
<span class="controls">
|
||||
@ -46,8 +46,7 @@
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -197,3 +197,12 @@
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.c-c__criterion-controls {
|
||||
width: 28px;
|
||||
|
||||
.c-c__duplicate,
|
||||
.c-c__trash {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user