Skip to content

Commit 73c30e1

Browse files
committed
Opey insight bar, insights, edit mehtod-routings, mandates.
1 parent f37ce6f commit 73c30e1

11 files changed

Lines changed: 322 additions & 23 deletions

File tree

remaining_site_map_pages.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Pages Missing from SITE_MAP
2+
3+
Pages that exist under `src/routes/(protected)/` but have no entry in `SITE_MAP` (in `src/lib/utils/roleChecker.ts`), meaning they render without the `PageRoleCheck` widget.
4+
5+
Excludes `/user` (profile) and `/user/site-map` which are user-facing and don't need OBP role guards.
6+
7+
---
8+
9+
## RBAC
10+
11+
| Route | Description |
12+
|---|---|
13+
| `/rbac/roles/[role]` | View individual role detail |
14+
| `/rbac/banks` | RBAC banks view |
15+
16+
## System
17+
18+
| Route | Description |
19+
|---|---|
20+
| `/system/webui-props` | List WebUI properties (create/edit/delete are covered) |
21+
| `/system/signal-publish` | Publish signal |
22+
23+
## Consumers
24+
25+
| Route | Description |
26+
|---|---|
27+
| `/consumers/[consumer_id]/rate-limits` | List rate limits for a consumer |
28+
| `/consumers/[consumer_id]/rate-limits/create` | Create rate limit |
29+
30+
## Metrics
31+
32+
| Route | Description |
33+
|---|---|
34+
| `/metrics` | Metrics dashboard |
35+
| `/aggregate-metrics` | Aggregate metrics dashboard |
36+
37+
## Banks
38+
39+
| Route | Description |
40+
|---|---|
41+
| `/banks` | List banks |
42+
| `/banks/[bankId]` | View bank details |
43+
44+
## API Collections
45+
46+
| Route | Description |
47+
|---|---|
48+
| `/api-collections` | List API collections |
49+
| `/api-collections/create` | Create API collection |
50+
| `/api-collections/[collection_id]` | View API collection |
51+
| `/api-collections/[collection_id]/edit` | Edit API collection |
52+
| `/api-collections/[collection_id]/delete` | Delete API collection |
53+
54+
## Products
55+
56+
| Route | Description |
57+
|---|---|
58+
| `/products` | List products |
59+
| `/products/create` | Create product |
60+
| `/products/[bank_id]/[product_code]` | View product detail |
61+
| `/products/[bank_id]/[product_code]/edit` | Edit product |
62+
| `/products/bootstrap` | Bootstrap products |
63+
| `/products/collections` | Product collections |
64+
| `/products/financial` | Financial products |
65+
| `/products/help` | Products help/documentation |
66+
67+
## Account Access
68+
69+
| Route | Description |
70+
|---|---|
71+
| `/account-access/accounts` | List accounts |
72+
| `/account-access/system-views` | List system views (create/edit are covered) |
73+
| `/account-access/system-views/[view_id]` | View system view detail |
74+
| `/account-access/custom-views` | List custom views (create is covered) |
75+
| `/account-access/custom-views/[view_id]` | View custom view detail |
76+
77+
## Dynamic Endpoints
78+
79+
| Route | Description |
80+
|---|---|
81+
| `/dynamic-endpoints/bank` | List bank-level dynamic endpoints |
82+
| `/dynamic-endpoints/bank/[bank_id]/create` | Create bank dynamic endpoint |
83+
| `/dynamic-endpoints/bank/[bank_id]/[id]` | View/edit bank dynamic endpoint |
84+
| `/dynamic-endpoints/system` | List system dynamic endpoints |
85+
| `/dynamic-endpoints/system/create` | Create system dynamic endpoint |
86+
| `/dynamic-endpoints/system/[id]` | View/edit system dynamic endpoint |
87+
88+
## Dynamic Entities
89+
90+
| Route | Description |
91+
|---|---|
92+
| `/dynamic-entities/system` | List system dynamic entities (diagnostics is covered) |
93+
| `/dynamic-entities/system/create` | Create system dynamic entity |
94+
| `/dynamic-entities/system/[id]` | View system dynamic entity detail |
95+
| `/dynamic-entities/system/[id]/crud` | CRUD operations for system dynamic entity |
96+
| `/dynamic-entities/system/openapi-json` | OpenAPI JSON export |
97+
| `/dynamic-entities/system/openapi-yaml` | OpenAPI YAML export |
98+
| `/dynamic-entities/personal` | List personal dynamic entities |
99+
| `/dynamic-entities/personal/[entityName]` | View personal dynamic entity |
100+
101+
## Users
102+
103+
| Route | Description |
104+
|---|---|
105+
| `/users/[user_id]/unlock` | Unlock user by ID (duplicate of `/users/[provider]/[username]/unlock`?) |
106+
| `/users/[user_id]/lock` | Lock user by ID (duplicate of `/users/[provider]/[username]/lock`?) |
107+
| `/user-invitations` | User invitations |
108+
109+
## User (own account — may not need admin role guards)
110+
111+
| Route | Description |
112+
|---|---|
113+
| `/user/consents` | User's own consents |
114+
| `/user/entitlements` | User's own entitlements |

