Merge pull request #2802 from nasa/clone-condition-issues

Clone condition, criteria issues
This commit is contained in:
David Tsay 2020-03-30 09:40:00 -07:00 committed by GitHub
commit d00e8b68a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View File

@ -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 {

View File

@ -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', {

View File

@ -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();
},