whisper-money/resources/js/components/open-banking
Víctor Falcón 64827fabae
feat(open-banking): allow re-connecting a bank behind a replace warning (#570)
## Why

Users with several accounts at the same bank (for example a partner's
account at the same bank) need to connect the same Enable Banking ASPSP
more than once. Previously an already-connected bank was hard-blocked:
disabled in the connect dialog list, and filtered out entirely from the
onboarding inline flow with a "you already have this connected, go
reconnect" message.

## What changed

- The already-connected bank stays **selectable** and is marked with an
**"Already connected"** badge instead of being blocked/hidden.
- On the confirm step, when the selected bank already has a **live**
connection, a destructive warning explains that authorizing with the
**same bank login replaces the existing session and stops it working** —
continue only when adding a *different* account.
- The **Connect** button is gated behind an acknowledgement checkbox ("I
understand the existing connection may stop working") so a working
connection can't be replaced by accident.
- New shared `ReplaceConnectionWarning` component keeps the dialog and
inline flows from drifting apart (the same divergence #569 unified).

## Notes

- **No backend changes.** `AuthorizationController@store` already
created a fresh connection for a repeated bank; the block was
frontend-only.
- Out of scope: the previous `BankingConnection` row stays `active` in
our DB after the user re-authorizes the same login, even though Enable
Banking has invalidated it. It self-corrects on the next sync failure.
Auto-marking/cleaning the superseded connection on callback is a
separate backend follow-up.

## Testing

- New `connect-account-dialog.test.tsx`: already-connected bank is
selectable + badged, Connect is gated behind the acknowledgement, and a
fresh bank shows no warning.
- Full JS suite (234 tests) and `LocalizationTest` pass; lint and format
clean.
2026-06-20 17:23:49 +00:00
..
connect-account-dialog.test.tsx feat(open-banking): allow re-connecting a bank behind a replace warning (#570) 2026-06-20 17:23:49 +00:00
connect-account-dialog.tsx feat(open-banking): allow re-connecting a bank behind a replace warning (#570) 2026-06-20 17:23:49 +00:00
connect-account-inline.tsx feat(open-banking): allow re-connecting a bank behind a replace warning (#570) 2026-06-20 17:23:49 +00:00
connection-status-badge.tsx fix(ux): improve status badge, hide balance update for connected accounts, localize delete confirm (#159) 2026-02-27 22:37:16 +00:00
disconnect-dialog.tsx feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00
replace-connection-warning.tsx feat(open-banking): allow re-connecting a bank behind a replace warning (#570) 2026-06-20 17:23:49 +00:00
update-credentials-dialog.tsx feat: Coinbase banking integration (#388) 2026-05-13 19:53:30 +02:00
upgrade-connection-dialog.tsx Gate bank connections for free-tier accounts & upgrade billing page (#205) 2026-03-05 12:13:01 +00:00