mirror of
https://github.com/we-promise/sure.git
synced 2026-05-24 21:14:56 +00:00
refactor(design-system): migrate 38 hand-rolled provider buttons to DS::Button / DS::Link (#1715 §5 part B) (#1860)
* refactor(design-system): migrate 9 hand-rolled buttons with orphan btn-- classes to DS::Button / DS::Link Part of #1715 §5. The `btn`, `btn--primary`, `btn--outline`, `btn--ghost`, `btn--sm` CSS classes have no backing styles anywhere in the codebase (no .btn definition in app/assets/, no Bootstrap dependency). These callsites have been rendering unstyled buttons / links since the underlying CSS was last removed. Migrate the 9 broken callsites: - `app/views/transactions/show.html.erb` — duplicate-merge action buttons (×2): `button_to ... class: "btn btn--primary btn--sm"` / `class: "btn btn--outline btn--sm"` → DS::Button with href + variant + size + `data: { turbo_method: :post }`. - `app/views/snaptrade_items/select_existing_account.html.erb` — "Go to Provider Settings" link → DS::Link primary sm. - `app/views/indexa_capital_items/select_existing_account.html.erb` — same pattern → DS::Link primary sm. - `app/views/import/confirms/show.html.erb` — Publish button + Cancel link → DS::Button primary full-width + DS::Link ghost full-width. - `app/views/simplefin_items/new.html.erb` — Cancel link (`class: "btn"` only) + Connect submit → DS::Link secondary + bare `f.submit` (already routes to DS::Button via StyledFormBuilder). - `app/views/settings/providers/_ibkr_panel.html.erb`, `_snaptrade_panel.html.erb`, `_indexa_capital_panel.html.erb` — strip the orphan `class: "btn btn--primary"` from `f.submit` callers; the submit is already a styled DS::Button via the form builder. The next PR in this chain (Phase B) will tackle the larger inline- button cluster (~29 files, 38 instances) — provider panels and provider-item flows hand-rolling the same `inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors` string. * refactor(design-system): migrate 38 hand-rolled provider buttons to DS::Button / DS::Link (#1715 §5 part B) Bulk sweep of the second cluster from §5. 29 files, 38 button instances — each one hand-rolled the same long Tailwind string for the primary action button: inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors (some variations used `button-bg-primary hover:button-bg-primary-hover` instead of `bg-inverse hover:bg-inverse-hover` — same intent). Every instance is now a DS::Button / DS::Link with `variant: :primary`, which: - Picks up the new focus-ring + touch-target work from #1840 once that merges. - Stops duplicating the long Tailwind string across 29 files — single source of truth in `DS::Buttonish::VARIANTS[:primary]`. - Picks up consistent `aria-label` derivation for icon-only forms. - Removes the misnamed `focus:ring-primary` (no token) — the new ring comes from `base.css` automatically. Migration patterns applied: - `f.submit text, class: "inline-flex …"` inside `styled_form_with` → bare `<%= f.submit text %>`. StyledFormBuilder routes through DS::Button. - `link_to text, path, class: "inline-flex …"` → DS::Link primary. - `button_to text, path, method: :X, class: "inline-flex …"` → DS::Button with `href: path` and `data: { turbo_method: :X }`. - `submit_tag text, class: "inline-flex …"` inside raw `form_with` → DS::Button with `type: :submit`. Notable adjustments: - `holdings/show.html.erb` — the form was `form_with` (not styled). Switched to `styled_form_with` so `f.submit` routes through DS::Button. `f.combobox` (hotwire_combobox) still works through the styled builder. - Two `link_to settings_providers_path` callsites in `coinstats_items/new.html.erb` + `enable_banking_items/new.html.erb` had `w-full inline-flex … hidden md:inline-flex` — the responsive pair conflicted (both `inline-flex` and `hidden md:inline-flex` on the same element). Migrated to `full_width: true` without the responsive split; the buttons now render at all breakpoints consistently. (Pre-existing copy-paste bug, fixed in passing.) - `enable_banking_panel` add-connection button gained `icon: "plus"` via the DS::Button API; the explicit `gap-2 … icon "plus"` markup is now redundant. Sibling buttons that don't match the primary spec (destructive trash, secondary outline-bordered, button-bg-secondary-strong on holdings/show.html.erb, etc.) are intentionally left alone — they need their own audit pass once #1840 lands and the focus-ring behavior on those variants is stable. * fix(review): restore SimpleFIN submit styling + i18n provider_form label - SimpleFIN new modal: switch form_with -> styled_form_with so f.submit picks up the DS::Button render via styled builder (Codex #1860). - _provider_form: replace hardcoded "Save and connect" with t(".save_and_connect") and add scoped key under settings.providers.provider_form (CodeRabbit).
This commit is contained in:
committed by
GitHub
parent
272b8acd66
commit
cdce00c71e
@@ -24,11 +24,12 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<%= link_to return_path.presence || settings_providers_path,
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 transition-colors",
|
||||
data: { turbo: false } do %>
|
||||
<%= t(".settings_link") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".settings_link"),
|
||||
href: return_path.presence || settings_providers_path,
|
||||
variant: :primary,
|
||||
data: { turbo: false }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -22,11 +22,12 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<%= link_to settings_providers_path,
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 transition-colors",
|
||||
data: { turbo: false } do %>
|
||||
<%= t(".settings_link") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".settings_link"),
|
||||
href: settings_providers_path,
|
||||
variant: :primary,
|
||||
data: { turbo: false }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -48,9 +48,12 @@
|
||||
<%= link_to t(".cancel"), @return_to || new_account_path,
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-primary button-bg-secondary hover:button-bg-secondary-hover",
|
||||
data: { turbo_frame: "_top" } %>
|
||||
<%= submit_tag t(".link_accounts"),
|
||||
disabled: !has_selectable,
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-inverse bg-inverse hover:bg-inverse-hover disabled:button-bg-disabled disabled:cursor-not-allowed" %>
|
||||
<%= render DS::Button.new(
|
||||
text: t(".link_accounts"),
|
||||
variant: :primary,
|
||||
type: :submit,
|
||||
disabled: !has_selectable
|
||||
) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -48,9 +48,12 @@
|
||||
<%= link_to t(".cancel"), @return_to || accounts_path,
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-primary button-bg-secondary hover:button-bg-secondary-hover",
|
||||
data: { turbo_frame: "_top" } %>
|
||||
<%= submit_tag t(".link_account"),
|
||||
disabled: !has_selectable,
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-inverse bg-inverse hover:bg-inverse-hover disabled:button-bg-disabled disabled:cursor-not-allowed" %>
|
||||
<%= render DS::Button.new(
|
||||
text: t(".link_account"),
|
||||
variant: :primary,
|
||||
type: :submit,
|
||||
disabled: !has_selectable
|
||||
) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -53,8 +53,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit t(".link_wallet_submit"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors" %>
|
||||
<%= form.submit t(".link_wallet_submit") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</section>
|
||||
@@ -90,8 +89,7 @@
|
||||
<div data-coinstats-exchange-fields-target="fields" class="space-y-3"></div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit t(".link_exchange_submit"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors" %>
|
||||
<%= form.submit t(".link_exchange_submit") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</section>
|
||||
@@ -115,11 +113,13 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<%= link_to settings_providers_path,
|
||||
class: "w-full inline-flex items-center justify-center rounded-lg font-medium whitespace-nowrap rounded-lg hidden md:inline-flex px-3 py-2 text-sm text-inverse bg-inverse hover:bg-inverse-hover disabled:bg-gray-500 theme-dark:disabled:bg-gray-400",
|
||||
data: { turbo: false } do %>
|
||||
<%= t(".go_to_settings") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".go_to_settings"),
|
||||
href: settings_providers_path,
|
||||
variant: :primary,
|
||||
full_width: true,
|
||||
data: { turbo: false }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -53,11 +53,13 @@
|
||||
<%= t(".reconnect") %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to select_bank_enable_banking_item_path(item),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-3 py-1.5 text-xs font-medium text-inverse button-bg-primary hover:button-bg-primary-hover transition-colors",
|
||||
data: { turbo_frame: "modal" } do %>
|
||||
<%= t(".connect_bank") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".connect_bank"),
|
||||
href: select_bank_enable_banking_item_path(item),
|
||||
variant: :primary,
|
||||
size: :sm,
|
||||
data: { turbo_frame: "modal" }
|
||||
) %>
|
||||
<% end %>
|
||||
|
||||
<%= button_to enable_banking_item_path(item),
|
||||
@@ -73,13 +75,13 @@
|
||||
<%# Add Connection button below the list - only show if we have a valid session to copy credentials from %>
|
||||
<% if item_for_new_connection %>
|
||||
<div class="flex justify-center pt-2">
|
||||
<%= button_to new_connection_enable_banking_item_path(item_for_new_connection),
|
||||
method: :post,
|
||||
class: "inline-flex items-center gap-2 justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover transition-colors",
|
||||
data: { turbo_frame: "modal" } do %>
|
||||
<%= icon "plus", size: "sm" %>
|
||||
<%= t(".add_connection") %>
|
||||
<% end %>
|
||||
<%= render DS::Button.new(
|
||||
text: t(".add_connection"),
|
||||
icon: "plus",
|
||||
href: new_connection_enable_banking_item_path(item_for_new_connection),
|
||||
variant: :primary,
|
||||
data: { turbo_method: :post, turbo_frame: "modal" }
|
||||
) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -104,11 +106,13 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<%= link_to settings_providers_path,
|
||||
class: "w-full inline-flex items-center justify-center rounded-lg font-medium whitespace-nowrap rounded-lg hidden md:inline-flex px-3 py-2 text-sm text-inverse bg-inverse hover:bg-inverse-hover disabled:bg-gray-500 theme-dark:disabled:bg-gray-400",
|
||||
data: { turbo: false } do %>
|
||||
<%= t(".go_to_provider_settings") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".go_to_provider_settings"),
|
||||
href: settings_providers_path,
|
||||
variant: :primary,
|
||||
full_width: true,
|
||||
data: { turbo: false }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</div>
|
||||
<div data-holding-security-remap-target="form" class="hidden mt-3 space-y-3">
|
||||
<% if Security.providers.any? %>
|
||||
<%= form_with url: remap_security_holding_path(@holding), method: :patch, class: "space-y-3" do |f| %>
|
||||
<%= styled_form_with url: remap_security_holding_path(@holding), method: :patch, class: "space-y-3" do |f| %>
|
||||
<div class="form-field combobox">
|
||||
<%= f.combobox :security_id,
|
||||
securities_path(country_code: Current.family.country),
|
||||
@@ -72,7 +72,7 @@
|
||||
data-action="click->holding-security-remap#toggle">
|
||||
<%= t(".cancel") %>
|
||||
</button>
|
||||
<%= f.submit t(".remap_security"), class: "inline-flex items-center gap-1 px-3 py-2 rounded-lg text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover" %>
|
||||
<%= f.submit t(".remap_security") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
@@ -185,7 +185,7 @@
|
||||
data-action="click->drawer-cost-basis#toggle">
|
||||
<%= t("holdings.cost_basis_cell.cancel") %>
|
||||
</button>
|
||||
<%= f.submit t("holdings.cost_basis_cell.save"), class: "inline-flex items-center gap-1 px-3 py-2 rounded-lg text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover" %>
|
||||
<%= f.submit t("holdings.cost_basis_cell.save") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -31,8 +31,20 @@
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<%= button_to t("import.confirms.sure_import.publish_button"), publish_import_path(@import), method: :post, class: "btn btn--primary w-full", disabled: !@import.publishable? %>
|
||||
<%= link_to t("import.confirms.sure_import.cancel"), imports_path, class: "btn btn--ghost w-full text-center" %>
|
||||
<%= render DS::Button.new(
|
||||
text: t("import.confirms.sure_import.publish_button"),
|
||||
href: publish_import_path(@import),
|
||||
variant: :primary,
|
||||
full_width: true,
|
||||
disabled: !@import.publishable?,
|
||||
data: { turbo_method: :post }
|
||||
) %>
|
||||
<%= render DS::Link.new(
|
||||
text: t("import.confirms.sure_import.cancel"),
|
||||
href: imports_path,
|
||||
variant: :ghost,
|
||||
full_width: true
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
<%= icon "alert-circle", class: "text-warning mx-auto mb-4", size: "lg" %>
|
||||
<p class="text-secondary"><%= t("indexa_capital_items.select_existing_account.no_accounts") %></p>
|
||||
<p class="text-sm text-secondary mt-2"><%= t("indexa_capital_items.select_existing_account.connect_hint") %></p>
|
||||
<%= link_to t("indexa_capital_items.select_existing_account.settings_link"), settings_providers_path, class: "btn btn--primary btn--sm mt-4" %>
|
||||
<%= render DS::Link.new(
|
||||
text: t("indexa_capital_items.select_existing_account.settings_link"),
|
||||
href: settings_providers_path,
|
||||
variant: :primary,
|
||||
size: :sm,
|
||||
class: "mt-4"
|
||||
) %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="space-y-4">
|
||||
|
||||
@@ -21,11 +21,12 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<%= link_to settings_providers_path,
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors",
|
||||
data: { turbo: false } do %>
|
||||
<%= t(".check_provider_settings") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".check_provider_settings"),
|
||||
href: settings_providers_path,
|
||||
variant: :primary,
|
||||
data: { turbo: false }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -20,11 +20,12 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<%= link_to settings_providers_path,
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors",
|
||||
data: { turbo: false } do %>
|
||||
<%= t(".go_to_provider_settings") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".go_to_provider_settings"),
|
||||
href: settings_providers_path,
|
||||
variant: :primary,
|
||||
data: { turbo: false }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -46,8 +46,11 @@
|
||||
<%= link_to t(".cancel"), @return_to || new_account_path,
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-primary button-bg-secondary hover:button-bg-secondary-hover",
|
||||
data: { turbo_frame: "_top", action: "DS--dialog#close" } %>
|
||||
<%= submit_tag t(".link_accounts"),
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-inverse bg-inverse hover:bg-inverse-hover disabled:button-bg-disabled" %>
|
||||
<%= render DS::Button.new(
|
||||
text: t(".link_accounts"),
|
||||
variant: :primary,
|
||||
type: :submit
|
||||
) %>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -46,8 +46,11 @@
|
||||
<%= link_to t(".cancel"), @return_to || accounts_path,
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-primary button-bg-secondary hover:button-bg-secondary-hover",
|
||||
data: { turbo_frame: "_top", action: "DS--dialog#close" } %>
|
||||
<%= submit_tag t(".link_account"),
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-inverse bg-inverse hover:bg-inverse-hover disabled:button-bg-disabled" %>
|
||||
<%= render DS::Button.new(
|
||||
text: t(".link_account"),
|
||||
variant: :primary,
|
||||
type: :submit
|
||||
) %>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<%= link_to settings_providers_path,
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors",
|
||||
data: { turbo: false } do %>
|
||||
<%= t(".check_provider_settings") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".check_provider_settings"),
|
||||
href: settings_providers_path,
|
||||
variant: :primary,
|
||||
data: { turbo: false }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -22,11 +22,12 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<%= link_to settings_providers_path,
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors",
|
||||
data: { turbo: false } do %>
|
||||
<%= t(".go_to_provider_settings") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".go_to_provider_settings"),
|
||||
href: settings_providers_path,
|
||||
variant: :primary,
|
||||
data: { turbo: false }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -48,8 +48,11 @@
|
||||
<%= link_to t(".cancel"), @return_to || new_account_path,
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-primary button-bg-secondary hover:button-bg-secondary-hover",
|
||||
data: { turbo_frame: "_top", action: "DS--dialog#close" } %>
|
||||
<%= submit_tag t(".link_accounts"),
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-inverse bg-inverse hover:bg-inverse-hover disabled:button-bg-disabled" %>
|
||||
<%= render DS::Button.new(
|
||||
text: t(".link_accounts"),
|
||||
variant: :primary,
|
||||
type: :submit
|
||||
) %>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -48,8 +48,11 @@
|
||||
<%= link_to t(".cancel"), @return_to || accounts_path,
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-primary button-bg-secondary hover:button-bg-secondary-hover",
|
||||
data: { turbo_frame: "_top", action: "DS--dialog#close" } %>
|
||||
<%= submit_tag t(".link_account"),
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-inverse bg-inverse hover:bg-inverse-hover disabled:button-bg-disabled" %>
|
||||
<%= render DS::Button.new(
|
||||
text: t(".link_account"),
|
||||
variant: :primary,
|
||||
type: :submit
|
||||
) %>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
<%= t(".description") %>
|
||||
</p>
|
||||
<div>
|
||||
<%= link_to t(".start_chatting"), chats_path, class: "inline-flex items-center gap-2 px-4 py-2 rounded-lg button-bg-primary text-inverse font-medium" %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".start_chatting"),
|
||||
href: chats_path,
|
||||
variant: :primary
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -35,8 +35,11 @@
|
||||
<%= link_to t(".cancel"), accounts_path,
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-primary button-bg-secondary hover:button-bg-secondary-hover",
|
||||
data: { turbo_frame: "_top", action: "DS--dialog#close" } %>
|
||||
<%= submit_tag t(".link_account"),
|
||||
class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-inverse bg-inverse hover:bg-inverse-hover disabled:button-bg-disabled" %>
|
||||
<%= render DS::Button.new(
|
||||
text: t(".link_account"),
|
||||
variant: :primary,
|
||||
type: :submit
|
||||
) %>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -93,8 +93,7 @@
|
||||
type: :password %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit t("settings.providers.binance_panel.connect_button"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition-colors" %>
|
||||
<%= form.submit t("settings.providers.binance_panel.connect_button") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -98,8 +98,7 @@
|
||||
href: setup_accounts_brex_item_path(item),
|
||||
frame: :modal
|
||||
) %>
|
||||
<%= form.submit t("brex_items.provider_panel.update_connection"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors" %>
|
||||
<%= form.submit t("brex_items.provider_panel.update_connection") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -136,8 +135,7 @@
|
||||
placeholder: t("brex_items.provider_panel.base_url_placeholder") %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit t("brex_items.provider_panel.add_connection"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors" %>
|
||||
<%= form.submit t("brex_items.provider_panel.add_connection") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</details>
|
||||
|
||||
@@ -72,8 +72,7 @@
|
||||
type: :password %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit t("settings.providers.coinbase_panel.connect_button"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition-colors" %>
|
||||
<%= form.submit t("settings.providers.coinbase_panel.connect_button") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -32,8 +32,7 @@
|
||||
type: :password %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit is_new_record ? t("coinstats_items.new.configure") : t("coinstats_items.new.update_configuration"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition-colors" %>
|
||||
<%= form.submit is_new_record ? t("coinstats_items.new.configure") : t("coinstats_items.new.update_configuration") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -90,8 +90,7 @@
|
||||
disabled: has_authenticated_connections && !is_new_record %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit is_new_record ? t("settings.providers.enable_banking_panel.save_and_connect") : t("settings.providers.enable_banking_panel.update_connection"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors" %>
|
||||
<%= form.submit is_new_record ? t("settings.providers.enable_banking_panel.save_and_connect") : t("settings.providers.enable_banking_panel.update_connection") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -158,11 +157,13 @@
|
||||
<%= t("settings.providers.enable_banking_panel.reconnect") %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to select_bank_enable_banking_item_path(item),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-3 py-1.5 text-xs font-medium text-inverse button-bg-primary hover:button-bg-primary-hover transition-colors",
|
||||
data: { turbo_frame: "modal" } do %>
|
||||
<%= t("settings.providers.enable_banking_panel.connect_bank") %>
|
||||
<% end %>
|
||||
<%= render DS::Link.new(
|
||||
text: t("settings.providers.enable_banking_panel.connect_bank"),
|
||||
href: select_bank_enable_banking_item_path(item),
|
||||
variant: :primary,
|
||||
size: :sm,
|
||||
data: { turbo_frame: "modal" }
|
||||
) %>
|
||||
<% end %>
|
||||
|
||||
<%= button_to enable_banking_item_path(item),
|
||||
@@ -178,13 +179,13 @@
|
||||
<%# Add Connection button below the list - only show if we have a valid session to copy credentials from %>
|
||||
<% if item_for_new_connection %>
|
||||
<div class="flex justify-center pt-2">
|
||||
<%= button_to new_connection_enable_banking_item_path(item_for_new_connection),
|
||||
method: :post,
|
||||
class: "inline-flex items-center gap-2 justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover transition-colors",
|
||||
data: { turbo_frame: "modal" } do %>
|
||||
<%= icon "plus", size: "sm" %>
|
||||
<%= t("settings.providers.enable_banking_panel.add_connection") %>
|
||||
<% end %>
|
||||
<%= render DS::Button.new(
|
||||
text: t("settings.providers.enable_banking_panel.add_connection"),
|
||||
icon: "plus",
|
||||
href: new_connection_enable_banking_item_path(item_for_new_connection),
|
||||
variant: :primary,
|
||||
data: { turbo_method: :post, turbo_frame: "modal" }
|
||||
) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
type: :password %>
|
||||
|
||||
<div class="flex flex-wrap justify-end gap-2">
|
||||
<%= form.submit(is_new_record ? t(".save_configuration") : t(".update_configuration"), class: "btn btn--primary") %>
|
||||
<%= form.submit(is_new_record ? t(".save_configuration") : t(".update_configuration")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit is_new_record ? t("indexa_capital_items.panel.save_button") : t("indexa_capital_items.panel.update_button"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium btn btn--primary" %>
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -93,8 +93,7 @@
|
||||
value: nil %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit t("settings.providers.kraken_panel.update_connection"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors" %>
|
||||
<%= form.submit t("settings.providers.kraken_panel.update_connection") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -134,8 +133,7 @@
|
||||
value: nil %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit t("settings.providers.kraken_panel.add_connection"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors" %>
|
||||
<%= form.submit t("settings.providers.kraken_panel.add_connection") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -37,8 +37,7 @@
|
||||
value: lunchflow_item.base_url %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit is_new_record ? t("settings.providers.lunchflow_panel.save_and_connect") : t("settings.providers.lunchflow_panel.update_connection"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors" %>
|
||||
<%= form.submit is_new_record ? t("settings.providers.lunchflow_panel.save_and_connect") : t("settings.providers.lunchflow_panel.update_connection") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -78,8 +78,7 @@
|
||||
href: setup_accounts_mercury_item_path(item),
|
||||
frame: :modal
|
||||
) %>
|
||||
<%= form.submit t("mercury_items.provider_panel.update_connection"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors" %>
|
||||
<%= form.submit t("mercury_items.provider_panel.update_connection") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -117,8 +116,7 @@
|
||||
<p class="text-xs text-secondary px-1 -mt-1"><%= t("mercury_items.provider_panel.sandbox_note_html").html_safe %></p>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit t("mercury_items.provider_panel.add_connection"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors" %>
|
||||
<%= form.submit t("mercury_items.provider_panel.add_connection") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -63,8 +63,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit "Save and connect",
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors" %>
|
||||
<%= form.submit t(".save_and_connect") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
type: :password %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit t("settings.providers.simplefin_panel.save_and_connect"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse button-bg-primary hover:button-bg-primary-hover focus:outline-none focus:ring-2 focus:ring-gray-900 theme-dark:focus:ring-white focus:ring-offset-2 transition-colors" %>
|
||||
<%= form.submit t("settings.providers.simplefin_panel.save_and_connect") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -38,8 +38,7 @@
|
||||
type: :password %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit is_new_record ? t("providers.snaptrade.save_button") : t("providers.snaptrade.update_button"),
|
||||
class: "btn btn--primary" %>
|
||||
<%= form.submit is_new_record ? t("providers.snaptrade.save_button") : t("providers.snaptrade.update_button") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -40,8 +40,7 @@
|
||||
value: sophtron_item.base_url %>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<%= form.submit is_new_record ? t("sophtron_items.sophtron_panel.save") : t("sophtron_items.sophtron_panel.update"),
|
||||
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors" %>
|
||||
<%= form.submit is_new_record ? t("sophtron_items.sophtron_panel.save") : t("sophtron_items.sophtron_panel.update") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -52,14 +52,15 @@
|
||||
new_name: new_sfa.name),
|
||||
btn_text: t("simplefin_items.replacement_prompt.relink")
|
||||
) %>
|
||||
<%= button_to t("simplefin_items.replacement_prompt.relink"),
|
||||
link_existing_account_simplefin_items_path(
|
||||
account_id: sure_account.id,
|
||||
simplefin_account_id: new_sfa.id
|
||||
),
|
||||
method: :post,
|
||||
data: { turbo_confirm: confirm.to_data_attribute },
|
||||
class: "inline-flex items-center gap-1.5 text-sm font-medium px-3 py-2 rounded-lg text-inverse bg-inverse hover:bg-inverse-hover" %>
|
||||
<%= render DS::Button.new(
|
||||
text: t("simplefin_items.replacement_prompt.relink"),
|
||||
href: link_existing_account_simplefin_items_path(
|
||||
account_id: sure_account.id,
|
||||
simplefin_account_id: new_sfa.id
|
||||
),
|
||||
variant: :primary,
|
||||
data: { turbo_method: :post, turbo_confirm: confirm.to_data_attribute }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,15 +9,20 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= form_with model: @simplefin_item, url: simplefin_items_path, method: :post, data: { turbo: true, turbo_frame: "_top" } do |f| %>
|
||||
<%= styled_form_with model: @simplefin_item, url: simplefin_items_path, method: :post, data: { turbo: true, turbo_frame: "_top" } do |f| %>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<%= f.label :setup_token, t(".setup_token"), class: "text-sm text-secondary block mb-1" %>
|
||||
<%= f.text_field :setup_token, class: "input", placeholder: t(".setup_token_placeholder") %>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 justify-end pt-2">
|
||||
<%= link_to t(".cancel"), accounts_path, class: "btn", data: { turbo_frame: "_top", action: "DS--dialog#close" } %>
|
||||
<%= f.submit t(".connect"), class: "btn btn--primary" %>
|
||||
<%= render DS::Link.new(
|
||||
text: t(".cancel"),
|
||||
href: accounts_path,
|
||||
variant: :secondary,
|
||||
data: { turbo_frame: "_top", action: "DS--dialog#close" }
|
||||
) %>
|
||||
<%= f.submit t(".connect") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
<%= icon "alert-circle", class: "text-warning mx-auto mb-4", size: "lg" %>
|
||||
<p class="text-secondary"><%= t("snaptrade_items.select_existing_account.no_accounts", default: "No unlinked SnapTrade accounts available.") %></p>
|
||||
<p class="text-sm text-secondary mt-2"><%= t("snaptrade_items.select_existing_account.connect_hint", default: "You may need to connect a brokerage first.") %></p>
|
||||
<%= link_to t("snaptrade_items.select_existing_account.settings_link", default: "Go to Provider Settings"), settings_providers_path, class: "btn btn--primary btn--sm mt-4" %>
|
||||
<%= render DS::Link.new(
|
||||
text: t("snaptrade_items.select_existing_account.settings_link", default: "Go to Provider Settings"),
|
||||
href: settings_providers_path,
|
||||
variant: :primary,
|
||||
size: :sm,
|
||||
class: "mt-4"
|
||||
) %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="space-y-4">
|
||||
|
||||
@@ -28,16 +28,20 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 mt-3">
|
||||
<%= button_to t("transactions.show.merge_duplicate"),
|
||||
merge_duplicate_transaction_path(@entry.transaction),
|
||||
method: :post,
|
||||
class: "btn btn--primary btn--sm",
|
||||
data: { turbo_frame: "_top" } %>
|
||||
<%= button_to t("transactions.show.keep_both"),
|
||||
dismiss_duplicate_transaction_path(@entry.transaction),
|
||||
method: :post,
|
||||
class: "btn btn--outline btn--sm",
|
||||
data: { turbo_frame: "_top" } %>
|
||||
<%= render DS::Button.new(
|
||||
text: t("transactions.show.merge_duplicate"),
|
||||
href: merge_duplicate_transaction_path(@entry.transaction),
|
||||
variant: :primary,
|
||||
size: :sm,
|
||||
data: { turbo_method: :post, turbo_frame: "_top" }
|
||||
) %>
|
||||
<%= render DS::Button.new(
|
||||
text: t("transactions.show.keep_both"),
|
||||
href: dismiss_duplicate_transaction_path(@entry.transaction),
|
||||
variant: :outline,
|
||||
size: :sm,
|
||||
data: { turbo_method: :post, turbo_frame: "_top" }
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -342,6 +342,8 @@ en:
|
||||
encryption_error:
|
||||
title: Encryption keys missing
|
||||
message: "Bank sync needs Active Record encryption configured. Set primary_key, deterministic_key and key_derivation_salt in your Rails credentials or environment variables."
|
||||
provider_form:
|
||||
save_and_connect: "Save and connect"
|
||||
coinbase_panel:
|
||||
setup_instructions: "To connect Coinbase:"
|
||||
step1_html: Go to <a href="https://portal.cdp.coinbase.com/projects/api-keys" target="_blank" rel="noopener noreferrer" class="text-primary underline">Coinbase API Settings</a>
|
||||
|
||||
Reference in New Issue
Block a user