mirror of
https://github.com/nasa/openmct.git
synced 2024-12-30 01:48:51 +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) {
|
||||
this.createAndSaveCondition(index, conditionConfiguration);
|
||||
this.createAndSaveCondition(index, JSON.parse(JSON.stringify(conditionConfiguration)));
|
||||
}
|
||||
|
||||
createAndSaveCondition(index, conditionConfiguration) {
|
||||
let newCondition = this.createCondition(conditionConfiguration);
|
||||
const newCondition = this.createCondition(conditionConfiguration);
|
||||
if (index !== undefined) {
|
||||
this.conditionSetDomainObject.configuration.conditionCollection.splice(index + 1, 0, newCondition);
|
||||
} else {
|
||||
|
@ -291,12 +291,12 @@ export default {
|
||||
},
|
||||
removeCriterion(index) {
|
||||
this.condition.configuration.criteria.splice(index, 1);
|
||||
this.persist()
|
||||
this.persist();
|
||||
},
|
||||
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.persist()
|
||||
this.persist();
|
||||
},
|
||||
persist() {
|
||||
this.$emit('updateCondition', {
|
||||
|
@ -117,14 +117,6 @@ export default {
|
||||
inputTypes: INPUT_TYPES
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
telemetry: {
|
||||
handler(newTelemetry, oldTelemetry) {
|
||||
this.checkTelemetry();
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
setRowLabel: function () {
|
||||
let operator = this.trigger === 'all' ? 'and ': 'or ';
|
||||
@ -148,6 +140,14 @@ export default {
|
||||
return type;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
telemetry: {
|
||||
handler(newTelemetry, oldTelemetry) {
|
||||
this.checkTelemetry();
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.updateMetadataOptions();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user