|
4 | 4 | */ |
5 | 5 |
|
6 | 6 | const routeDescriptions: Array<{ pattern: RegExp; description: string }> = [ |
7 | | - { pattern: /^\/banks\/create$/, description: "Create Bank page" }, |
8 | | - { pattern: /^\/banks\/([^/]+)\/([^/]+)/, description: "Bank detail page" }, |
9 | | - { pattern: /^\/banks$/, description: "Banks list page" }, |
10 | | - { pattern: /^\/users$/, description: "Users list page" }, |
11 | | - { pattern: /^\/consumers$/, description: "API Consumers list page" }, |
12 | | - { pattern: /^\/aggregate-metrics/, description: "Aggregate Metrics page" }, |
13 | | - { pattern: /^\/connector-metrics/, description: "Connector Metrics page" }, |
14 | | - { pattern: /^\/connector-traces/, description: "Connector Traces page" }, |
15 | | - { pattern: /^\/connector-counts/, description: "Connector Counts page" }, |
16 | | - { pattern: /^\/metrics/, description: "API Metrics page" }, |
17 | | - { pattern: /^\/rbac\/entitlements\/create/, description: "Create Entitlement page" }, |
18 | | - { pattern: /^\/rbac\/entitlements/, description: "Entitlements page" }, |
19 | | - { pattern: /^\/rbac\/roles/, description: "Roles page" }, |
20 | | - { pattern: /^\/rbac\/groups/, description: "Groups page" }, |
21 | | - { pattern: /^\/rbac\/memberships/, description: "Memberships page" }, |
22 | | - { pattern: /^\/rbac\/entitlement-requests/, description: "Entitlement Requests page" }, |
23 | | - { pattern: /^\/rbac\/banks/, description: "RBAC Banks page" }, |
24 | | - { pattern: /^\/system\/cache/, description: "System Cache page" }, |
25 | | - { pattern: /^\/system\/config-props/, description: "System Config Props page" }, |
26 | | - { pattern: /^\/system\/database-pool/, description: "Database Pool page" }, |
27 | | - { pattern: /^\/system\/migrations/, description: "System Migrations page" }, |
28 | | - { pattern: /^\/system\/webui-props/, description: "WebUI Props page" }, |
29 | | - { pattern: /^\/system\/signal/, description: "Signals page" }, |
30 | | - { pattern: /^\/system\//, description: "System settings page" }, |
31 | | - { pattern: /^\/products\/financial/, description: "Financial Products page" }, |
32 | | - { pattern: /^\/products\/collections/, description: "Product Collections page" }, |
33 | | - { pattern: /^\/products\/bootstrap/, description: "Products Bootstrap page" }, |
34 | | - { pattern: /^\/products/, description: "API Products page" }, |
35 | | - { pattern: /^\/dynamic-entities\/diagnostics/, description: "Dynamic Entities Diagnostics page" }, |
36 | | - { pattern: /^\/dynamic-entities\/personal/, description: "Personal Dynamic Entities page" }, |
37 | | - { pattern: /^\/dynamic-entities/, description: "Dynamic Entities page" }, |
38 | | - { pattern: /^\/dynamic-endpoints/, description: "Dynamic Endpoints page" }, |
39 | | - { pattern: /^\/customers\/individual/, description: "Individual Customers page" }, |
40 | | - { pattern: /^\/customers\/corporate/, description: "Corporate Customers page" }, |
41 | | - { pattern: /^\/customers/, description: "Customers page" }, |
42 | | - { pattern: /^\/account-access\/system-views/, description: "System Views page" }, |
43 | | - { pattern: /^\/account-access\/custom-views/, description: "Custom Views page" }, |
44 | | - { pattern: /^\/account-access\/account-directory/, description: "Account Directory page" }, |
45 | | - { pattern: /^\/account-access\/accounts/, description: "My Accounts page" }, |
46 | | - { pattern: /^\/account-access/, description: "Account Access page" }, |
47 | | - { pattern: /^\/user\/consents/, description: "My Consents page" }, |
48 | | - { pattern: /^\/user\/entitlements/, description: "My Entitlements page" }, |
49 | | - { pattern: /^\/user$/, description: "My Profile page" }, |
50 | | - { pattern: /^\/abac/, description: "ABAC Rules page" }, |
51 | | - { pattern: /^\/integration/, description: "Integration / Method Routings page" }, |
52 | | - { pattern: /^\/api-collections/, description: "API Collections page" }, |
53 | | - { pattern: /^\/site-map$/, description: "Site Map page" }, |
54 | | - { pattern: /^\/about$/, description: "About page" }, |
| 7 | + { pattern: /^\/banks\/create$/, description: "Create Bank" }, |
| 8 | + { pattern: /^\/banks\/([^/]+)\/([^/]+)/, description: "Bank detail" }, |
| 9 | + { pattern: /^\/banks$/, description: "Banks list" }, |
| 10 | + { pattern: /^\/users$/, description: "Users list" }, |
| 11 | + { pattern: /^\/consumers$/, description: "API Consumers list" }, |
| 12 | + { pattern: /^\/aggregate-metrics/, description: "Aggregate Metrics" }, |
| 13 | + { pattern: /^\/connector-metrics/, description: "Connector Metrics" }, |
| 14 | + { pattern: /^\/connector-traces/, description: "Connector Traces" }, |
| 15 | + { pattern: /^\/connector-counts/, description: "Connector Counts" }, |
| 16 | + { pattern: /^\/metrics/, description: "API Metrics" }, |
| 17 | + { pattern: /^\/rbac\/entitlements\/create/, description: "Create Entitlement" }, |
| 18 | + { pattern: /^\/rbac\/entitlements/, description: "Entitlements" }, |
| 19 | + { pattern: /^\/rbac\/roles/, description: "Roles" }, |
| 20 | + { pattern: /^\/rbac\/groups/, description: "Groups" }, |
| 21 | + { pattern: /^\/rbac\/memberships/, description: "Memberships" }, |
| 22 | + { pattern: /^\/rbac\/entitlement-requests/, description: "Entitlement Requests" }, |
| 23 | + { pattern: /^\/rbac\/banks/, description: "RBAC Banks" }, |
| 24 | + { pattern: /^\/system\/cache/, description: "System Cache" }, |
| 25 | + { pattern: /^\/system\/config-props/, description: "System Config Props" }, |
| 26 | + { pattern: /^\/system\/database-pool/, description: "Database Pool" }, |
| 27 | + { pattern: /^\/system\/migrations/, description: "System Migrations" }, |
| 28 | + { pattern: /^\/system\/webui-props/, description: "WebUI Props" }, |
| 29 | + { pattern: /^\/system\/signal/, description: "Signals" }, |
| 30 | + { pattern: /^\/system\//, description: "System settings" }, |
| 31 | + { pattern: /^\/products\/financial/, description: "Financial Products" }, |
| 32 | + { pattern: /^\/products\/collections/, description: "Product Collections" }, |
| 33 | + { pattern: /^\/products\/bootstrap/, description: "Products Bootstrap" }, |
| 34 | + { pattern: /^\/products/, description: "API Products" }, |
| 35 | + { pattern: /^\/dynamic-entities\/diagnostics/, description: "Dynamic Entities Diagnostics" }, |
| 36 | + { pattern: /^\/dynamic-entities\/personal/, description: "Personal Dynamic Entities" }, |
| 37 | + { pattern: /^\/dynamic-entities/, description: "Dynamic Entities" }, |
| 38 | + { pattern: /^\/dynamic-endpoints/, description: "Dynamic Endpoints" }, |
| 39 | + { pattern: /^\/customers\/individual/, description: "Individual Customers" }, |
| 40 | + { pattern: /^\/customers\/corporate/, description: "Corporate Customers" }, |
| 41 | + { pattern: /^\/customers/, description: "Customers" }, |
| 42 | + { pattern: /^\/account-access\/system-views/, description: "System Views" }, |
| 43 | + { pattern: /^\/account-access\/custom-views/, description: "Custom Views" }, |
| 44 | + { pattern: /^\/account-access\/account-directory/, description: "Account Directory" }, |
| 45 | + { pattern: /^\/account-access\/accounts/, description: "My Accounts" }, |
| 46 | + { pattern: /^\/account-access/, description: "Account Access" }, |
| 47 | + { pattern: /^\/user\/consents/, description: "My Consents" }, |
| 48 | + { pattern: /^\/user\/entitlements/, description: "My Entitlements" }, |
| 49 | + { pattern: /^\/user$/, description: "My Profile" }, |
| 50 | + { pattern: /^\/abac/, description: "ABAC Rules" }, |
| 51 | + { pattern: /^\/integration/, description: "Integration / Method Routings" }, |
| 52 | + { pattern: /^\/api-collections/, description: "API Collections" }, |
| 53 | + { pattern: /^\/site-map$/, description: "Site Map" }, |
| 54 | + { pattern: /^\/about$/, description: "About" }, |
55 | 55 | ]; |
56 | 56 |
|
57 | 57 | /** |
58 | 58 | * Get a human-readable description of the current page for Opey context. |
59 | 59 | */ |
60 | 60 | export function describeRoute(pathname: string): string { |
61 | 61 | const match = routeDescriptions.find((r) => r.pattern.test(pathname)); |
62 | | - return match ? match.description : `Page: ${pathname}`; |
| 62 | + return match ? match.description : pathname; |
63 | 63 | } |
0 commit comments