Skip to content

Commit b03bfe0

Browse files
committed
feat: enhance objectstack configuration with analytics dashboard and help page
1 parent 3d323fe commit b03bfe0

3 files changed

Lines changed: 132 additions & 15 deletions

File tree

apps/console/objectstack.config.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default defineConfig({
5252
],
5353

5454
// ============================================================================
55-
// Merged Stack Configuration (CRM + Todo + Kitchen Sink)
55+
// Merged Stack Configuration (CRM + Todo + Kitchen Sink + Mock Metadata)
5656
// ============================================================================
5757
objects: [
5858
...(crmConfig.objects || []),
@@ -64,6 +64,16 @@ export default defineConfig({
6464
...(todoConfig.apps || []),
6565
...(kitchenSinkConfig.apps || [])
6666
],
67+
dashboards: [
68+
...(crmConfig.dashboards || []),
69+
...(todoConfig.dashboards || []),
70+
...(kitchenSinkConfig.dashboards || [])
71+
],
72+
pages: [
73+
...(crmConfig.pages || []),
74+
...(todoConfig.pages || []),
75+
...(kitchenSinkConfig.pages || [])
76+
],
6777
manifest: {
6878
data: [
6979
...(crmConfig.manifest?.data || []),

apps/console/src/components/LoadingScreen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21

32
export function LoadingScreen() {
43
return (

examples/kitchen-sink/objectstack.config.ts

Lines changed: 121 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,113 @@ export default defineStack({
2727
label: 'Reference Accounts'
2828
}
2929
]
30-
})
30+
}),
31+
{
32+
name: 'analytics',
33+
label: 'Analytics',
34+
icon: 'activity',
35+
description: 'Business Intelligence Simulation',
36+
navigation: [
37+
{
38+
id: 'group_dashboards',
39+
type: 'group',
40+
label: 'Dashboards',
41+
children: [
42+
{ id: 'nav_sales_dashboard', type: 'dashboard', dashboardName: 'sales_dashboard', label: 'Sales Overview' }
43+
]
44+
},
45+
{
46+
id: 'group_pages',
47+
type: 'group',
48+
label: 'Pages',
49+
children: [
50+
{ id: 'nav_help_page', type: 'page', pageName: 'help_page', label: 'Help Guide' }
51+
]
52+
}
53+
]
54+
}
55+
],
56+
dashboards: [
57+
{
58+
name: 'sales_dashboard',
59+
label: 'Sales Overview',
60+
description: 'Quarterly sales performance',
61+
columns: 4,
62+
widgets: [
63+
{
64+
id: 'w1',
65+
title: 'Total Revenue',
66+
layout: { x: 0, y: 0, w: 1, h: 1 },
67+
component: {
68+
type: 'card',
69+
className: 'h-full flex flex-col justify-center items-center',
70+
children: [
71+
{ type: 'text', content: '$1.2M', className: 'text-2xl font-bold' },
72+
{ type: 'text', content: '+12% from last month', className: 'text-xs text-green-500' }
73+
]
74+
}
75+
},
76+
{
77+
id: 'w2',
78+
title: 'Active Users',
79+
layout: { x: 1, y: 0, w: 1, h: 1 },
80+
component: {
81+
type: 'card',
82+
className: 'h-full flex flex-col justify-center items-center',
83+
children: [
84+
{ type: 'text', content: '3,450', className: 'text-2xl font-bold' },
85+
{ type: 'text', content: '+5% new users', className: 'text-xs text-blue-500' }
86+
]
87+
}
88+
},
89+
{
90+
id: 'w3',
91+
title: 'Sales by Region',
92+
layout: { x: 0, y: 1, w: 2, h: 2 },
93+
component: {
94+
type: 'chart',
95+
chartType: 'bar',
96+
height: 300,
97+
data: [
98+
{ name: 'North', value: 4000 },
99+
{ name: 'South', value: 3000 },
100+
{ name: 'East', value: 2000 },
101+
{ name: 'West', value: 2780 },
102+
],
103+
xField: 'name',
104+
yField: 'value'
105+
}
106+
}
107+
]
108+
}
109+
],
110+
pages: [
111+
{
112+
name: 'help_page',
113+
label: 'Help Guide',
114+
type: 'utility',
115+
regions: [
116+
{
117+
name: 'main',
118+
components: [
119+
{
120+
type: 'container',
121+
properties: {
122+
className: 'prose max-w-none p-6 text-foreground bg-card rounded-lg border shadow-sm',
123+
},
124+
children: [
125+
{ type: 'text', properties: { content: '# Application Guide', className: 'text-3xl font-bold mb-4 block' } },
126+
{ type: 'text', properties: { content: 'Welcome to the ObjectStack Console.', className: 'mb-4 block' } },
127+
{ type: 'text', properties: { content: '## Features', className: 'text-xl font-bold mb-2 block' } },
128+
{ type: 'text', properties: { content: '- Dynamic Object CRUD\n- Server-Driven Dashboards\n- Flexible Page Layouts', className: 'whitespace-pre-line block' } },
129+
{ type: 'text', properties: { content: '## Getting Started', className: 'text-xl font-bold mb-2 block mt-6' } },
130+
{ type: 'text', properties: { content: 'Navigate using the sidebar to explore different apps and objects.', className: 'mb-4 block' } }
131+
]
132+
}
133+
]
134+
}
135+
]
136+
}
31137
],
32138
manifest: {
33139
id: 'com.example.kitchen-sink',
@@ -53,18 +159,20 @@ export default defineStack({
53159
name: "Full Feature Test",
54160
description: "This record has every field populated.",
55161
amount: 42,
56-
price: 99.99,
57-
percent: 0.75,
58-
rating: 4,
59-
is_active: true,
60-
category: "opt_a",
61-
tags: ["col_red", "col_blue"],
62-
email: "test@example.com",
63-
url: "https://objectstack.org",
64-
phone: "+15551234567",
65-
code: "{\"foo\": \"bar\"}",
66-
due_date: "2024-12-31",
67-
account: "1"
162+
active: true,
163+
status: "active",
164+
start_date: "2024-01-01",
165+
priority: 5,
166+
metadata: { complexity: "high" },
167+
tags: ["test", "demo"]
168+
},
169+
{
170+
_id: "1002",
171+
name: "Empty Test",
172+
description: null,
173+
amount: null,
174+
active: false,
175+
status: "pending"
68176
}
69177
]
70178
}

0 commit comments

Comments
 (0)