|
| 1 | +// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. |
| 2 | + |
| 3 | +import { defineApp } from '@objectstack/spec/ui'; |
| 4 | + |
| 5 | +/** |
| 6 | + * Modern CRM App using the new Interface-driven navigation pattern |
| 7 | + * |
| 8 | + * Demonstrates: |
| 9 | + * - App.interfaces[] for main navigation (auto-generates Interface→Pages sidebar) |
| 10 | + * - App.defaultInterface for startup interface |
| 11 | + * - App.navigation[] repurposed for global utility entries only (Settings, Help) |
| 12 | + */ |
| 13 | +export const CrmAppModern = defineApp({ |
| 14 | + name: 'crm_modern', |
| 15 | + label: 'CRM (Modern)', |
| 16 | + description: 'Enterprise CRM with Interface-driven navigation', |
| 17 | + icon: 'briefcase', |
| 18 | + |
| 19 | + branding: { |
| 20 | + primaryColor: '#4169E1', |
| 21 | + logo: '/assets/crm-logo.png', |
| 22 | + favicon: '/assets/crm-favicon.ico', |
| 23 | + }, |
| 24 | + |
| 25 | + // NEW: Interface-driven navigation |
| 26 | + // The sidebar will auto-render a two-level menu: |
| 27 | + // - Sales Cloud (group) |
| 28 | + // - Sales Workspace (interface) → Pipeline, Accounts, Leads (pages) |
| 29 | + // - Lead Review (interface) → Review Queue, Qualified Leads (pages) |
| 30 | + // - Analytics (group) |
| 31 | + // - Sales Analytics (interface) → Overview, Pipeline Report (pages) |
| 32 | + interfaces: ['sales_workspace', 'lead_review', 'sales_analytics'], |
| 33 | + |
| 34 | + // NEW: Default interface on app launch |
| 35 | + defaultInterface: 'sales_workspace', |
| 36 | + |
| 37 | + // REPURPOSED: navigation[] is now for global utility entries only |
| 38 | + // These render at the bottom of the sidebar |
| 39 | + navigation: [ |
| 40 | + { |
| 41 | + id: 'nav_settings', |
| 42 | + type: 'page', |
| 43 | + label: 'Settings', |
| 44 | + icon: 'settings', |
| 45 | + pageName: 'admin_settings', |
| 46 | + }, |
| 47 | + { |
| 48 | + id: 'nav_help', |
| 49 | + type: 'url', |
| 50 | + label: 'Help Center', |
| 51 | + icon: 'help-circle', |
| 52 | + url: 'https://help.example.com', |
| 53 | + target: '_blank', |
| 54 | + }, |
| 55 | + ], |
| 56 | + |
| 57 | + requiredPermissions: ['app.access.crm'], |
| 58 | + isDefault: true, |
| 59 | +}); |
0 commit comments