mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
* fix: improve dark mode readability across the app * fix: improve dark mode support for asset percentage text * fix: apply suggested patch for theme-related improvements * chore: apply PR feedback – remove dark:, align with design tokens, update form builder * chore: revert background token and restore original style for visual consistency * chore: remove unnecessary class attributes from form fields using builder * refactor: move number_field and date_field into metaprogramming block * refactor: replace bg-divider-adaptive divs with <hr> and border-secondary * fix: apply requested changes and linting fixes
28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
<%# locals: (form:) %>
|
|
|
|
<% action = form.object %>
|
|
<% rule = action.rule %>
|
|
<% needs_value = action.executor.type == "select" %>
|
|
|
|
<li data-controller="rule--actions" data-rule--actions-action-executors-value="<%= rule.action_executors.to_json %>" class="flex items-center gap-3">
|
|
<%= form.hidden_field :_destroy, value: false, data: { rule__actions_target: "destroyField" } %>
|
|
|
|
<div class="grow flex gap-2 items-center h-full">
|
|
<div class="grow">
|
|
<%= form.select :action_type, rule.action_executors.map { |executor| [ executor.label, executor.key ] }, {}, data: { action: "rule--actions#handleActionTypeChange" } %>
|
|
</div>
|
|
|
|
<%= tag.div class: class_names("min-w-1/2 flex items-center gap-2", "hidden" => !needs_value),
|
|
data: { rule__actions_target: "actionValue" } do %>
|
|
<span class="font-medium uppercase text-xs">to</span>
|
|
<%= form.select :value, action.options || [], {}, disabled: !needs_value %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<button type="button"
|
|
data-action="rule--actions#remove"
|
|
data-rule--actions-destroy-param="<%= action.persisted? %>">
|
|
<%= icon("trash-2", color: "gray", size: "sm") %>
|
|
</button>
|
|
</li>
|