added persist for remove

This commit is contained in:
Joel McKinnon 2020-01-22 08:53:25 -08:00
parent 2d8f61172d
commit 4d263bcf32
2 changed files with 7 additions and 7 deletions

View File

@ -137,16 +137,22 @@ export default {
this.conditions[index] = updatedCondition;
},
removeCondition(identifier) {
console.log('this.conditions', this.conditions);
let index = _.findIndex(this.conditionCollection, (condition) => {
identifier.key === condition.key
});
this.conditionCollection.splice(index + 1, 1);
this.persist();
},
reorder(reorderPlan) {
let oldConditions = this.conditionCollection.slice();
reorderPlan.forEach((reorderEvent) => {
this.$set(this.conditionCollection, reorderEvent.newIndex, oldConditions[reorderEvent.oldIndex]);
});
},
persist() {
console.log('this.domainObject', this.domainObject);
this.openmct.objects.mutate(this.domainObject, 'configuration.conditionCollection', this.conditionCollection);
}
}
}

View File

@ -176,14 +176,8 @@ export default {
this.persist();
},
methods: {
removeCondition(ev) {
removeCondition() {
this.$emit('remove-condition', this.conditionIdentifier);
// const conditionDiv = ev.target.closest('.conditionArea');
// const conditionCollectionDiv = conditionDiv.closest('.condition-collection');
// const index = Array.from(conditionCollectionDiv.children).indexOf(conditionDiv);
// this.domainObject.configuration.conditionCollection.splice(index, 1);
// this.updateCurrentCondition();
},
updateTelemetry() {
if (this.hasTelemetry()) {