@bluealba/platform-cli 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +278 -15
- package/docs/404.mdx +5 -0
- package/docs/architecture/api-explorer.mdx +478 -0
- package/docs/architecture/architecture-diagrams.mdx +12 -0
- package/docs/architecture/authentication-system.mdx +903 -0
- package/docs/architecture/authorization-system.mdx +886 -0
- package/docs/architecture/bootstrap.mdx +1442 -0
- package/docs/architecture/gateway-architecture.mdx +845 -0
- package/docs/architecture/multi-tenancy.mdx +1150 -0
- package/docs/architecture/overview.mdx +776 -0
- package/docs/architecture/scheduler.mdx +818 -0
- package/docs/architecture/shell.mdx +885 -0
- package/docs/architecture/ui-extension-points.mdx +781 -0
- package/docs/architecture/user-states.mdx +794 -0
- package/docs/development/overview.mdx +21 -0
- package/docs/development/workflow.mdx +914 -0
- package/docs/getting-started/core-concepts.mdx +892 -0
- package/docs/getting-started/installation.mdx +780 -0
- package/docs/getting-started/overview.mdx +83 -0
- package/docs/getting-started/quick-start.mdx +940 -0
- package/docs/guides/adding-documentation-sites.mdx +1367 -0
- package/docs/guides/creating-services.mdx +1736 -0
- package/docs/guides/creating-ui-modules.mdx +1860 -0
- package/docs/guides/identity-providers.mdx +1007 -0
- package/docs/guides/mermaid-diagrams.mdx +212 -0
- package/docs/guides/using-feature-flags.mdx +1059 -0
- package/docs/guides/working-with-rooms.mdx +566 -0
- package/docs/index.mdx +57 -0
- package/docs/platform-cli/commands.mdx +604 -0
- package/docs/platform-cli/overview.mdx +195 -0
- package/package.json +5 -2
- package/skills/ba-platform/platform-cli.skill.md +26 -0
- package/skills/ba-platform/platform.skill.md +35 -0
- package/templates/application-monorepo-template/gitignore +95 -0
- package/templates/bootstrap-service-template/Dockerfile.development +1 -1
- package/templates/bootstrap-service-template/gitignore +57 -0
- package/templates/bootstrap-service-template/package.json +1 -1
- package/templates/bootstrap-service-template/src/main.ts +6 -16
- package/templates/customization-ui-module-template/Dockerfile.development +1 -1
- package/templates/customization-ui-module-template/gitignore +73 -0
- package/templates/nestjs-service-module-template/Dockerfile.development +1 -1
- package/templates/nestjs-service-module-template/gitignore +56 -0
- package/templates/platform-init-template/{{platformName}}-core/gitignore +97 -0
- package/templates/platform-init-template/{{platformName}}-core/local/.env.example +1 -1
- package/templates/platform-init-template/{{platformName}}-core/local/platform-docker-compose.yml +1 -1
- package/templates/platform-init-template/{{platformName}}-core/local/{{platformName}}-core-docker-compose.yml +0 -1
- package/templates/react-ui-module-template/Dockerfile +1 -1
- package/templates/react-ui-module-template/Dockerfile.development +1 -3
- package/templates/react-ui-module-template/caddy/Caddyfile +1 -1
- package/templates/react-ui-module-template/gitignore +72 -0
- package/templates/react-ui-module-template/Dockerfile_nginx +0 -11
- package/templates/react-ui-module-template/nginx/default.conf +0 -23
|
@@ -0,0 +1,885 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Platform Shell
|
|
3
|
+
description: The PAE Shell UI - the main platform layout, navigation, and micro-frontend orchestration system
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Card, CardGrid, Aside, Tabs, TabItem } from '@astrojs/starlight/components';
|
|
7
|
+
|
|
8
|
+
The **Platform Shell** (`@bluealba/pae-shell-ui`) is the foundational micro-frontend that provides the core UI structure and layout for the Blue Alba Platform. It orchestrates all other micro-frontends, manages navigation, and provides the consistent user experience across all applications.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The Shell serves as the container and orchestrator for the entire platform UI:
|
|
13
|
+
|
|
14
|
+
<CardGrid stagger>
|
|
15
|
+
<Card title="Micro-frontend Orchestration" icon="puzzle">
|
|
16
|
+
Dynamically loads and mounts application UIs using single-spa
|
|
17
|
+
</Card>
|
|
18
|
+
|
|
19
|
+
<Card title="Navigation & Layout" icon="random">
|
|
20
|
+
Provides navbar, application selector, menu, and content areas
|
|
21
|
+
</Card>
|
|
22
|
+
|
|
23
|
+
<Card title="Authentication State" icon="approve-check">
|
|
24
|
+
Manages user session and authentication status
|
|
25
|
+
</Card>
|
|
26
|
+
|
|
27
|
+
<Card title="Tenant Management" icon="seti:folder">
|
|
28
|
+
Handles tenant selection and context switching
|
|
29
|
+
</Card>
|
|
30
|
+
|
|
31
|
+
<Card title="Customizable Design" icon="setting">
|
|
32
|
+
Supports extensive customization via props, CSS, and extension points
|
|
33
|
+
</Card>
|
|
34
|
+
|
|
35
|
+
<Card title="Responsive Layout" icon="seti:html">
|
|
36
|
+
Mobile and desktop friendly with collapsible menus
|
|
37
|
+
</Card>
|
|
38
|
+
</CardGrid>
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Layout & Components
|
|
43
|
+
|
|
44
|
+
The Shell provides a comprehensive layout with several key elements:
|
|
45
|
+
|
|
46
|
+
### Main Layout Structure
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
┌───────────────────────────────────────────────────────────────┐
|
|
50
|
+
│ Platform Shell │
|
|
51
|
+
│ │
|
|
52
|
+
│ ┌────┐ ┌─────────────────────────────────────────────────┐ │
|
|
53
|
+
│ │ │ │ │ │
|
|
54
|
+
│ │ │ │ Application Content Area │ │
|
|
55
|
+
│ │ N │ │ │ │
|
|
56
|
+
│ │ a │ │ (Micro-frontends mount here) │ │
|
|
57
|
+
│ │ v │ │ │ │
|
|
58
|
+
│ │ b │ │ #pae-shell-ui-content │ │
|
|
59
|
+
│ │ a │ │ │ │
|
|
60
|
+
│ │ r │ │ │ │
|
|
61
|
+
│ │ │ │ │ │
|
|
62
|
+
│ │ │ │ │ │
|
|
63
|
+
│ └────┘ └─────────────────────────────────────────────────┘ │
|
|
64
|
+
│ │
|
|
65
|
+
└───────────────────────────────────────────────────────────────┘
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Key Components
|
|
69
|
+
|
|
70
|
+
<Tabs>
|
|
71
|
+
<TabItem label="Splash Screen">
|
|
72
|
+
**Initial Loading Screen**
|
|
73
|
+
|
|
74
|
+
Displayed while the platform initializes:
|
|
75
|
+
- Platform logo
|
|
76
|
+
- Loading animation
|
|
77
|
+
- Customizable platform name
|
|
78
|
+
- Brand colors
|
|
79
|
+
|
|
80
|
+
**Customization**:
|
|
81
|
+
- Can be replaced via Extension Point: `SplashScreen`
|
|
82
|
+
- Logo can be customized via `SplashLogo` extension point
|
|
83
|
+
- Platform name set via `platformName` custom prop
|
|
84
|
+
</TabItem>
|
|
85
|
+
|
|
86
|
+
<TabItem label="Navbar">
|
|
87
|
+
**Main Navigation Bar**
|
|
88
|
+
|
|
89
|
+
Located on the left side, contains:
|
|
90
|
+
- **Platform Logo**: Branding and home navigation
|
|
91
|
+
- **Application Selector**: Switch between applications
|
|
92
|
+
- **Application Menu**: Current app's navigation menu
|
|
93
|
+
- **Tools Section**: Dynamically generated from modules with type `tool` (e.g., Admin UI, Documentation). Also includes theme selector, user avatar, and tenant selector.
|
|
94
|
+
- **User Section**: Profile, logout, impersonation
|
|
95
|
+
|
|
96
|
+
**States**:
|
|
97
|
+
- Expanded (default)
|
|
98
|
+
- Collapsed (icons only)
|
|
99
|
+
- Hidden (full-screen content)
|
|
100
|
+
</TabItem>
|
|
101
|
+
|
|
102
|
+
<TabItem label="Application Selector">
|
|
103
|
+
**Application Switcher**
|
|
104
|
+
|
|
105
|
+
Displays available applications:
|
|
106
|
+
- Application icons
|
|
107
|
+
- Visual indication of current app
|
|
108
|
+
- Quick switching between apps
|
|
109
|
+
- Respects user permissions
|
|
110
|
+
|
|
111
|
+
**Customization**:
|
|
112
|
+
- Replaceable via `ApplicationSelector` extension point
|
|
113
|
+
- Icon order configurable via custom props
|
|
114
|
+
- Custom icons per application
|
|
115
|
+
</TabItem>
|
|
116
|
+
|
|
117
|
+
<TabItem label="Application Menu">
|
|
118
|
+
**Current Application Menu**
|
|
119
|
+
|
|
120
|
+
Shows navigation for the active application:
|
|
121
|
+
- Hierarchical menu structure
|
|
122
|
+
- Icons for menu items
|
|
123
|
+
- Active route highlighting
|
|
124
|
+
- Operation-based visibility
|
|
125
|
+
|
|
126
|
+
**Types**:
|
|
127
|
+
- Inline (default): Menu beside content
|
|
128
|
+
- Floating: Menu overlays content
|
|
129
|
+
- Collapsible: Can be hidden/shown
|
|
130
|
+
</TabItem>
|
|
131
|
+
|
|
132
|
+
<TabItem label="User Section">
|
|
133
|
+
**Logged-in User Controls**
|
|
134
|
+
|
|
135
|
+
Bottom of navbar:
|
|
136
|
+
- User avatar/icon
|
|
137
|
+
- User name and email
|
|
138
|
+
- Logout button
|
|
139
|
+
- Impersonation controls (for admins)
|
|
140
|
+
- Profile settings
|
|
141
|
+
|
|
142
|
+
**Features**:
|
|
143
|
+
- User impersonation for support/debugging
|
|
144
|
+
- Recent impersonations list
|
|
145
|
+
- Tenant switching (multi-tenant users)
|
|
146
|
+
</TabItem>
|
|
147
|
+
</Tabs>
|
|
148
|
+
|
|
149
|
+
### Versions Dialog
|
|
150
|
+
|
|
151
|
+
Access comprehensive platform version information:
|
|
152
|
+
|
|
153
|
+
**Keyboard Shortcut**: `Ctrl+Opt+Shift+I` (Mac) or `Ctrl+Alt+Shift+I` (Windows/Linux)
|
|
154
|
+
|
|
155
|
+
**Displays**:
|
|
156
|
+
- Platform Shell version
|
|
157
|
+
- All registered modules and versions
|
|
158
|
+
- Current application modules
|
|
159
|
+
- Build information
|
|
160
|
+
- Environment details
|
|
161
|
+
|
|
162
|
+
<Aside type="tip">
|
|
163
|
+
The versions dialog is useful for support and debugging to quickly identify which versions are deployed.
|
|
164
|
+
</Aside>
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Customization Methods
|
|
169
|
+
|
|
170
|
+
The Shell can be customized in three primary ways:
|
|
171
|
+
|
|
172
|
+
### 1. Custom Props (Configuration)
|
|
173
|
+
|
|
174
|
+
The most straightforward customization method using JSON configuration in the bootstrap:
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"name": "@bluealba/pae-shell-ui",
|
|
179
|
+
"config": {
|
|
180
|
+
"platformName": "My Company Platform",
|
|
181
|
+
"isMenuCollapsible": true,
|
|
182
|
+
"isMenuFloating": false,
|
|
183
|
+
"canToggleNavbarState": true,
|
|
184
|
+
"showOpenMenuButton": false,
|
|
185
|
+
"shouldNavigateToLastActiveRoute": true,
|
|
186
|
+
"cssCustomizationLoadingDelay": 1000,
|
|
187
|
+
"maxRecentImpersonations": 5,
|
|
188
|
+
"showAllApplicationsInVersionDialog": false,
|
|
189
|
+
"navbar": {
|
|
190
|
+
"menus": {
|
|
191
|
+
"applications": [
|
|
192
|
+
{
|
|
193
|
+
"type": "app",
|
|
194
|
+
"name": "crm",
|
|
195
|
+
"iconUrl": "/assets/crm-icon.svg"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"tools": [
|
|
199
|
+
{
|
|
200
|
+
"type": "extension-point",
|
|
201
|
+
"name": "toggle-theme"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Available Props**:
|
|
211
|
+
|
|
212
|
+
<Tabs>
|
|
213
|
+
<TabItem label="Branding">
|
|
214
|
+
```typescript
|
|
215
|
+
{
|
|
216
|
+
// Platform name shown in splash screen and UI
|
|
217
|
+
platformName: string;
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
</TabItem>
|
|
221
|
+
|
|
222
|
+
<TabItem label="Menu Behavior">
|
|
223
|
+
```typescript
|
|
224
|
+
{
|
|
225
|
+
// Allow menu to collapse to icons only
|
|
226
|
+
isMenuCollapsible: boolean;
|
|
227
|
+
|
|
228
|
+
// Menu floats over content vs inline
|
|
229
|
+
isMenuFloating: boolean;
|
|
230
|
+
|
|
231
|
+
// Show button to open/close menu
|
|
232
|
+
showOpenMenuButton: boolean;
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
</TabItem>
|
|
236
|
+
|
|
237
|
+
<TabItem label="Navbar Control">
|
|
238
|
+
```typescript
|
|
239
|
+
{
|
|
240
|
+
// Allow navbar to be expanded/collapsed/hidden
|
|
241
|
+
canToggleNavbarState: boolean;
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
</TabItem>
|
|
245
|
+
|
|
246
|
+
<TabItem label="Navigation">
|
|
247
|
+
```typescript
|
|
248
|
+
{
|
|
249
|
+
// Remember last accessed route and auto-navigate
|
|
250
|
+
shouldNavigateToLastActiveRoute: boolean;
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
</TabItem>
|
|
254
|
+
|
|
255
|
+
<TabItem label="Advanced">
|
|
256
|
+
```typescript
|
|
257
|
+
{
|
|
258
|
+
// Delay before loading CSS customizations
|
|
259
|
+
cssCustomizationLoadingDelay: number;
|
|
260
|
+
|
|
261
|
+
// Number of recent impersonations to remember
|
|
262
|
+
maxRecentImpersonations: number;
|
|
263
|
+
|
|
264
|
+
// Show all apps or just current app in versions dialog
|
|
265
|
+
showAllApplicationsInVersionDialog: boolean;
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
</TabItem>
|
|
269
|
+
</Tabs>
|
|
270
|
+
|
|
271
|
+
### 2. CSS Customization
|
|
272
|
+
|
|
273
|
+
Override platform styles using CSS variables and custom stylesheets:
|
|
274
|
+
|
|
275
|
+
**Platform CSS Variables**:
|
|
276
|
+
|
|
277
|
+
The Shell defines global CSS variables for consistent theming:
|
|
278
|
+
|
|
279
|
+
```css
|
|
280
|
+
:root {
|
|
281
|
+
/* Primary Color (RGB components) */
|
|
282
|
+
--platform-color-primary-red: 64;
|
|
283
|
+
--platform-color-primary-green: 57;
|
|
284
|
+
--platform-color-primary-blue: 22;
|
|
285
|
+
|
|
286
|
+
/* Secondary Color */
|
|
287
|
+
--platform-color-secondary: #ED8525;
|
|
288
|
+
|
|
289
|
+
/* Layout Colors */
|
|
290
|
+
--platform-color-white: #fff;
|
|
291
|
+
--platform-color-dark: #101828;
|
|
292
|
+
--platform-background-primary-color: #fff;
|
|
293
|
+
--platform-background-secondary-color: #f9fafb;
|
|
294
|
+
--platform-lines: #e4e7ec;
|
|
295
|
+
|
|
296
|
+
/* Text */
|
|
297
|
+
--platform-text-primary-color: #565656;
|
|
298
|
+
--platform-text-secondary-color: #818181;
|
|
299
|
+
--platform-text-base-font-family: Poppins, sans-serif;
|
|
300
|
+
--platform-text-base-font-size: 12px;
|
|
301
|
+
|
|
302
|
+
/* And many more... */
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Custom CSS File**:
|
|
307
|
+
|
|
308
|
+
Create a customization micro-frontend that loads after the shell:
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
// In your customization UI module
|
|
312
|
+
import './custom-platform-styles.css';
|
|
313
|
+
|
|
314
|
+
// custom-platform-styles.css
|
|
315
|
+
:root {
|
|
316
|
+
--platform-color-primary-red: 0;
|
|
317
|
+
--platform-color-primary-green: 102;
|
|
318
|
+
--platform-color-primary-blue: 204;
|
|
319
|
+
--platform-color-secondary: #FF6600;
|
|
320
|
+
--platform-text-base-font-family: 'Open Sans', sans-serif;
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
**Configuration**:
|
|
325
|
+
|
|
326
|
+
Ensure that you configure the customization module as a special module with the “isPlatformCustomization” attribute.
|
|
327
|
+
|
|
328
|
+
```json
|
|
329
|
+
{
|
|
330
|
+
"name": "@org/shell-customization-ui",
|
|
331
|
+
"ui": {
|
|
332
|
+
"route": "/",
|
|
333
|
+
"bundleFile": "customizations-ui.js",
|
|
334
|
+
"isPlatformCustomization": true
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
<Aside type="tip" title="CSS Variable Explorer">
|
|
340
|
+
The PAE Sandbox product includes a CSS Variable Explorer that lets you visualize and experiment with all available CSS variables in real-time.
|
|
341
|
+
</Aside>
|
|
342
|
+
|
|
343
|
+
### 3. Extension Points
|
|
344
|
+
|
|
345
|
+
Replace entire components with your own React components:
|
|
346
|
+
|
|
347
|
+
**Available Extension Points**:
|
|
348
|
+
|
|
349
|
+
```typescript
|
|
350
|
+
const ExtensionPoints = {
|
|
351
|
+
// Top-level elements (global styles, etc.)
|
|
352
|
+
SHELL_TOP_ELEMENTS: "ShellTopElements",
|
|
353
|
+
|
|
354
|
+
// Splash screen
|
|
355
|
+
SPLASH_SCREEN: "SplashScreen",
|
|
356
|
+
SPLASH_LOGO: "SplashLogo",
|
|
357
|
+
|
|
358
|
+
// Navbar
|
|
359
|
+
NAVBAR_PORTAL_LOGO: "NavbarPortalLogo",
|
|
360
|
+
EXPANDED_NAVBAR_PORTAL_LOGO: "ExpandedNavbarPortalLogo",
|
|
361
|
+
NAVBAR_CONTENT: "NavbarContent",
|
|
362
|
+
NAVBAR_TOOLS: "NavbarTools",
|
|
363
|
+
NAVBAR_TOGGLE_STATE_BUTTON: "NavbarToggleStateButton",
|
|
364
|
+
|
|
365
|
+
// Application selector
|
|
366
|
+
APPLICATIONS_SELECTOR: "ApplicationSelector",
|
|
367
|
+
|
|
368
|
+
// Menu
|
|
369
|
+
CURRENT_APPLICATION_MENU: "CurrentApplicationMenu",
|
|
370
|
+
CURRENT_APPLICATION_MENU_CONTENT: "CurrentApplicationMenuContent",
|
|
371
|
+
OPEN_MENU_BUTTON: "OpenMenuButton",
|
|
372
|
+
CLOSE_MENU_BUTTON: "CloseMenuButton",
|
|
373
|
+
|
|
374
|
+
// User section
|
|
375
|
+
LOGGED_IN_USER_SECTION: "LoggedInUserSection",
|
|
376
|
+
LOGGED_IN_USER_AVATAR: "LoggedInUser",
|
|
377
|
+
|
|
378
|
+
// Admin
|
|
379
|
+
ADMIN_APPLICATION_ICON: "AdminApplication",
|
|
380
|
+
|
|
381
|
+
// Versions dialog
|
|
382
|
+
VERSIONS_LOGO: "VersionsLogo",
|
|
383
|
+
};
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**Usage Example**:
|
|
387
|
+
|
|
388
|
+
```typescript
|
|
389
|
+
import { ExtendExtensionPoint } from '@bluealba-public/pae-ui-react-core';
|
|
390
|
+
import MyCustomLogo from './MyCustomLogo';
|
|
391
|
+
|
|
392
|
+
function MyCustomizationUI() {
|
|
393
|
+
return (
|
|
394
|
+
<>
|
|
395
|
+
<ExtendExtensionPoint
|
|
396
|
+
module="@bluealba/pae-shell-ui"
|
|
397
|
+
point="NavbarPortalLogo"
|
|
398
|
+
>
|
|
399
|
+
<MyCustomLogo />
|
|
400
|
+
</ExtendExtensionPoint>
|
|
401
|
+
|
|
402
|
+
<ExtendExtensionPoint
|
|
403
|
+
module="@bluealba/pae-shell-ui"
|
|
404
|
+
point="SplashScreen"
|
|
405
|
+
>
|
|
406
|
+
<MyCustomSplashScreen />
|
|
407
|
+
</ExtendExtensionPoint>
|
|
408
|
+
</>
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
<Aside type="note">
|
|
414
|
+
See the [UI Extension Points](/architecture/ui-extension-points/) documentation for detailed information on the extension point mechanism.
|
|
415
|
+
</Aside>
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## Navbar Menu Configuration
|
|
420
|
+
|
|
421
|
+
The navbar can be extensively customized through the `navbar.menus` settings in the `shell` module:
|
|
422
|
+
|
|
423
|
+
### Applications Menu
|
|
424
|
+
|
|
425
|
+
Top section of the navbar showing available applications:
|
|
426
|
+
|
|
427
|
+
```json
|
|
428
|
+
{
|
|
429
|
+
"navbar": {
|
|
430
|
+
"menus": {
|
|
431
|
+
"applications": [
|
|
432
|
+
{
|
|
433
|
+
"type": "app",
|
|
434
|
+
"name": "crm",
|
|
435
|
+
"iconUrl": "/assets/crm-icon.svg"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"type": "app",
|
|
439
|
+
"name": "inventory"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"type": "link",
|
|
443
|
+
"caption": "Documentation",
|
|
444
|
+
"url": "https://docs.mycompany.com",
|
|
445
|
+
"target": "_blank",
|
|
446
|
+
"iconUrl": "/assets/docs-icon.svg"
|
|
447
|
+
}
|
|
448
|
+
]
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
**Menu Item Types**:
|
|
455
|
+
|
|
456
|
+
<Tabs>
|
|
457
|
+
<TabItem label="Application">
|
|
458
|
+
**Application Reference**
|
|
459
|
+
|
|
460
|
+
```typescript
|
|
461
|
+
{
|
|
462
|
+
type: "app";
|
|
463
|
+
name: string; // Application name from catalog
|
|
464
|
+
iconUrl?: string; // Optional custom icon URL
|
|
465
|
+
}
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Links to a registered platform application.
|
|
469
|
+
</TabItem>
|
|
470
|
+
|
|
471
|
+
<TabItem label="Link">
|
|
472
|
+
**External Link**
|
|
473
|
+
|
|
474
|
+
```typescript
|
|
475
|
+
{
|
|
476
|
+
type: "link";
|
|
477
|
+
caption: string; // Display text
|
|
478
|
+
url: string; // Destination URL
|
|
479
|
+
target?: "_self" | "_blank";
|
|
480
|
+
iconUrl?: string; // Optional icon URL
|
|
481
|
+
}
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
Opens an external URL (documentation, help center, etc.).
|
|
485
|
+
</TabItem>
|
|
486
|
+
|
|
487
|
+
<TabItem label="Extension Point">
|
|
488
|
+
**Dynamic Extension Point**
|
|
489
|
+
|
|
490
|
+
```typescript
|
|
491
|
+
{
|
|
492
|
+
type: "extension-point";
|
|
493
|
+
name: string; // Extension point identifier
|
|
494
|
+
}
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
Placeholder for dynamic content from other UIs (e.g., theme toggle button).
|
|
498
|
+
</TabItem>
|
|
499
|
+
</Tabs>
|
|
500
|
+
|
|
501
|
+
### Tools Menu
|
|
502
|
+
|
|
503
|
+
Bottom section of the navbar (above user section):
|
|
504
|
+
|
|
505
|
+
```json
|
|
506
|
+
{
|
|
507
|
+
"navbar": {
|
|
508
|
+
"menus": {
|
|
509
|
+
"tools": [
|
|
510
|
+
{
|
|
511
|
+
"type": "extension-point",
|
|
512
|
+
"name": "toggle-theme"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"type": "app",
|
|
516
|
+
"name": "platform-admin"
|
|
517
|
+
}
|
|
518
|
+
]
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
**Behavior**:
|
|
525
|
+
- If `applications` array has fewer items than available apps, remaining apps are automatically added at the end
|
|
526
|
+
- If an app referenced in config doesn't exist or user lacks access, it's silently skipped
|
|
527
|
+
- Extension points with no implementations are not rendered
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
## Menu Behaviors
|
|
532
|
+
|
|
533
|
+
### Collapsible Menu
|
|
534
|
+
|
|
535
|
+
Control whether the application menu can be collapsed:
|
|
536
|
+
|
|
537
|
+
```json
|
|
538
|
+
{
|
|
539
|
+
"isMenuCollapsible": true
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
**When true**:
|
|
544
|
+
- Menu can be collapsed to icon-only view
|
|
545
|
+
- Saves horizontal space
|
|
546
|
+
- Menu button allows expand/collapse
|
|
547
|
+
|
|
548
|
+
**When false** (default):
|
|
549
|
+
- Menu is always fully expanded
|
|
550
|
+
- No collapse functionality
|
|
551
|
+
|
|
552
|
+
### Floating Menu
|
|
553
|
+
|
|
554
|
+
Control whether the menu overlays content:
|
|
555
|
+
|
|
556
|
+
```json
|
|
557
|
+
{
|
|
558
|
+
"isMenuFloating": true
|
|
559
|
+
}
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
**When true**:
|
|
563
|
+
- Menu floats over application content
|
|
564
|
+
- Content uses full width
|
|
565
|
+
- Automatically makes menu collapsible
|
|
566
|
+
- Good for content-heavy applications
|
|
567
|
+
|
|
568
|
+
**When false** (default):
|
|
569
|
+
- Menu is inline with content
|
|
570
|
+
- Content area is narrower
|
|
571
|
+
- Traditional side-by-side layout
|
|
572
|
+
|
|
573
|
+
### Navbar Toggle
|
|
574
|
+
|
|
575
|
+
Allow users to expand/collapse/hide the entire navbar:
|
|
576
|
+
|
|
577
|
+
```json
|
|
578
|
+
{
|
|
579
|
+
"canToggleNavbarState": true
|
|
580
|
+
}
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
**When true**:
|
|
584
|
+
- Adds toggle buttons to control navbar visibility
|
|
585
|
+
- Users can completely hide navbar for full-screen content
|
|
586
|
+
- Three states: expanded, collapsed, hidden
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
## Application Menu Contract
|
|
591
|
+
|
|
592
|
+
Each application UI must export its menu structure for the Shell to render:
|
|
593
|
+
|
|
594
|
+
### Menu Export
|
|
595
|
+
|
|
596
|
+
```typescript
|
|
597
|
+
// In your application's main.tsx
|
|
598
|
+
export { default as icon } from './Icon';
|
|
599
|
+
export { default as menu } from './menu';
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
### Icon Component
|
|
603
|
+
|
|
604
|
+
```typescript
|
|
605
|
+
// Icon.tsx
|
|
606
|
+
const AppIcon = () => (
|
|
607
|
+
<svg width="24" height="24" viewBox="0 0 24 24">
|
|
608
|
+
{/* Your app icon SVG */}
|
|
609
|
+
</svg>
|
|
610
|
+
);
|
|
611
|
+
|
|
612
|
+
export default AppIcon;
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
### Menu Structure
|
|
616
|
+
|
|
617
|
+
```typescript
|
|
618
|
+
// menu.ts
|
|
619
|
+
import { ApplicationMenu } from '@bluealba-public/pae-ui-react-core';
|
|
620
|
+
|
|
621
|
+
const menu: ApplicationMenu = [
|
|
622
|
+
{
|
|
623
|
+
label: 'Main Section',
|
|
624
|
+
items: [
|
|
625
|
+
{
|
|
626
|
+
label: 'Dashboard',
|
|
627
|
+
path: '/dashboard',
|
|
628
|
+
Icon: <DashboardIcon />,
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
label: 'Customers',
|
|
632
|
+
path: '/customers',
|
|
633
|
+
Icon: <CustomersIcon />,
|
|
634
|
+
operations: ['crm.customers.read'],
|
|
635
|
+
},
|
|
636
|
+
],
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
label: 'Admin',
|
|
640
|
+
items: [
|
|
641
|
+
{
|
|
642
|
+
label: 'Settings',
|
|
643
|
+
path: '/settings',
|
|
644
|
+
Icon: <SettingsIcon />,
|
|
645
|
+
operations: ['crm.settings.write'],
|
|
646
|
+
},
|
|
647
|
+
],
|
|
648
|
+
},
|
|
649
|
+
];
|
|
650
|
+
|
|
651
|
+
export default menu;
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
**Menu Type Definition**:
|
|
655
|
+
|
|
656
|
+
```typescript
|
|
657
|
+
type ApplicationMenuItem = {
|
|
658
|
+
label: string;
|
|
659
|
+
path?: string;
|
|
660
|
+
Icon?: React.ReactNode;
|
|
661
|
+
operations?: string[]; // Required operations for visibility
|
|
662
|
+
items?: ApplicationMenuItem[];
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
type ApplicationMenu = ApplicationMenuItem[];
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
### Authorization-Based Visibility
|
|
669
|
+
|
|
670
|
+
Menu items can be restricted based on operations:
|
|
671
|
+
|
|
672
|
+
```typescript
|
|
673
|
+
{
|
|
674
|
+
label: 'Delete Customers',
|
|
675
|
+
path: '/customers/delete',
|
|
676
|
+
operations: ['crm.customers.delete'],
|
|
677
|
+
}
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
**Behavior**:
|
|
681
|
+
- If user lacks required operations, item is hidden
|
|
682
|
+
- If all items in a section are hidden, the section is hidden
|
|
683
|
+
- Empty sections are not rendered
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
## Application Lifecycle
|
|
688
|
+
|
|
689
|
+
The Shell manages the lifecycle of application UIs:
|
|
690
|
+
|
|
691
|
+
```
|
|
692
|
+
┌─────────────────────────────────────────────────────────┐
|
|
693
|
+
│ 1. User navigates to application route │
|
|
694
|
+
│ Example: /crm │
|
|
695
|
+
└────────────────────┬────────────────────────────────────┘
|
|
696
|
+
│
|
|
697
|
+
▼
|
|
698
|
+
┌─────────────────────────────────────────────────────────┐
|
|
699
|
+
│ 2. Shell queries catalog for application │
|
|
700
|
+
│ Finds @mycompany/crm-ui module │
|
|
701
|
+
└────────────────────┬────────────────────────────────────┘
|
|
702
|
+
│
|
|
703
|
+
▼
|
|
704
|
+
┌─────────────────────────────────────────────────────────┐
|
|
705
|
+
│ 3. Shell loads application bundle │
|
|
706
|
+
│ Fetches /crm-ui/mycompany-crm-ui.js │
|
|
707
|
+
└────────────────────┬────────────────────────────────────┘
|
|
708
|
+
│
|
|
709
|
+
▼
|
|
710
|
+
┌─────────────────────────────────────────────────────────┐
|
|
711
|
+
│ 4. single-spa mounts application │
|
|
712
|
+
│ At selector: #pae-shell-ui-content │
|
|
713
|
+
└────────────────────┬────────────────────────────────────┘
|
|
714
|
+
│
|
|
715
|
+
▼
|
|
716
|
+
┌─────────────────────────────────────────────────────────┐
|
|
717
|
+
│ 5. Application UI renders │
|
|
718
|
+
│ Application is now active and interactive │
|
|
719
|
+
└────────────────────┬────────────────────────────────────┘
|
|
720
|
+
│
|
|
721
|
+
▼
|
|
722
|
+
┌─────────────────────────────────────────────────────────┐
|
|
723
|
+
│ 6. Shell updates navbar │
|
|
724
|
+
│ Shows application icon as active │
|
|
725
|
+
│ Renders application menu │
|
|
726
|
+
└─────────────────────────────────────────────────────────┘
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
**Unmounting**:
|
|
730
|
+
|
|
731
|
+
When user navigates away:
|
|
732
|
+
1. single-spa calls application's `unmount` function
|
|
733
|
+
2. Application cleans up (removes listeners, timers, etc.)
|
|
734
|
+
3. Application UI is removed from DOM
|
|
735
|
+
4. Shell updates navbar for new application
|
|
736
|
+
|
|
737
|
+
---
|
|
738
|
+
|
|
739
|
+
## Best Practices
|
|
740
|
+
|
|
741
|
+
<CardGrid>
|
|
742
|
+
<Card title="Customize via Props First" icon="setting">
|
|
743
|
+
Use custom props for configuration before resorting to CSS or extension points
|
|
744
|
+
</Card>
|
|
745
|
+
|
|
746
|
+
<Card title="Respect CSS Variables" icon="seti:css">
|
|
747
|
+
When styling applications, use platform CSS variables for consistency
|
|
748
|
+
</Card>
|
|
749
|
+
|
|
750
|
+
<Card title="Export Menu & Icon" icon="puzzle">
|
|
751
|
+
Always export menu and icon from application UIs to integrate with Shell
|
|
752
|
+
</Card>
|
|
753
|
+
|
|
754
|
+
<Card title="Use Operation-Based Visibility" icon="shield">
|
|
755
|
+
Leverage the operations array to hide unauthorized menu items
|
|
756
|
+
</Card>
|
|
757
|
+
|
|
758
|
+
<Card title="Test Menu Collapsing" icon="approve-check">
|
|
759
|
+
Ensure your app works with both expanded and collapsed menu states
|
|
760
|
+
</Card>
|
|
761
|
+
|
|
762
|
+
<Card title="Minimal Extension Points" icon="random">
|
|
763
|
+
Only replace extension points when absolutely necessary
|
|
764
|
+
</Card>
|
|
765
|
+
</CardGrid>
|
|
766
|
+
|
|
767
|
+
---
|
|
768
|
+
|
|
769
|
+
## Common Customization Scenarios
|
|
770
|
+
|
|
771
|
+
### Custom Branding
|
|
772
|
+
|
|
773
|
+
```json
|
|
774
|
+
{
|
|
775
|
+
"platformName": "Acme Corp Platform",
|
|
776
|
+
"navbar": {
|
|
777
|
+
"menus": {
|
|
778
|
+
"applications": [
|
|
779
|
+
{
|
|
780
|
+
"type": "app",
|
|
781
|
+
"name": "platform-admin",
|
|
782
|
+
"iconUrl": "/assets/custom-admin-icon.svg"
|
|
783
|
+
}
|
|
784
|
+
]
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
Plus CSS customization:
|
|
791
|
+
```css
|
|
792
|
+
:root {
|
|
793
|
+
--platform-color-primary-red: 220;
|
|
794
|
+
--platform-color-primary-green: 38;
|
|
795
|
+
--platform-color-primary-blue: 38;
|
|
796
|
+
--platform-text-base-font-family: 'Roboto', sans-serif;
|
|
797
|
+
}
|
|
798
|
+
```
|
|
799
|
+
|
|
800
|
+
### Floating Collapsible Menu
|
|
801
|
+
|
|
802
|
+
```json
|
|
803
|
+
{
|
|
804
|
+
"isMenuCollapsible": true,
|
|
805
|
+
"isMenuFloating": true,
|
|
806
|
+
"showOpenMenuButton": true
|
|
807
|
+
}
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
### Full Navbar Control
|
|
811
|
+
|
|
812
|
+
```json
|
|
813
|
+
{
|
|
814
|
+
"canToggleNavbarState": true,
|
|
815
|
+
"isMenuCollapsible": true
|
|
816
|
+
}
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
### Custom Theme Toggle
|
|
820
|
+
|
|
821
|
+
```json
|
|
822
|
+
{
|
|
823
|
+
"navbar": {
|
|
824
|
+
"menus": {
|
|
825
|
+
"tools": [
|
|
826
|
+
{
|
|
827
|
+
"type": "extension-point",
|
|
828
|
+
"name": "theme-toggle"
|
|
829
|
+
}
|
|
830
|
+
]
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
```
|
|
835
|
+
|
|
836
|
+
Then in a UI module:
|
|
837
|
+
```typescript
|
|
838
|
+
<ExtendExtensionPoint
|
|
839
|
+
module="@bluealba/pae-shell-ui"
|
|
840
|
+
point="theme-toggle"
|
|
841
|
+
>
|
|
842
|
+
<ThemeToggleButton />
|
|
843
|
+
</ExtendExtensionPoint>
|
|
844
|
+
```
|
|
845
|
+
|
|
846
|
+
---
|
|
847
|
+
|
|
848
|
+
## Troubleshooting
|
|
849
|
+
|
|
850
|
+
### Application Not Appearing in Navbar
|
|
851
|
+
|
|
852
|
+
**Check**:
|
|
853
|
+
1. Application is registered in catalog
|
|
854
|
+
2. User has access to the application
|
|
855
|
+
3. Module is deployed and accessible
|
|
856
|
+
|
|
857
|
+
### Menu Not Showing
|
|
858
|
+
|
|
859
|
+
**Check**:
|
|
860
|
+
1. Application exports `menu` in `main.tsx`
|
|
861
|
+
2. Menu items have required operations user possesses
|
|
862
|
+
3. Menu structure is valid
|
|
863
|
+
|
|
864
|
+
### Custom Icon Not Displaying
|
|
865
|
+
|
|
866
|
+
**Check**:
|
|
867
|
+
1. Icon URL is correct and accessible
|
|
868
|
+
2. Icon file is in the correct format (SVG, PNG)
|
|
869
|
+
3. Icon file is being served by the application's web server
|
|
870
|
+
4. URL path is absolute or correctly relative
|
|
871
|
+
|
|
872
|
+
### Extension Point Not Working
|
|
873
|
+
|
|
874
|
+
**Check**:
|
|
875
|
+
1. Extension point name matches exactly
|
|
876
|
+
2. Component is properly exported
|
|
877
|
+
3. No console errors
|
|
878
|
+
|
|
879
|
+
---
|
|
880
|
+
|
|
881
|
+
## Next Steps
|
|
882
|
+
|
|
883
|
+
- **[UI Extension Points](/_/docs/architecture/ui-extension-points/)** - Deep dive into extension point mechanism
|
|
884
|
+
- **[Bootstrap](/_/docs/architecture/bootstrap/)** - Configuring Shell via bootstrap
|
|
885
|
+
- **[Multi-Tenancy](/_/docs/architecture/multi-tenancy/)** - Tenant-specific Shell customization
|