Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit b1fabfa

Browse files
committed
Account Detail
1 parent 868fcfc commit b1fabfa

7 files changed

Lines changed: 1243 additions & 9 deletions

File tree

‎src/lib/utils/roleChecker.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ export const SITE_MAP: Record<string, PageRoleConfig> = {
190190
"/account-access/account-directory": {
191191
required: [{ role: "CanGetAccountDirectoryAtOneBank", bankScoped: true }],
192192
},
193+
"/account-access/accounts/[bank_id]/[account_id]/[view_id]": {
194+
required: [],
195+
optional: [{ role: "CanExecuteAbacRule" }],
196+
},
193197

194198
// ── Users ─────────────────────────────────────────────
195199
"/users": {

‎src/routes/(protected)/+layout.server.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ export const load: LayoutServerLoad = async ({ locals }) => {
44
const session = locals.session;
55
const userEntitlements =
66
(session?.data?.user as any)?.entitlements?.list || [];
7-
return { userEntitlements };
7+
const userId = (session?.data?.user as any)?.user_id || "";
8+
return { userEntitlements, userId };
89
};

‎src/routes/(protected)/account-access/account-directory/+page.svelte‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@
160160
<tbody>
161161
{#each filteredAccounts as account}
162162
<tr>
163-
<td class="cell-mono cell-id">{account.account_id}</td>
163+
<td class="cell-mono cell-id">
164+
<a href="/account-access/accounts/{encodeURIComponent(account.bank_id)}/{encodeURIComponent(account.account_id)}/owner" class="account-link">
165+
{account.account_id}
166+
</a>
167+
</td>
164168
<td>
165169
{#if account.account_type}
166170
<span class="badge">{account.account_type}</span>
@@ -428,15 +432,23 @@
428432
}
429433
430434
.cell-id {
431-
color: #9ca3af;
432435
max-width: 180px;
433436
overflow: hidden;
434437
text-overflow: ellipsis;
435438
white-space: nowrap;
436439
}
437440
438-
:global([data-mode="dark"]) .cell-id {
439-
color: var(--color-surface-500);
441+
.account-link {
442+
color: #3b82f6;
443+
text-decoration: none;
444+
}
445+
446+
.account-link:hover {
447+
text-decoration: underline;
448+
}
449+
450+
:global([data-mode="dark"]) .account-link {
451+
color: rgb(var(--color-primary-400));
440452
}
441453
442454
.badge {

‎src/routes/(protected)/account-access/accounts/+page.svelte‎

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,15 @@
8585
{#if accounts.length > 0}
8686
<ul class="account-list">
8787
{#each accounts as account}
88+
{@const acctId = account.id || account.account_id}
89+
{@const firstView = account.views_available?.[0]?.id || "owner"}
8890
<li class="account-item">
89-
<span class="account-id">{account.id || account.account_id}</span>
90-
{#if account.label}
91-
<span class="account-label">{account.label}</span>
92-
{/if}
91+
<a href="/account-access/accounts/{encodeURIComponent(currentBank.bankId)}/{encodeURIComponent(acctId)}/{encodeURIComponent(firstView)}" class="account-link">
92+
<span class="account-id">{acctId}</span>
93+
{#if account.label}
94+
<span class="account-label">{account.label}</span>
95+
{/if}
96+
</a>
9397
{#if account.views_available?.length}
9498
<span class="account-views">{account.views_available.length} view{account.views_available.length !== 1 ? "s" : ""}</span>
9599
{/if}
@@ -254,11 +258,28 @@
254258
border-bottom-color: rgb(var(--color-surface-700));
255259
}
256260
261+
.account-link {
262+
display: flex;
263+
align-items: center;
264+
gap: 0.75rem;
265+
text-decoration: none;
266+
flex: 1;
267+
}
268+
269+
.account-link:hover .account-id {
270+
color: #3b82f6;
271+
}
272+
273+
:global([data-mode="dark"]) .account-link:hover .account-id {
274+
color: rgb(var(--color-primary-400));
275+
}
276+
257277
.account-id {
258278
font-size: 0.8rem;
259279
font-family: monospace;
260280
color: #111827;
261281
font-weight: 500;
282+
transition: color 0.2s;
262283
}
263284
264285
:global([data-mode="dark"]) .account-id {

0 commit comments

Comments
 (0)