1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-04 04:55:20 +02:00

Add additional subtypes, add None option, prefill edit with previously selected option. (#1286)

* Add additional subtypes and allow for None

* Add parens for consistency on 401

* Remove cryptocurrency investment subtype

* Handle nil value

* Use objects current subtype as the initial selection

* Remove "None" option to default to helper prompt

* Fix blank/none selection

* Only include blank if subtype is present

* Simplify investment subtype dropdown

* Improve depository subtype
This commit is contained in:
Alex Hatzenbuhler 2024-10-10 20:23:56 -05:00 committed by GitHub
parent 3610c6cae7
commit c5bf1db230
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 4 deletions

View file

@ -6,11 +6,13 @@ class Investment < ApplicationRecord
[ "Pension", "pension" ], [ "Pension", "pension" ],
[ "Retirement", "retirement" ], [ "Retirement", "retirement" ],
[ "401(k)", "401k" ], [ "401(k)", "401k" ],
[ "529 plan", "529_plan" ], [ "Traditional 401(k)", "traditional_401k" ],
[ "Roth 401(k)", "roth_401k" ],
[ "529 Plan", "529_plan" ],
[ "Health Savings Account", "hsa" ], [ "Health Savings Account", "hsa" ],
[ "Mutual Fund", "mutual_fund" ], [ "Mutual Fund", "mutual_fund" ],
[ "Traditional IRA", "traditional_ira" ],
[ "Roth IRA", "roth_ira" ], [ "Roth IRA", "roth_ira" ],
[ "Roth 401k", "roth_401k" ],
[ "Angel", "angel" ] [ "Angel", "angel" ]
].freeze ].freeze

View file

@ -1 +1 @@
<%= f.select :subtype, options_for_select([["Checking", "checking"], ["Savings", "savings"]], selected: ""), { label: "Type" } %> <%= f.select :subtype, [["Checking", "checking"], ["Savings", "savings"]], { label: true, prompt: t(".prompt"), include_blank: t(".none") } %>

View file

@ -1 +1 @@
<%= f.select :subtype, options_for_select(Investment::SUBTYPES, selected: ""), { label: true } %> <%= f.select :subtype, Investment::SUBTYPES, { label: true, prompt: t(".prompt"), include_blank: t(".none") } %>

View file

@ -5,6 +5,9 @@ en:
has_issues: Issue detected. has_issues: Issue detected.
troubleshoot: Troubleshoot troubleshoot: Troubleshoot
accountables: accountables:
investment:
prompt: Select a subtype
none: None
credit_card: credit_card:
annual_fee: Annual fee annual_fee: Annual fee
annual_fee_placeholder: '99' annual_fee_placeholder: '99'
@ -23,6 +26,9 @@ en:
expiration_date: Expiration Date expiration_date: Expiration Date
minimum_payment: Minimum Payment minimum_payment: Minimum Payment
unknown: Unknown unknown: Unknown
depository:
prompt: Select a subtype
none: None
loan: loan:
interest_rate: Interest rate interest_rate: Interest rate
interest_rate_placeholder: '5.25' interest_rate_placeholder: '5.25'