mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Allow manual entry on linked accounts (#689)
* Update activity menu to conditionally display options for linked and investment accounts * Update transaction test to reflect "New activity" menu change --------- Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
This commit is contained in:
@@ -3,23 +3,32 @@
|
||||
<div class="flex items-center justify-between mb-4" data-testid="activity-menu">
|
||||
<%= tag.h2 t("accounts.show.activity.title"), class: "font-medium text-lg" %>
|
||||
|
||||
<% if account.manual? %>
|
||||
<%= render DS::Menu.new(variant: "button") do |menu| %>
|
||||
<% menu.with_button(text: t("accounts.show.activity.new"), variant: "secondary", icon: "plus") %>
|
||||
<%= render DS::Menu.new(variant: "button") do |menu| %>
|
||||
<% menu.with_button(text: t("accounts.show.activity.new"), variant: "secondary", icon: "plus") %>
|
||||
|
||||
<% unless account.linked? %>
|
||||
<% menu.with_item(
|
||||
variant: "link",
|
||||
text: t("accounts.show.activity.new_balance"),
|
||||
icon: "circle-dollar-sign",
|
||||
href: new_valuation_path(account_id: account.id),
|
||||
data: { turbo_frame: :modal }) %>
|
||||
<% end %>
|
||||
|
||||
<% unless account.crypto? %>
|
||||
<% unless account.crypto? %>
|
||||
<% if account.investment? %>
|
||||
<% menu.with_item(
|
||||
variant: "link",
|
||||
text: t("accounts.show.activity.new_activity"),
|
||||
icon: "arrow-left-right",
|
||||
href: new_trade_path(account_id: account.id),
|
||||
data: { turbo_frame: :modal }) %>
|
||||
<% else %>
|
||||
<% menu.with_item(
|
||||
variant: "link",
|
||||
text: t("accounts.show.activity.new_transaction"),
|
||||
icon: "credit-card",
|
||||
href: account.investment? ? new_trade_path(account_id: account.id) : new_transaction_path(account_id: account.id),
|
||||
href: new_transaction_path(account_id: account.id),
|
||||
data: { turbo_frame: :modal }) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user