1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-25 08:09:38 +02:00

Rework account views and addition flow (#1324)

* Move accountable partials

* Split accountables into separate view partials

* Fix test

* Add form to permitted partials

* Fix failing system tests

* Update new account modal views

* New sync algorithm implementation

* Update account system test assertions to match new behavior

* Fix off by 1 date error

* Revert new balance sync algorithm

* Add missing account overviews
This commit is contained in:
Zach Gollwitzer 2024-10-18 14:37:42 -04:00 committed by GitHub
parent c7c281073f
commit e8e100e1d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
88 changed files with 763 additions and 526 deletions

View file

@ -23,6 +23,74 @@
],
"note": ""
},
{
"warning_type": "Dynamic Render Path",
"warning_code": 15,
"fingerprint": "42595161ffdc9ce9a10c4ba2a75fd2bb668e273bc4e683880b0ea906d0bd28f8",
"check_name": "Render",
"message": "Render path contains parameter value",
"file": "app/views/accounts/show.html.erb",
"line": 8,
"link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
"code": "render(action => permitted_accountable_partial(Current.family.accounts.find(params[:id]), \"header\"), { :account => Current.family.accounts.find(params[:id]) })",
"render_path": [
{
"type": "controller",
"class": "AccountsController",
"method": "show",
"line": 39,
"file": "app/controllers/accounts_controller.rb",
"rendered": {
"name": "accounts/show",
"file": "app/views/accounts/show.html.erb"
}
}
],
"location": {
"type": "template",
"template": "accounts/show"
},
"user_input": "params[:id]",
"confidence": "Weak",
"cwe_id": [
22
],
"note": ""
},
{
"warning_type": "Dynamic Render Path",
"warning_code": 15,
"fingerprint": "a35b18785608dbdf35607501363573576ed8c304039f8387997acd1408ca1025",
"check_name": "Render",
"message": "Render path contains parameter value",
"file": "app/views/accounts/show.html.erb",
"line": 35,
"link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
"code": "render(action => permitted_accountable_partial(Current.family.accounts.find(params[:id]), \"tooltip\"), { :account => Current.family.accounts.find(params[:id]) })",
"render_path": [
{
"type": "controller",
"class": "AccountsController",
"method": "show",
"line": 39,
"file": "app/controllers/accounts_controller.rb",
"rendered": {
"name": "accounts/show",
"file": "app/views/accounts/show.html.erb"
}
}
],
"location": {
"type": "template",
"template": "accounts/show"
},
"user_input": "params[:id]",
"confidence": "Weak",
"cwe_id": [
22
],
"note": ""
},
{
"warning_type": "Cross-Site Scripting",
"warning_code": 2,
@ -38,7 +106,7 @@
"type": "controller",
"class": "PagesController",
"method": "changelog",
"line": 35,
"line": 36,
"file": "app/controllers/pages_controller.rb",
"rendered": {
"name": "pages/changelog",
@ -60,19 +128,19 @@
{
"warning_type": "Dynamic Render Path",
"warning_code": 15,
"fingerprint": "b7a59d6dd91f4d30873b271659636c7975e25b47f436b4f03900a08809af2e92",
"fingerprint": "c5c512a13c34c9696024bd4e2367a657a5c140b5b6a0f5c352e9b69965f63e1b",
"check_name": "Render",
"message": "Render path contains parameter value",
"file": "app/views/accounts/show.html.erb",
"line": 105,
"line": 63,
"link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
"code": "render(action => selected_account_tab(Current.family.accounts.find(params[:id]))[:partial_path], { :account => Current.family.accounts.find(params[:id]) })",
"code": "render(action => permitted_accountable_partial(Current.family.accounts.find(params[:id]), \"tabs\"), { :account => Current.family.accounts.find(params[:id]), :selected_tab => params[:tab] })",
"render_path": [
{
"type": "controller",
"class": "AccountsController",
"method": "show",
"line": 38,
"line": 39,
"file": "app/controllers/accounts_controller.rb",
"rendered": {
"name": "accounts/show",
@ -98,7 +166,7 @@
"check_name": "Render",
"message": "Render path contains parameter value",
"file": "app/views/import/configurations/show.html.erb",
"line": 13,
"line": 15,
"link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
"code": "render(partial => permitted_import_configuration_path(Current.family.imports.find(params[:import_id])), { :locals => ({ :import => Current.family.imports.find(params[:import_id]) }) })",
"render_path": [
@ -126,6 +194,6 @@
"note": ""
}
],
"updated": "2024-09-28 13:27:09 -0400",
"updated": "2024-10-17 11:30:15 -0400",
"brakeman_version": "6.2.1"
}

View file

@ -1,37 +1,88 @@
---
en:
accounts:
sync_all_button:
sync: Sync all
account:
has_issues: Issue detected.
troubleshoot: Troubleshoot
account_list:
new_account: "New %{type}"
empty:
no_accounts: No accounts yet
empty_message: Add an account either via connection, importing or entering manually.
new_account: New account
form:
name_label: Account name
name_placeholder: Example account name
institution: Financial institution
ungrouped: "(none)"
balance: Today's balance
accountable_type: Account type
type_prompt: Select a type
header:
accounts: Accounts
manage: Manage accounts
new: New account
institution_accounts:
add_account_to_institution: Add new account
has_issues: Issue detected, see accounts
syncing: Syncing...
status: "Last synced %{last_synced_at} ago"
status_never: Requires data sync
edit: Edit institution
delete: Delete institution
confirm_title: Delete financial institution?
confirm_body: Don't worry, none of the accounts within this institution will be affected by this deletion. Accounts will be ungrouped and all historical data will remain intact.
confirm_accept: Delete institution
new_account: Add account
institutionless_accounts:
other_accounts: Other accounts
menu:
edit: Edit
import: Import transactions
confirm_title: Delete account?
confirm_body_html: "<p>By deleting this account, you will erase its value history, affecting various aspects of your overall account. This action will have a direct impact on your net worth calculations and the account graphs.</p><br /> <p>After deletion, there is no way you'll be able to restore the account information because you'll need to add it as a new account.</p>"
confirm_accept: 'Delete "%{name}"'
accountables:
investment:
prompt: Select a subtype
none: None
credit_card:
annual_fee: Annual fee
annual_fee_placeholder: '99'
apr: APR
apr_placeholder: '15.99'
available_credit: Available credit
available_credit_placeholder: '10000'
expiration_date: Expiration date
minimum_payment: Minimum payment
minimum_payment_placeholder: '100'
form:
available_credit: Available credit
available_credit_placeholder: '10000'
minimum_payment: Minimum payment
minimum_payment_placeholder: '100'
apr: APR
apr_placeholder: '15.99'
expiration_date: Expiration date
annual_fee: Annual fee
annual_fee_placeholder: '99'
overview:
amount_owed: Amount Owed
annual_fee: Annual Fee
apr: APR
available_credit: Available Credit
expiration_date: Expiration Date
minimum_payment: Minimum Payment
apr: APR
expiration_date: Expiration Date
annual_fee: Annual Fee
unknown: Unknown
depository:
prompt: Select a subtype
none: None
form:
none: None
prompt: Select a subtype
investment:
form:
none: None
prompt: Select a subtype
tooltip:
cash: Cash
holdings: Holdings
total_value_tooltip: The total value is the sum of cash balance and your holdings value, minus margin loans.
loan:
interest_rate: Interest rate
interest_rate_placeholder: '5.25'
form:
interest_rate: Interest rate
interest_rate_placeholder: '5.25'
rate_type: Rate type
term_months: Term (months)
term_months_placeholder: '360'
overview:
interest_rate: Interest Rate
monthly_payment: Monthly Payment
@ -41,18 +92,19 @@ en:
term: Term
type: Type
unknown: Unknown
rate_type: Rate type
term_months: Term (months)
term_months_placeholder: '360'
property:
additional_info: Additional info
area_unit: Area unit
area_value: Area value
city: City
country: Country
line1: Address line 1
line2: Address line 2
optional: optional
form:
additional_info: Additional info
area_unit: Area unit
area_value: Area value
city: City
country: Country
line1: Address line 1
line2: Address line 2
optional: optional
postal_code: Postal code
state: State
year_built: Year built
overview:
living_area: Living Area
market_value: Market Value
@ -60,17 +112,17 @@ en:
trend: Trend
unknown: Unknown
year_built: Year Built
postal_code: Postal code
state: State
year_built: Year built
vehicle:
make: Make
make_placeholder: Toyota
mileage: Mileage
mileage_placeholder: '15000'
mileage_unit: Unit
model: Model
model_placeholder: Camry
form:
make: Make
make_placeholder: Toyota
mileage: Mileage
mileage_placeholder: '15000'
mileage_unit: Unit
model: Model
model_placeholder: Camry
year: Year
year_placeholder: '2023'
overview:
current_price: Current Price
make_model: Make & Model
@ -79,70 +131,22 @@ en:
trend: Trend
unknown: Unknown
year: Year
year: Year
year_placeholder: '2023'
create:
success: New account created successfully
destroy:
success: Account deleted successfully
edit:
edit: Edit %{account}
empty:
empty_message: Add an account either via connection, importing or entering manually.
new_account: New account
no_accounts: No accounts yet
form:
institution: Financial institution
ungrouped: "(none)"
balance: Current balance
name_label: Account name
name_placeholder: Example account name
start_balance: Start balance (optional)
start_date: Start date (optional)
header:
accounts: Accounts
manage: Manage accounts
new: New account
edit: "Edit %{account}"
index:
accounts: Accounts
add_institution: Add institution
new_account: New account
institution_accounts:
add_account_to_institution: Add new account
confirm_accept: Delete institution
confirm_body: Don't worry, none of the accounts within this institution will
be affected by this deletion. Accounts will be ungrouped and all historical
data will remain intact.
confirm_title: Delete financial institution?
delete: Delete institution
edit: Edit institution
has_issues: Issue detected, see accounts
new_account: Add account
status: Last synced %{last_synced_at} ago
status_never: Requires data sync
syncing: Syncing...
institutionless_accounts:
other_accounts: Other accounts
new:
select_accountable_type: What would you like to add?
title: Add an account
manual_entry: Enter account manually
csv_entry: Import accounts CSV
connected_entry: Securely link account with Plaid (coming soon)
show:
cash: Cash
confirm_accept: Delete "%{name}"
confirm_body_html: "<p>By deleting this account, you will erase its value history,
affecting various aspects of your overall account. This action will have a
direct impact on your net worth calculations and the account graphs.</p><br
/> <p>After deletion, there is no way you'll be able to restore the account
information because you'll need to add it as a new account.</p>"
confirm_title: Delete account?
edit: Edit
holdings: Holdings
import: Import transactions
no_change: No change
overview: Overview
sync_message_missing_rates: Since exchange rates haven't been synced, balance
graphs may not reflect accurate values.
sync_message_unknown_error: An error has occurred during the sync.
total_owed: Total Owed
total_value: Total Value
trades: Transactions
@ -151,21 +155,17 @@ en:
summary:
new: New
no_assets: No assets found
no_assets_description: Add an asset either via connection, importing or entering
manually.
no_assets_description: Add an asset either via connection, importing or entering manually.
no_liabilities: No liabilities found
no_liabilities_description: Add a liability either via connection, importing
or entering manually.
sync_all:
button_text: Sync all
success: Successfully queued accounts for syncing.
tooltip:
cash: Cash
holdings: Holdings
total_value_tooltip: The total value is the sum of cash balance and your holdings
value, minus margin loans.
no_liabilities_description: Add a liability either via connection, importing or entering manually.
create:
success: New account created successfully
destroy:
success: Account deleted successfully
update:
success: Account updated
sync_all:
success: Successfully queued accounts for syncing.
credit_cards:
create:
success: Credit card created successfully

View file

@ -69,7 +69,7 @@ en:
import_mint: Import from Mint
import_portfolio: Import investments
import_transactions: Import transactions
resume: Resume latest import
resume: Resume %{type}
sources: Sources
title: New CSV Import
ready:

View file

@ -61,8 +61,6 @@ Rails.application.routes.draw do
end
scope module: :account do
resource :logo, only: :show
resources :holdings, only: %i[index new show destroy]
resources :cashes, only: :index