From 5140d123321027eedbe9ccf96b886b106929b5b1 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Date: Thu, 19 Mar 2026 21:11:59 +0100 Subject: [PATCH] feat(builder-parity): enrich inspector summary and internal dashboard list columns --- .../internal-dashboard-management/index.tsx | 6 +- src/routes/admin/role-ui-configs/index.tsx | 103 ++++++++++++++++-- 2 files changed, 97 insertions(+), 12 deletions(-) diff --git a/src/routes/admin/internal-dashboard-management/index.tsx b/src/routes/admin/internal-dashboard-management/index.tsx index 2de710c..e783339 100644 --- a/src/routes/admin/internal-dashboard-management/index.tsx +++ b/src/routes/admin/internal-dashboard-management/index.tsx @@ -311,6 +311,7 @@ export default function InternalDashboardManagementPage() { Role + Role ID Dashboard Status Version @@ -319,15 +320,16 @@ export default function InternalDashboardManagementPage() { - Loading internal dashboards... + Loading internal dashboards... - No internal dashboards found. Create the first one. + No internal dashboards found. Create the first one. {(d) => ( {d.roleName || 'Not linked'} + {d.roleId || 'Not linked'} {d.title} {d.status} v{d.version} diff --git a/src/routes/admin/role-ui-configs/index.tsx b/src/routes/admin/role-ui-configs/index.tsx index 80dcba9..f24a397 100644 --- a/src/routes/admin/role-ui-configs/index.tsx +++ b/src/routes/admin/role-ui-configs/index.tsx @@ -10,10 +10,15 @@ type ExternalRole = { roleKey: string; displayName: string; vertical: string; + roleCategory: string; onboardingSchemaId: string; + runtimeConfigVersion: number; enabledModules: string[]; permissions: Record; featureLimits: Record; + requiresOnboardingApproval: boolean; + requiresLeadApproval: boolean; + requiresJobApproval: boolean; isActive: boolean; }; @@ -24,10 +29,15 @@ function parseRole(item: any): ExternalRole { roleKey: String(cfg.roleKey || item.key || item.role_key || ''), displayName: String(cfg.displayName || item.name || ''), vertical: String(cfg.vertical || ''), + roleCategory: String(cfg.roleCategory || ''), onboardingSchemaId: String(cfg.onboardingSchemaId || ''), + runtimeConfigVersion: Number(cfg.version || cfg.runtimeConfigVersion || 1), enabledModules: Array.isArray(cfg.enabledModules) ? cfg.enabledModules : [], permissions: (cfg.permissions && typeof cfg.permissions === 'object') ? cfg.permissions : {}, featureLimits: (cfg.featureLimits && typeof cfg.featureLimits === 'object') ? cfg.featureLimits : {}, + requiresOnboardingApproval: cfg.requiresOnboardingApproval ?? false, + requiresLeadApproval: cfg.requiresLeadApproval ?? false, + requiresJobApproval: cfg.requiresJobApproval ?? false, isActive: item.is_active !== false, }; } @@ -52,6 +62,17 @@ export default function RoleUiConfigsViewPage() { const roleKey = createMemo(() => searchParams.roleKey || ''); const [rows] = createResource(loadRoles); const [selected] = createResource(roleKey, async (key) => (key ? loadRoleByKey(key) : null)); + const permissionActions = ['read', 'create', 'update', 'delete', 'approve']; + + const approvalFlags = createMemo(() => { + const value = selected(); + if (!value) return [] as string[]; + const flags: string[] = []; + if (value.requiresOnboardingApproval) flags.push('Onboarding Approval'); + if (value.requiresLeadApproval) flags.push('Lead Approval'); + if (value.requiresJobApproval) flags.push('Job Approval'); + return flags; + }); return ( @@ -125,16 +146,78 @@ export default function RoleUiConfigsViewPage() {

Select an external role to view its current dashboard configuration.

-
-
-

Role Key

{selected()!.roleKey}

-

Display Name

{selected()!.displayName}

-

Vertical

{selected()!.vertical || '—'}

-

Schema

{selected()!.onboardingSchemaId || '—'}

-

Enabled Modules

{selected()!.enabledModules.join(', ') || '—'}

-
-

Published Runtime Config

-
{JSON.stringify(selected(), null, 2)}
+
+
+
+

Role Key

{selected()!.roleKey}

+

Display Name

{selected()!.displayName}

+

Vertical

{selected()!.vertical || '—'}

+
+

Status

+

+ {selected()!.isActive ? 'Active' : 'Inactive'} +

+
+

Role Category

{selected()!.roleCategory || '—'}

+

Onboarding Schema

{selected()!.onboardingSchemaId || '—'}

+

Runtime Config Version

{selected()!.runtimeConfigVersion}

+
+

Approval Flags

+

+ 0} fallback={'None'}> + + {approvalFlags().map((flag) => {flag})} + + +

+
+
+
+ +
+

Enabled Modules

+ 0} fallback={

No modules configured.

}> +
+ {selected()!.enabledModules.map((moduleKey) => {moduleKey})} +
+
+
+ +
+

Permission Matrix

+
+ + + + + {permissionActions.map((action) => )} + + + + {selected()!.enabledModules.map((moduleKey) => ( + + + {permissionActions.map((action) => ( + + ))} + + ))} + +
Module{action}
{moduleKey} + +
+
+
+ +
+

Feature Limits

+
{JSON.stringify(selected()!.featureLimits || {}, null, 2)}
+
+ +
+

Published Runtime Config

+
{JSON.stringify(selected(), null, 2)}
+