mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 15:35:22 +02:00
chore: remove unnecessary class attributes from form fields using builder
This commit is contained in:
parent
dc5b159f65
commit
e66fa0d534
6 changed files with 11 additions and 12 deletions
|
@ -11,8 +11,7 @@
|
|||
[t(".role_admin"), "admin"]
|
||||
]),
|
||||
{},
|
||||
class: "form-field__input text-primary"
|
||||
%>
|
||||
{ label: t(".role_label") } %>
|
||||
|
||||
<div class="w-full">
|
||||
<%= form.submit t(".submit"), class: "bg-gray-900 text-white rounded-lg px-4 py-2 w-full" %>
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
|
||||
<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" }, class: "form-field__input text-primary" %>
|
||||
<%= 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 || [], {}, class: "form-field__input text-primary", disabled: !needs_value %>
|
||||
<%= form.select :value, action.options || [], {}, disabled: !needs_value %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -14,19 +14,19 @@
|
|||
<%= form.hidden_field :_destroy, value: false, data: { rule__conditions_target: "destroyField" } %>
|
||||
|
||||
<div class="w-2/5 shrink-0">
|
||||
<%= form.select :condition_type, rule.condition_filters.map { |filter| [ filter.label, filter.key ] }, {}, data: { action: "rule--conditions#handleConditionTypeChange" }, class: "form-field__input text-primary" %>
|
||||
<%= form.select :condition_type, rule.condition_filters.map { |filter| [ filter.label, filter.key ] }, {}, data: { action: "rule--conditions#handleConditionTypeChange" } %>
|
||||
</div>
|
||||
|
||||
<%= form.select :operator, condition.operators, { container_class: "w-fit min-w-36" }, data: { rule__conditions_target: "operatorSelect" }, class: "form-field__input text-primary" %>
|
||||
<%= form.select :operator, condition.operators, { container_class: "w-fit min-w-36" }, data: { rule__conditions_target: "operatorSelect" } %>
|
||||
|
||||
<div data-rule--conditions-target="filterValue" class="grow">
|
||||
<% if condition.filter.type == "select" %>
|
||||
<%= form.select :value, condition.options, {}, class: "form-field__input text-primary" %>
|
||||
<%= form.select :value, condition.options, {} %>
|
||||
<% else %>
|
||||
<% if condition.filter.type == "number" %>
|
||||
<%= form.number_field :value, placeholder: "10", step: 0.01, class: "form-field__input text-primary" %>
|
||||
<%= form.number_field :value, placeholder: "10", step: 0.01 %>
|
||||
<% else %>
|
||||
<%= form.text_field :value, placeholder: "Enter a value", class: "form-field__input text-primary" %>
|
||||
<%= form.text_field :value, placeholder: "Enter a value" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<p class="text-sm text-secondary">match</p>
|
||||
<%= form.select :operator, [["all", "and"], ["any", "or"]], { container_class: "w-fit" }, data: { rules_target: "operatorField" }, class: "form-field__input text-primary" %>
|
||||
<%= form.select :operator, [["all", "and"], ["any", "or"]], { container_class: "w-fit" }, data: { rules_target: "operatorField" } %>
|
||||
<p class="text-sm text-secondary">of the following conditions</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
<%= f.label :effective_date_enabled_true, "Starting from", class: "text-sm text-primary" %>
|
||||
</div>
|
||||
|
||||
<%= f.date_field :effective_date, container_class: "w-fit", data: { rules_target: "effectiveDateInput" }, class: "form-field__input text-primary" %>
|
||||
<%= f.date_field :effective_date, container_class: "w-fit", data: { rules_target: "effectiveDateInput" } %>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<%= tag.span t(".income") %>
|
||||
<% end %>
|
||||
|
||||
<%= tag.div class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center bg-container text-primary shadow-sm" do %>
|
||||
<%= tag.div class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center bg-container text-primary shadow-sm" do %>
|
||||
<%= lucide_icon "arrow-right-left", class: "w-4 h-4" %>
|
||||
<%= tag.span t(".transfer") %>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue