diff --git a/app/components/UI/account/activity_feed.html.erb b/app/components/UI/account/activity_feed.html.erb index 4c586a09d..14c9b36e4 100644 --- a/app/components/UI/account/activity_feed.html.erb +++ b/app/components/UI/account/activity_feed.html.erb @@ -3,23 +3,32 @@
<%= 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 %> diff --git a/config/locales/views/accounts/en.yml b/config/locales/views/accounts/en.yml index 8ed337ef4..c321cfba3 100644 --- a/config/locales/views/accounts/en.yml +++ b/config/locales/views/accounts/en.yml @@ -56,6 +56,7 @@ en: entry: entry filter: Filter new: New + new_activity: New activity new_balance: New balance new_transaction: New transaction no_entries: No entries found diff --git a/test/system/transactions_test.rb b/test/system/transactions_test.rb index 632f6076f..efc71b0a5 100644 --- a/test/system/transactions_test.rb +++ b/test/system/transactions_test.rb @@ -189,7 +189,7 @@ class TransactionsTest < ApplicationSystemTestCase visit account_url(investment_account, tab: "activity") within "[data-testid='activity-menu']" do click_on "New" - click_on "New transaction" + click_on "New activity" end select "Deposit", from: "Type" fill_in "Date", with: transfer_date