mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 13:35:21 +02:00
Initial pass at Synth-based ticker selection (#1392)
* Initial pass at Synth-based ticker selection * Update _tickers.turbo_stream.erb * Functional combobox display * A few cleanup steps * Linter * Prevent long strings * Another step towards functional combobox * Deprecated files * Custom Combobox implementation * Lint * Test suite fixes * Lint * Make direct use of mic codes * Update splits * Update trades_test.rb
This commit is contained in:
parent
490f44589e
commit
cd91e66618
20 changed files with 118 additions and 232 deletions
|
@ -8,7 +8,7 @@
|
|||
<%= form.select :type, options_for_select([%w[Buy buy], %w[Sell sell], %w[Deposit transfer_in], %w[Withdrawal transfer_out], %w[Interest interest]], "buy"), { label: t(".type") }, { data: { "trade-form-target": "typeInput" } } %>
|
||||
<div data-trade-form-target="tickerInput">
|
||||
<div class="form-field combobox">
|
||||
<%= form.combobox :ticker, securities_account_trades_path(entry.account), label: t(".holding"), placeholder: t(".ticker_placeholder"), autocomplete: :list, free_text: true %>
|
||||
<%= form.combobox :ticker, securities_account_trades_path(entry.account), label: t(".holding"), placeholder: t(".ticker_placeholder") %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
11
app/views/account/trades/_security.turbo_stream.erb
Normal file
11
app/views/account/trades/_security.turbo_stream.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
<div class="flex items-center">
|
||||
<%= image_tag(security.logo_url, class: "rounded-full h-8 w-8 inline-block mr-2" ) %>
|
||||
<div class="flex flex-col">
|
||||
<span class="text-sm font-medium">
|
||||
<%= security.name.presence || security.symbol %>
|
||||
</span>
|
||||
<span class="text-xs text-gray-500">
|
||||
<%= "#{security.symbol} (#{security.exchange_acronym})" %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
|
@ -1,7 +0,0 @@
|
|||
<div class="flex items-center">
|
||||
<%= image_tag("https://logo.synthfinance.com/ticker/#{tickers&.ticker}", class: "rounded-full h-8 w-8 inline-block mr-2") %>
|
||||
<div class="flex flex-col">
|
||||
<span class="text-sm font-medium"><%= tickers&.name.presence || tickers&.ticker %></span>
|
||||
<span class="text-xs text-gray-500"><%= "#{tickers&.ticker} (#{tickers&.exchange_acronym})" %></span>
|
||||
</div>
|
||||
</div>
|
|
@ -1,3 +1,2 @@
|
|||
<%= async_combobox_options @securities,
|
||||
render_in: { partial: "account/trades/tickers" },
|
||||
next_page: @pagy.next %>
|
||||
render_in: { partial: "account/trades/security" } %>
|
Loading…
Add table
Add a link
Reference in a new issue