mirror of
https://github.com/nasa/openmct.git
synced 2025-01-04 12:24:10 +00:00
Merge pull request #2802 from nasa/clone-condition-issues
Clone condition, criteria issues
This commit is contained in:
commit
d00e8b68a5
@ -138,11 +138,11 @@ export default class ConditionManager extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cloneCondition(conditionConfiguration, index) {
|
cloneCondition(conditionConfiguration, index) {
|
||||||
this.createAndSaveCondition(index, conditionConfiguration);
|
this.createAndSaveCondition(index, JSON.parse(JSON.stringify(conditionConfiguration)));
|
||||||
}
|
}
|
||||||
|
|
||||||
createAndSaveCondition(index, conditionConfiguration) {
|
createAndSaveCondition(index, conditionConfiguration) {
|
||||||
let newCondition = this.createCondition(conditionConfiguration);
|
const newCondition = this.createCondition(conditionConfiguration);
|
||||||
if (index !== undefined) {
|
if (index !== undefined) {
|
||||||
this.conditionSetDomainObject.configuration.conditionCollection.splice(index + 1, 0, newCondition);
|
this.conditionSetDomainObject.configuration.conditionCollection.splice(index + 1, 0, newCondition);
|
||||||
} else {
|
} else {
|
||||||
|
@ -291,12 +291,12 @@ export default {
|
|||||||
},
|
},
|
||||||
removeCriterion(index) {
|
removeCriterion(index) {
|
||||||
this.condition.configuration.criteria.splice(index, 1);
|
this.condition.configuration.criteria.splice(index, 1);
|
||||||
this.persist()
|
this.persist();
|
||||||
},
|
},
|
||||||
cloneCriterion(index) {
|
cloneCriterion(index) {
|
||||||
const clonedCriterion = {...this.condition.configuration.criteria[index]};
|
const clonedCriterion = JSON.parse(JSON.stringify(this.condition.configuration.criteria[index]));
|
||||||
this.condition.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
this.condition.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
||||||
this.persist()
|
this.persist();
|
||||||
},
|
},
|
||||||
persist() {
|
persist() {
|
||||||
this.$emit('updateCondition', {
|
this.$emit('updateCondition', {
|
||||||
|
@ -117,14 +117,6 @@ export default {
|
|||||||
inputTypes: INPUT_TYPES
|
inputTypes: INPUT_TYPES
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
telemetry: {
|
|
||||||
handler(newTelemetry, oldTelemetry) {
|
|
||||||
this.checkTelemetry();
|
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
setRowLabel: function () {
|
setRowLabel: function () {
|
||||||
let operator = this.trigger === 'all' ? 'and ': 'or ';
|
let operator = this.trigger === 'all' ? 'and ': 'or ';
|
||||||
@ -148,6 +140,14 @@ export default {
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
telemetry: {
|
||||||
|
handler(newTelemetry, oldTelemetry) {
|
||||||
|
this.checkTelemetry();
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.updateMetadataOptions();
|
this.updateMetadataOptions();
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user