mirror of
https://github.com/nasa/openmct.git
synced 2025-02-01 16:58:04 +00:00
remove criterion working
This commit is contained in:
parent
2a9ccdcffd
commit
7fc825949c
@ -111,15 +111,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="trigger"
|
||||
:is-default="domainObject.configuration.criteria.length === 1"
|
||||
@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="trigger"
|
||||
:is-default="domainObject.configuration.criteria.length === 1"
|
||||
@persist="persist"
|
||||
/>
|
||||
<div class="temp">
|
||||
<span class="is-enabled c-c__duplicate"
|
||||
@click="cloneCriterion"
|
||||
></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>
|
||||
@ -201,7 +213,8 @@ export default {
|
||||
trigger: 'all',
|
||||
selectedOutputKey: '',
|
||||
stringOutputField: false,
|
||||
outputOptions: ['false', 'true', 'string']
|
||||
outputOptions: ['false', 'true', 'string'],
|
||||
criterionIndex: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -264,6 +277,14 @@ 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(ev) {
|
||||
// console.log('cloneCriterion')
|
||||
},
|
||||
|
||||
setOutput() {
|
||||
let conditionOutput = this.domainObject.configuration.output;
|
||||
if (conditionOutput) {
|
||||
|
@ -84,7 +84,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,17 +46,7 @@
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
<div class="temp">
|
||||
<span class="is-enabled c-c__duplicate"
|
||||
@click="cloneCriterion"
|
||||
></span>
|
||||
<span v-if="!isDefault"
|
||||
class="is-enabled c-c__trash"
|
||||
@click="removeCriterion"
|
||||
></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -104,7 +94,6 @@ export default {
|
||||
mounted() {
|
||||
this.updateMetadataOptions();
|
||||
this.updateOperationInputVisibility();
|
||||
console.log('this.isDefault', this.isDefault);
|
||||
},
|
||||
methods: {
|
||||
updateMetadataOptions() {
|
||||
@ -127,18 +116,6 @@ export default {
|
||||
updateMetadataSelection() {
|
||||
this.updateOperationInputVisibility();
|
||||
},
|
||||
removeCriterion(ev) {
|
||||
console.log('removeCriterion', this.index);
|
||||
// this.$emit('removeCondition', this.conditionIdentifier);
|
||||
},
|
||||
cloneCriterion(ev) {
|
||||
console.log('cloneCriterion')
|
||||
// this.$emit('cloneCondition', {
|
||||
// identifier: this.conditionIdentifier,
|
||||
// index: Number(ev.target.closest('.widget-condition').getAttribute('data-condition-index'))
|
||||
// });
|
||||
},
|
||||
|
||||
persist() {
|
||||
this.$emit('persist', this.criterion);
|
||||
}
|
||||
|
@ -199,7 +199,7 @@
|
||||
}
|
||||
|
||||
.temp {
|
||||
width: 24px;
|
||||
width: 28px;
|
||||
|
||||
.c-c__duplicate,
|
||||
.c-c__trash {
|
||||
|
Loading…
x
Reference in New Issue
Block a user