mirror of
https://github.com/we-promise/sure.git
synced 2026-04-25 23:14:10 +00:00
* PlaidConnectable concern * Remove bad abstraction * Put sync implementations in own concerns * Sync strategies * Move sync orchestration to Sync class * Clean up sync class, add state machine * Basic market data sync cron * Fix price sync * Improve sync window column names, add timestamps * 30 day syncs by default * Clean up market data methods * Report high duplicate sync counts to Sentry * Add sync states throughout app * account tab session * Persistent account tab selections * Remove manual sleep * Add migration to clear stale syncs on self hosted apps * Tweak sync states * Sync completion event broadcasts * Fix timezones in tests * Cleanup * More cleanup * Plaid item UI broadcasts for sync * Fix account ID namespace conflict * Sync broadcasters * Smoother account sync refreshes * Remove test sync delay
49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
<%# locals: (account:) %>
|
|
|
|
<% currency = Money::Currency.new(account.currency) %>
|
|
|
|
<div class="grid grid-cols-12 items-center text-primary text-sm font-medium p-4">
|
|
<div class="col-span-4 flex items-center gap-4">
|
|
<%= render FilledIconComponent.new(
|
|
variant: :text,
|
|
text: currency.symbol,
|
|
rounded: true,
|
|
size: "lg"
|
|
) %>
|
|
|
|
<div class="space-y-0.5">
|
|
<%= tag.p t(".brokerage_cash"), class: "text-primary" %>
|
|
<%= tag.p account.currency, class: "text-secondary text-xs uppercase" %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-span-2 flex justify-end items-center gap-2">
|
|
<% cash_weight = account.balance.zero? ? 0 : account.cash_balance / account.balance * 100 %>
|
|
|
|
<% if account.syncing? %>
|
|
<div class="w-16 h-6 bg-loader rounded-full"></div>
|
|
<% else %>
|
|
<%= render "shared/progress_circle", progress: cash_weight %>
|
|
<%= tag.p number_to_percentage(cash_weight, precision: 1) %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="col-span-2 text-right">
|
|
<%= tag.p "--", class: "text-secondary" %>
|
|
</div>
|
|
|
|
<div class="col-span-2 text-right">
|
|
<% if account.syncing? %>
|
|
<div class="flex justify-end">
|
|
<div class="w-16 h-6 bg-loader rounded-full"></div>
|
|
</div>
|
|
<% else %>
|
|
<%= tag.p format_money account.cash_balance_money %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="col-span-2 text-right">
|
|
<%= tag.p "--", class: "text-secondary" %>
|
|
</div>
|
|
</div>
|