mirror of
https://github.com/nasa/openmct.git
synced 2025-01-02 03:16:41 +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"
|
<ul v-if="telemetry.length"
|
||||||
class="t-widget-condition-config"
|
class="t-widget-condition-config"
|
||||||
>
|
>
|
||||||
<Criterion v-for="(criterion, index) in domainObject.configuration.criteria"
|
<li v-for="(criterion, index) in domainObject.configuration.criteria"
|
||||||
:key="index"
|
:key="index"
|
||||||
:telemetry="telemetry"
|
class="has-local-controls t-condition"
|
||||||
|
>
|
||||||
|
<Criterion :telemetry="telemetry"
|
||||||
:criterion="criterion"
|
:criterion="criterion"
|
||||||
:index="index"
|
:index="index"
|
||||||
:trigger="domainObject.configuration.trigger"
|
:trigger="domainObject.configuration.trigger"
|
||||||
|
:is-default="domainObject.configuration.criteria.length === 1"
|
||||||
@persist="persist"
|
@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>
|
</ul>
|
||||||
<div class="holder c-c-button-wrapper align-left">
|
<div class="holder c-c-button-wrapper align-left">
|
||||||
<span class="c-c-label-spacer"></span>
|
<span class="c-c-label-spacer"></span>
|
||||||
@ -202,7 +215,8 @@ export default {
|
|||||||
expanded: true,
|
expanded: true,
|
||||||
selectedOutputKey: '',
|
selectedOutputKey: '',
|
||||||
stringOutputField: false,
|
stringOutputField: false,
|
||||||
outputOptions: ['false', 'true', 'string']
|
outputOptions: ['false', 'true', 'string'],
|
||||||
|
criterionIndex: 0
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -265,6 +279,16 @@ export default {
|
|||||||
index: Number(ev.target.closest('.widget-condition').getAttribute('data-condition-index'))
|
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() {
|
setOutput() {
|
||||||
let conditionOutput = this.domainObject.configuration.output;
|
let conditionOutput = this.domainObject.configuration.output;
|
||||||
if (conditionOutput) {
|
if (conditionOutput) {
|
||||||
|
@ -87,7 +87,6 @@
|
|||||||
import Condition from '../../condition/components/Condition.vue';
|
import Condition from '../../condition/components/Condition.vue';
|
||||||
import uuid from 'uuid';
|
import uuid from 'uuid';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
inject: ['openmct', 'domainObject'],
|
inject: ['openmct', 'domainObject'],
|
||||||
components: {
|
components: {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<li class="has-local-controls t-condition">
|
<div>
|
||||||
<label>{{ setRowLabel }}</label>
|
<label>{{ setRowLabel }}</label>
|
||||||
<span class="t-configuration">
|
<span class="t-configuration">
|
||||||
<span class="controls">
|
<span class="controls">
|
||||||
@ -46,8 +46,7 @@
|
|||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -197,3 +197,12 @@
|
|||||||
border-radius: 2px;
|
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