Files
sure/app/views/enable_banking_items/select_bank.html.erb
T
William Wei MingandCursor d2eab1c9c7 fix(ds): resolve remaining DS Drift Patrol findings (#2157) (#2977)
* fix(ds): resolve remaining DS Drift Patrol findings from #2157

Migrate leftover hand-rolled UI and i18n defaults to DS primitives and
locale entries so missing keys raise in development again.

Closes #2157

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(a11y): name PDF import account select via aria-labelledby

Wire the existing localized heading to the select so label: false
does not leave the control unlabeled for assistive tech.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(akahu): use scoped form.select for account type fields

Replace the unusual bracketed method name on a scope-less builder with
scope: :account_types and form.select(account.id), and assert the label
for= matches the generated select id.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add German translation for shared.dot_separator

Keeps I18nTest German coverage green after merging main's completed de locale.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ds): resolve remaining DS Drift Patrol findings from #2157

Migrate leftover hand-rolled UI and i18n defaults to DS primitives and
locale entries so missing keys raise in development again.

Closes #2157

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(a11y): name PDF import account select via aria-labelledby

Wire the existing localized heading to the select so label: false
does not leave the control unlabeled for assistive tech.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(akahu): use scoped form.select for account type fields

Replace the unusual bracketed method name on a scope-less builder with
scope: :account_types and form.select(account.id), and assert the label
for= matches the generated select id.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add German translation for shared.dot_separator

Keeps I18nTest German coverage green after merging main's completed de locale.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ds): address tag select review feedback

Use the canonical focus-ring-within wrapper and preserve full width for
embedded tag search. Add the shared separator key to every shipped locale
and document the intentional unknown PDF document-type fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-16 07:09:01 +02:00

81 lines
3.5 KiB
ERB

<%= turbo_frame_tag "modal" do %>
<%= render DS::Dialog.new do |dialog| %>
<% dialog.with_header(title: t(".title")) %>
<% dialog.with_body do %>
<div class="space-y-4" data-controller="bank-search">
<p class="text-sm text-secondary">
<%= t(".description") %>
</p>
<% if @error_message.present? %>
<div class="p-3 rounded-lg bg-destructive/10 text-destructive text-sm">
<%= @error_message %>
</div>
<% end %>
<% if @aspsps.present? %>
<%= render DS::SearchInput.new(
placeholder: t(".search_placeholder"),
aria_label: t(".search_label"),
autofocus: true,
data: {
bank_search_target: "input",
action: "input->bank-search#filter"
}
) %>
<div class="space-y-2 max-h-80 overflow-y-auto">
<% @aspsps.each do |aspsp| %>
<div data-bank-search-target="item" data-bank-search="<%= [ aspsp[:name], aspsp[:bic] ].compact_blank.join(" ").downcase(:fold) %>">
<%= button_to authorize_enable_banking_item_path(@enable_banking_item),
method: :post,
params: { aspsp_name: aspsp[:name], new_connection: @new_connection },
class: "w-full flex items-center gap-4 p-3 rounded-lg border border-primary bg-container hover:bg-subtle transition-colors text-left",
data: { turbo: false } do %>
<% if aspsp[:logo].present? %>
<img src="<%= aspsp[:logo] %>" alt="<%= aspsp[:name] %>" class="w-10 h-10 rounded object-contain">
<% else %>
<div class="w-10 h-10 rounded bg-container-inset flex items-center justify-center">
<%= icon "building-bank", class: "w-5 h-5 text-tertiary" %>
</div>
<% end %>
<div class="flex-1 min-w-0">
<div class="flex items-center gap-2 flex-wrap">
<p class="font-medium text-sm text-primary"><%= aspsp[:name] %></p>
<% if aspsp[:beta] %>
<%= render DS::Pill.new(label: t(".beta_label"), tone: :warning, marker: false) %>
<% end %>
</div>
<% if aspsp[:bic].present? %>
<p class="text-xs text-secondary truncate">BIC: <%= aspsp[:bic] %></p>
<% end %>
</div>
<%= icon "chevron-right", class: "w-5 h-5 text-secondary flex-shrink-0" %>
<% end %>
</div>
<% end %>
<div data-bank-search-target="emptyState" class="hidden py-4 text-center text-sm text-secondary">
<%= t(".no_search_results") %>
</div>
</div>
<% else %>
<div class="text-center py-8">
<p class="text-secondary"><%= t(".no_banks") %></p>
<p class="text-sm text-secondary mt-2"><%= t(".check_country") %></p>
</div>
<% end %>
<div class="flex justify-end pt-4">
<%= render DS::Link.new(
text: t(".cancel"),
variant: :secondary,
href: settings_providers_path,
data: { turbo_frame: "_top", action: "DS--dialog#close" }
) %>
</div>
</div>
<% end %>
<% end %>
<% end %>