src/lib/components/OpeyInsightBar.svelte

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { onMount } from "svelte";
44
import { insightService } from "$lib/opey/services/InsightService";
55
import { pageDataSummary } from "$lib/stores/pageDataSummary.svelte";
6+
import { pageHeading } from "$lib/stores/pageHeading.svelte";
67
78
let { pathname, pageContext }: { pathname: string; pageContext: string } = $props();
89
@@ -11,13 +12,24 @@
1112
let loading = $state(true);
1213
1314
onMount(() => {
14-
// Clear any stale summary from the previous page
15+
// Clear any stale data from the previous page
1516
pageDataSummary.clear();
16-
// Wait a moment for the page to load its data and call pageDataSummary.set()
17+
pageHeading.clear();
18+
// Wait a moment for the page to load its data and call pageDataSummary.set() / pageHeading.set()
1719
const timer = setTimeout(() => fetchInsight(), 1500);
1820
return () => clearTimeout(timer);
1921
});
2022
23+
let displayLabel = $derived(
24+
pageHeading.value ? `${pageContext}: ${pageHeading.value}` : pageContext
25+
);
26+
27+
let askPrompt = $derived(
28+
pageHeading.value
29+
? `Tell me about the ${pageContext} ${pageHeading.value}`
30+
: insightText
31+
);
32+
2133
async function fetchInsight() {
2234
loading = true;
2335
@@ -33,9 +45,9 @@
3345
// Ask Opey for a short insight based on notebook + current page
3446
const insight = await insightService.getInsight(pageContext, recentNotes);
3547
36-
insightText = insight || pageContext;
48+
insightText = insight || displayLabel;
3749
} catch {
38-
insightText = pageContext;
50+
insightText = displayLabel;
3951
} finally {
4052
loading = false;
4153
}
@@ -53,9 +65,15 @@
5365
<span class="flex-1 text-surface-500">Opey is thinking...</span>
5466
{:else}
5567
<MessageCircle class="size-4 shrink-0 text-tertiary-500" />
56-
<span class="flex-1">{insightText}</span>
68+
<span class="flex-1">
69+
{#if pageHeading.value}
70+
<strong>{displayLabel}</strong> — {insightText}
71+
{:else}
72+
{insightText}
73+
{/if}
74+
</span>
5775
<a
58-
href="/?ask={encodeURIComponent(insightText)}"
76+
href="/?ask={encodeURIComponent(askPrompt)}"
5977
data-testid="opey-insight-ask-button"
6078
class="btn btn-sm preset-tonal-tertiary shrink-0"
6179
>

src/lib/config/insightMessages.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
const routeDescriptions: Array<{ pattern: RegExp; description: string }> = [
77
{ pattern: /^\/banks\/create$/, description: "Create Bank" },
8-
{ pattern: /^\/banks\/([^/]+)\/([^/]+)/, description: "Bank detail" },
8+
{ pattern: /^\/banks\/(?!create$)[^/]+/, description: "Bank" },
99
{ pattern: /^\/banks$/, description: "Banks list" },
1010
{ pattern: /^\/users$/, description: "Users list" },
1111
{ pattern: /^\/consumers$/, description: "API Consumers list" },
@@ -38,6 +38,7 @@ const routeDescriptions: Array<{ pattern: RegExp; description: string }> = [
3838
{ pattern: /^\/dynamic-endpoints/, description: "Dynamic Endpoints" },
3939
{ pattern: /^\/customers\/individual/, description: "Individual Customers" },
4040
{ pattern: /^\/customers\/corporate/, description: "Corporate Customers" },
41+
{ pattern: /^\/customers\/[^/]+\/[^/]+/, description: "Customer" },
4142
{ pattern: /^\/customers/, description: "Customers" },
4243
{ pattern: /^\/account-access\/system-views/, description: "System Views" },
4344
{ pattern: /^\/account-access\/custom-views/, description: "Custom Views" },
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* A simple reactive store for the current page's entity heading.
3+
* Pages set this to the name/title of the entity being viewed
4+
* (e.g. "Singapore BioTech Solutions Pte Ltd" on a customer page).
5+
*
6+
* The Opey Insight Bar reads this to enrich its display and "Ask Opey" prompt.
7+
*
8+
* Usage from any page:
9+
* import { pageHeading } from '$lib/stores/pageHeading.svelte';
10+
* pageHeading.set("Singapore BioTech Solutions Pte Ltd");
11+
*/
12+
13+
let heading = $state("");
14+
15+
export const pageHeading = {
16+
get value() { return heading; },
17+
set(text: string) { heading = text; },
18+
clear() { heading = ""; },
19+
};

src/routes/(protected)/account-access/accounts/[bank_id]/[account_id]/[view_id]/+page.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import MissingRoleAlert from "$lib/components/MissingRoleAlert.svelte";
66
77
import { pageDataSummary } from "$lib/stores/pageDataSummary.svelte";
8+
import { pageHeading } from "$lib/stores/pageHeading.svelte";
89
910
let { data }: { data: any } = $props();
1011
@@ -50,6 +51,7 @@
5051
const views = account.views_available?.length || 0;
5152
const label = account.label || account.account_id || "";
5253
pageDataSummary.set(`Viewing account ${label} at ${account.bank_id}, ${views} views available`);
54+
pageHeading.set(label);
5355
}
5456
});
5557
let hasAccountAccess = $state<boolean | null>(null);

