From 4d263bcf323c0bf68d8a429a1990914fb7faf5f0 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Wed, 22 Jan 2020 08:53:25 -0800 Subject: [PATCH] added persist for remove --- src/plugins/condition/components/ConditionCollection.vue | 6 ++++++ src/plugins/condition/components/ConditionEdit.vue | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/condition/components/ConditionCollection.vue b/src/plugins/condition/components/ConditionCollection.vue index c594d1a820..ebf70c0e10 100644 --- a/src/plugins/condition/components/ConditionCollection.vue +++ b/src/plugins/condition/components/ConditionCollection.vue @@ -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); } } } diff --git a/src/plugins/condition/components/ConditionEdit.vue b/src/plugins/condition/components/ConditionEdit.vue index 6ec535bab3..40f7c6449a 100644 --- a/src/plugins/condition/components/ConditionEdit.vue +++ b/src/plugins/condition/components/ConditionEdit.vue @@ -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()) {