diff --git a/app/javascript/controllers/rule/actions_controller.js b/app/javascript/controllers/rule/actions_controller.js index c3c71008..abbebb51 100644 --- a/app/javascript/controllers/rule/actions_controller.js +++ b/app/javascript/controllers/rule/actions_controller.js @@ -25,11 +25,6 @@ export default class extends Controller { (executor) => executor.key === e.target.value, ); - if (!actionExecutor || actionExecutor.needs_value === false) { - this.#hideActionValue(); - return; - } - // Clear any existing input elements first this.#clearFormFields(); @@ -38,7 +33,7 @@ export default class extends Controller { } else if (actionExecutor.type === "text") { this.#buildTextInputFor(); } else { - // For any type that doesn't need a value (e.g. function) + // Hide for any type that doesn't need a value (e.g. function) this.#hideActionValue(); } } diff --git a/app/views/rule/actions/_action.html.erb b/app/views/rule/actions/_action.html.erb index ad71038a..0f104d7a 100644 --- a/app/views/rule/actions/_action.html.erb +++ b/app/views/rule/actions/_action.html.erb @@ -2,8 +2,6 @@ <% action = form.object %> <% rule = action.rule %> -<% action_type = action.executor.type %> -<% needs_value = action.executor.type == "select" || action.executor.type == "text" %>
  • <%= form.hidden_field :_destroy, value: false, data: { rule__actions_target: "destroyField" } %> @@ -13,7 +11,7 @@ <%= form.select :action_type, rule.action_executors.map { |executor| [ executor.label, executor.key ] }, {}, data: { action: "rule--actions#handleActionTypeChange" } %> - <%= tag.div class: class_names("min-w-1/2 flex items-center gap-2", "hidden" => !needs_value), + <%= tag.div class: class_names("min-w-1/2 flex items-center gap-2"), data: { rule__actions_target: "actionValue" } do %> to <%# Initial rendering based on rule.action_executors.first from the rule form. %>