-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathobjectstack.config.ts
More file actions
102 lines (100 loc) · 3.07 KB
/
objectstack.config.ts
File metadata and controls
102 lines (100 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import { defineStack } from '@objectstack/spec';
/**
* Task Object Definition
*/
export const TaskObject = {
name: 'task',
label: 'Task',
description: 'Task management object',
icon: 'check-square',
titleFormat: '{subject}',
enable: {
apiEnabled: true,
trackHistory: false,
feeds: false,
activities: false,
mru: true,
},
fields: {
id: { name: 'id', label: 'ID', type: 'text', required: true },
subject: { name: 'subject', label: 'Subject', type: 'text', required: true },
status: {
name: 'status',
label: 'Status',
type: 'select',
options: [
{ label: 'Not Started', value: 'not_started' },
{ label: 'In Progress', value: 'in_progress' },
{ label: 'Waiting', value: 'waiting' },
{ label: 'Completed', value: 'completed' },
]
},
priority: {
name: 'priority',
label: 'Priority',
type: 'select',
options: [
{ label: 'Low', value: 'low' },
{ label: 'Normal', value: 'normal' },
{ label: 'High', value: 'high' },
{ label: 'Urgent', value: 'urgent' },
]
},
category: { name: 'category', label: 'Category', type: 'text' },
due_date: { name: 'due_date', label: 'Due Date', type: 'date' },
is_completed: { name: 'is_completed', label: 'Completed', type: 'boolean', defaultValue: false },
created_at: { name: 'created_at', label: 'Created At', type: 'datetime' }
}
};
/**
* App Configuration
*
* This is the single source of truth for apps/studio in MSW (browser) mode.
* In server mode the studio fetches apps dynamically via the API.
*/
export default defineStack({
name: 'task_app',
label: 'Task Management',
description: 'MSW + React CRUD Example with ObjectStack',
version: '1.0.0',
icon: 'check-square',
branding: {
primaryColor: '#3b82f6',
logo: '/assets/logo.png',
},
objects: [
TaskObject
],
data: [
{
object: 'task',
mode: 'upsert' as const,
externalId: 'subject',
records: [
{ subject: 'Learn ObjectStack', status: 'completed', priority: 'high', category: 'Work' },
{ subject: 'Build a cool app', status: 'in_progress', priority: 'normal', category: 'Work' },
{ subject: 'Review PR #102', status: 'completed', priority: 'high', category: 'Work' },
{ subject: 'Write Documentation', status: 'not_started', priority: 'normal', category: 'Work' },
{ subject: 'Fix Server bug', status: 'waiting', priority: 'urgent', category: 'Work' },
{ subject: 'Buy groceries', status: 'not_started', priority: 'low', category: 'Shopping' },
{ subject: 'Schedule dentist appointment', status: 'not_started', priority: 'normal', category: 'Health' },
{ subject: 'Pay utility bills', status: 'not_started', priority: 'high', category: 'Finance' },
]
}
],
navigation: [
{
id: 'group_tasks',
type: 'group',
label: 'Tasks',
children: [
{
id: 'nav_tasks',
type: 'object',
objectName: 'task',
label: 'My Tasks'
}
]
}
]
});