Skip to content

Commit 02e1c68

Browse files
committed
feat: update ConsoleLayout and objectstack configuration for analytics dashboard and help page
1 parent b03bfe0 commit 02e1c68

File tree

2 files changed

+48
-127
lines changed

2 files changed

+48
-127
lines changed

apps/console/src/components/ConsoleLayout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export function ConsoleLayout({
2626
onAppChange={onAppChange}
2727
/>
2828
}
29-
header={undefined}
3029
navbar={
3130
<AppHeader
3231
appName={activeApp?.label || activeAppName}

examples/kitchen-sink/objectstack.config.ts

Lines changed: 48 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -10,100 +10,57 @@ export default defineStack({
1010
],
1111
apps: [
1212
App.create({
13-
name: 'kitchen_sink_app',
14-
label: 'Kitchen Sink',
15-
icon: 'layout',
13+
name: 'analytics_app',
14+
label: 'Analytics',
15+
icon: 'bar-chart-2',
1616
navigation: [
1717
{
18-
id: 'nav_kitchen',
19-
type: 'object',
20-
objectName: 'kitchen_sink',
21-
label: 'Components'
18+
id: 'nav_dash',
19+
type: 'dashboard',
20+
dashboardName: 'sales_dashboard',
21+
label: 'Sales Overview'
2222
},
2323
{
24-
id: 'nav_account',
25-
type: 'object',
26-
objectName: 'account',
27-
label: 'Reference Accounts'
24+
id: 'nav_help',
25+
type: 'page',
26+
pageName: 'help_page',
27+
label: 'Help & Resources'
2828
}
2929
]
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-
}
30+
})
5531
],
5632
dashboards: [
5733
{
5834
name: 'sales_dashboard',
5935
label: 'Sales Overview',
6036
description: 'Quarterly sales performance',
61-
columns: 4,
6237
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-
}
38+
{
39+
title: 'Sales by Region',
40+
type: 'bar',
41+
layout: { x: 0, y: 1, w: 2, h: 2 },
42+
options: {
43+
height: 300,
44+
xField: 'name',
45+
yField: 'value',
46+
data: [
47+
{ name: 'North', value: 4000 },
48+
{ name: 'South', value: 3000 },
49+
{ name: 'East', value: 2000 },
50+
{ name: 'West', value: 2780 },
51+
]
10652
}
53+
},
54+
{
55+
title: 'Revenue',
56+
type: 'bar', // Using bar as placeholder for stats since 'card' might not be valid
57+
layout: { x: 0, y: 0, w: 1, h: 1 },
58+
options: {
59+
data: [{ name: 'Rev', value: 1200000 }],
60+
xField: 'name',
61+
yField: 'value'
62+
}
63+
}
10764
]
10865
}
10966
],
@@ -120,15 +77,15 @@ export default defineStack({
12077
type: 'container',
12178
properties: {
12279
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-
]
80+
children: [
81+
{ type: 'text', properties: { content: '# Application Guide', className: 'text-3xl font-bold mb-4 block' } },
82+
{ type: 'text', properties: { content: 'Welcome to the ObjectStack Console.', className: 'mb-4 block' } },
83+
{ type: 'text', properties: { content: '## Features', className: 'text-xl font-bold mb-2 block' } },
84+
{ type: 'text', properties: { content: '- Dynamic Object CRUD\n- Server-Driven Dashboards\n- Flexible Page Layouts', className: 'whitespace-pre-line block' } },
85+
{ type: 'text', properties: { content: '## Getting Started', className: 'text-xl font-bold mb-2 block mt-6' } },
86+
{ type: 'text', properties: { content: 'Navigate using the sidebar to explore different apps and objects.', className: 'mb-4 block' } }
87+
]
88+
}
13289
}
13390
]
13491
}
@@ -140,42 +97,7 @@ export default defineStack({
14097
version: '1.0.0',
14198
type: 'app',
14299
name: 'Kitchen Sink',
143-
description: 'Component Testing App',
144-
data: [
145-
{
146-
object: 'account',
147-
mode: 'upsert',
148-
records: [
149-
{ _id: "1", name: "TechCorp" },
150-
{ _id: "2", name: "Software Inc" }
151-
]
152-
},
153-
{
154-
object: 'kitchen_sink',
155-
mode: 'upsert',
156-
records: [
157-
{
158-
_id: "1001",
159-
name: "Full Feature Test",
160-
description: "This record has every field populated.",
161-
amount: 42,
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"
176-
}
177-
]
178-
}
179-
]
100+
description: 'Kitchen Sink Example App',
101+
data: []
180102
}
181103
});

0 commit comments

Comments
 (0)