fix: amend inputs on loan, c.c., vehicle, and property partials #1281

Merged
gariasf merged 7 commits from gariasf/rates-number-input into main 2024-10-10 22:45:18 +08:00
gariasf commented 2024-10-10 16:11:03 +08:00 (Migrated from github.com)

It's currently possible to input text on some number values for loans, credit cards, vehicles, and property. When happens and the form is submitted, it is gracefully handled by setting the value to zero.
This PR proposes that those inputs are number inputs, with appropriate min and step values. % values have a step of 0.1 and both % and currency inputs have a min of 0. This assumes that negative interest rates are VERY rare in personal finance. With that said, I am not sure if it makes sense to put in a negative balance, so I'll be expecting to hear your thoughts on that.
Ideally, these inputs should display the currency symbol or percentage symbol, but that isn't such a trivial change, so I left it out for now.

Looking forward to your feedback. Cheers!

It's currently possible to input text on some number values for loans, credit cards, vehicles, and property. When happens and the form is submitted, it is gracefully handled by setting the value to zero. This PR proposes that those inputs are number inputs, with appropriate min and step values. % values have a step of 0.1 and both % and currency inputs have a min of 0. This assumes that negative interest rates are VERY rare in personal finance. With that said, I am not sure if it makes sense to put in a negative balance, so I'll be expecting to hear your thoughts on that. Ideally, these inputs should display the currency symbol or percentage symbol, but that isn't such a trivial change, so I left it out for now. Looking forward to your feedback. Cheers!
zachgoll commented 2024-10-10 22:04:51 +08:00 (Migrated from github.com)

@gariasf good catch, 100% agree

@gariasf good catch, 100% agree
zachgoll (Migrated from github.com) reviewed 2024-10-10 22:12:23 +08:00
@@ -4,17 +4,17 @@
<div class="space-y-2">
zachgoll (Migrated from github.com) commented 2024-10-10 22:12:23 +08:00
        <%= credit_card_form.number_field :apr, label: t(".apr"), placeholder: t(".apr_placeholder"), min: 0, step: 0.01 %>
```suggestion <%= credit_card_form.number_field :apr, label: t(".apr"), placeholder: t(".apr_placeholder"), min: 0, step: 0.01 %> ```
zachgoll (Migrated from github.com) reviewed 2024-10-10 22:12:36 +08:00
@@ -4,7 +4,7 @@
<div class="space-y-2">
zachgoll (Migrated from github.com) commented 2024-10-10 22:12:36 +08:00
        <%= loan_form.number_field :interest_rate, label: t(".interest_rate"), placeholder: t(".interest_rate_placeholder"), min: 0, step: 0.01 %>
```suggestion <%= loan_form.number_field :interest_rate, label: t(".interest_rate"), placeholder: t(".interest_rate_placeholder"), min: 0, step: 0.01 %> ```
zachgoll commented 2024-10-10 22:13:54 +08:00 (Migrated from github.com)

@gariasf those two suggestions I made should fix the system test failures

@gariasf those two suggestions I made should fix the system test failures
zachgoll (Migrated from github.com) approved these changes 2024-10-10 22:45:13 +08:00
zachgoll (Migrated from github.com) left a comment

Awesome, looks great!

Awesome, looks great!
Sign in to join this conversation.