From 09eb750fadadc429228eb2ae56d1233608d78ba2 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 8 Mar 2023 19:36:05 +0100 Subject: [PATCH 01/26] Don't pass around vue instance in rule builder --- .../components/RuleBuilder/RuleComponent.vue | 5 +- .../RuleBuilder/RuleTargetComponent.vue | 5 +- .../src/components/RuleCollectionBuilder.vue | 83 +++++++++++-------- 3 files changed, 49 insertions(+), 44 deletions(-) diff --git a/client/src/components/RuleBuilder/RuleComponent.vue b/client/src/components/RuleBuilder/RuleComponent.vue index 4c69d0ef216f..6075393941ba 100644 --- a/client/src/components/RuleBuilder/RuleComponent.vue +++ b/client/src/components/RuleBuilder/RuleComponent.vue @@ -20,9 +20,6 @@ export default { displayRuleType: { required: true, }, - builder: { - required: true, - }, }, data: function () { return { @@ -40,7 +37,7 @@ export default { this.$emit("update:displayRuleType", null); }, okay() { - this.builder.handleRuleSave(this.ruleType); + this.$emit("save-rule", this.ruleType); this.cancel(); }, }, diff --git a/client/src/components/RuleBuilder/RuleTargetComponent.vue b/client/src/components/RuleBuilder/RuleTargetComponent.vue index 1dbd4f87fdf2..0e6b72dc6997 100644 --- a/client/src/components/RuleBuilder/RuleTargetComponent.vue +++ b/client/src/components/RuleBuilder/RuleTargetComponent.vue @@ -3,7 +3,7 @@ class="rule-link dropdown-item" href="javascript:void(0)" :class="linkClassName" - @click="builder.addNewRule(ruleType)" + @click="$emit('add-new-rule', ruleType)" >{{ title }} @@ -18,9 +18,6 @@ export default { type: String, required: true, }, - builder: { - required: true, - }, }, computed: { linkClassName() { diff --git a/client/src/components/RuleCollectionBuilder.vue b/client/src/components/RuleCollectionBuilder.vue index d21c905d9f31..70a4c48479b7 100644 --- a/client/src/components/RuleCollectionBuilder.vue +++ b/client/src/components/RuleCollectionBuilder.vue @@ -51,7 +51,10 @@ 'rules-container-horizontal': initialElements && horizontal, 'rules-container-full': initialElements == null, }"> - +