From 2d8f61172d13a870e739e488220bb0f16e675808 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Wed, 22 Jan 2020 08:17:03 -0800 Subject: [PATCH] fixed remove --- src/plugins/condition/components/ConditionCollection.vue | 7 +++++-- src/plugins/condition/components/ConditionEdit.vue | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/condition/components/ConditionCollection.vue b/src/plugins/condition/components/ConditionCollection.vue index 0b3aada8c5..c594d1a820 100644 --- a/src/plugins/condition/components/ConditionCollection.vue +++ b/src/plugins/condition/components/ConditionCollection.vue @@ -37,6 +37,7 @@
@@ -136,8 +137,10 @@ export default { this.conditions[index] = updatedCondition; }, removeCondition(identifier) { - let index = _.findIndex(this.conditionCollection, (condition) => this.openmct.objects.makeKeyString(identifier) === condition.identifier.key); - this.conditionCollection.splice(index, 1); + let index = _.findIndex(this.conditionCollection, (condition) => { + identifier.key === condition.key + }); + this.conditionCollection.splice(index + 1, 1); }, reorder(reorderPlan) { let oldConditions = this.conditionCollection.slice(); diff --git a/src/plugins/condition/components/ConditionEdit.vue b/src/plugins/condition/components/ConditionEdit.vue index 4c60c0abec..6ec535bab3 100644 --- a/src/plugins/condition/components/ConditionEdit.vue +++ b/src/plugins/condition/components/ConditionEdit.vue @@ -177,6 +177,7 @@ export default { }, methods: { removeCondition(ev) { + 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);