1
0
Fork 0
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:
Guilherme Mena 2025-04-21 15:15:58 +00:00
parent dc5b159f65
commit e66fa0d534
6 changed files with 11 additions and 12 deletions

View file

@ -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" %>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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 %>