Workflow: Adding a New Page to Navigation
When you add new functionality (a new page/route) to the application, you must also register it in the Route Registry so it appears in the dynamic navigation menu.
Steps
- Identify the Route: Determine the
pathof your new page (e.g.,/admin/my-new-feature). - Define Metadata:
- Subsystem: Which major area does it belong to? (General, Authentication, Communications, User Management, Administration, Property Management, Financial Management, Development).
- Module: A logical grouping within the subsystem (e.g., "Blog Management").
- Function: A unique identifier for this capability (e.g.,
blog_creation). EXISTING functions inroles.seed.jsonare preferred, or add a new one if distinct permission is needed. - Roles: Which roles need access? For prototyping, include
sysadminandgod.
-
Update
route-registry.ts:- Open
apps/platform/src/lib/rbac/route-registry.ts. - Locate the
initializeDefaultRoutesmethod. - Add a new
RouteMetadataobject to thedefaultRoutesarray.
{ path: '/your/new/route', subsystem: 'Your Subsystem', module: 'Your Module', function: 'your_function_id', order: 100, // Adjust order as needed requiredRoles: ['admin', 'sysadmin', 'god', 'owner'], // Add relevant roles requiredPermissions: [], // Add specific permissions if needed i18n: { enabled: true, supportedLanguages: ['en', 'es'], fallbackLanguage: 'en' } }, - Open
-
Verify:
- Save the file.
- Reload the application.
- Ensure the new item appears in the sidebar menu under the correct section.