src/routes/(protected)/banks/[bankId]/+page.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import { invalidateAll } from "$app/navigation";
66
import { currentBank } from "$lib/stores/currentBank.svelte";
77
import { pageDataSummary } from "$lib/stores/pageDataSummary.svelte";
8+
import { pageHeading } from "$lib/stores/pageHeading.svelte";
89
910
let { data }: { data: PageData } = $props();
1011
@@ -14,6 +15,7 @@
1415
if (bank) {
1516
const attrs = bank.bank_attributes?.length || 0;
1617
pageDataSummary.set(`Viewing bank ${bank.full_name} (${bank.bank_id}, code: ${bank.bank_code})${attrs ? `, ${attrs} attributes` : ""}`);
18+
pageHeading.set(bank.full_name);
1719
}
1820
});
1921

src/routes/(protected)/consumers/[consumer_id]/edit/+page.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import { currentBank } from "$lib/stores/currentBank.svelte";
66
77
import { pageDataSummary } from "$lib/stores/pageDataSummary.svelte";
8+
import { pageHeading } from "$lib/stores/pageHeading.svelte";
89
910
let { data, form } = $props();
1011
@@ -15,6 +16,7 @@
1516
if (consumer) {
1617
const status = consumer.enabled ? "enabled" : "disabled";
1718
pageDataSummary.set(`Viewing consumer ${consumer.app_name || consumer.consumer_id} (${status}), ${scopes.length} scopes`);
19+
pageHeading.set(consumer.app_name || consumer.consumer_id);
1820
}
1921
});
2022
let availableRoles = $derived(data.availableRoles || []);

src/routes/(protected)/customers/[bank_id]/[customer_id]/+page.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
}
3737
3838
import { pageDataSummary } from "$lib/stores/pageDataSummary.svelte";
39+
import { pageHeading } from "$lib/stores/pageHeading.svelte";
3940
4041
let customer = $state<CustomerDetail | null>(null);
4142
let loading = $state(false);
@@ -46,6 +47,7 @@
4647
const kyc = customer.kyc_status ? "KYC complete" : "KYC incomplete";
4748
const attrs = customer.customer_attributes?.length || 0;
4849
pageDataSummary.set(`Viewing customer ${customer.legal_name} at ${customer.bank_id}, ${kyc}, ${attrs} attributes`);
50+
pageHeading.set(customer.legal_name);
4951
}
5052
});
5153

0 commit comments

Comments
 (0)