From fc64b00a5e0de3f2bb68b683b4cc7f7b7e64ff83 Mon Sep 17 00:00:00 2001 From: hatz Date: Fri, 9 May 2025 19:44:21 -0500 Subject: [PATCH] Ensure the condition group "Add condition" button is type button to avoid form submission --- app/views/rule/conditions/_condition_group.html.erb | 1 + app/views/rules/_form.html.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/rule/conditions/_condition_group.html.erb b/app/views/rule/conditions/_condition_group.html.erb index 67b3eb0f..3ca9709a 100644 --- a/app/views/rule/conditions/_condition_group.html.erb +++ b/app/views/rule/conditions/_condition_group.html.erb @@ -44,6 +44,7 @@ text: "Add condition", leading_icon: "plus", variant: "ghost", + type: "button", data: { action: "rule--conditions#addSubCondition" } ) %> diff --git a/app/views/rules/_form.html.erb b/app/views/rules/_form.html.erb index 79c0b45e..cdee4783 100644 --- a/app/views/rules/_form.html.erb +++ b/app/views/rules/_form.html.erb @@ -12,7 +12,7 @@

If <%= rule.resource_type %>

- <%# Condition template, used by Stimulus controller to add new conditions dynamically %> + <%# Condition Group template, used by Stimulus controller to add new conditions dynamically %>