-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtask-visualizations.pages.ts
More file actions
122 lines (112 loc) · 4.04 KB
/
Copy pathtask-visualizations.pages.ts
File metadata and controls
122 lines (112 loc) · 4.04 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import type { Page } from '@objectstack/spec/ui';
/**
* Visualization gallery — one interface page per record visualization, each
* over the SAME showcase_task object. Demonstrates that a list/interface page
* can be locked to any single visualization (single-entry
* `appearance.allowedVisualizations` = no switcher), and that the per-viz
* field bindings (kanban groupBy, calendar/gantt/timeline dates, gallery cover,
* map location) are auto-derived from the object — the author only whitelists
* the type.
*
* The last page (All Views) keeps the switcher open across every type, showing
* the runtime visualization choice ON a page (not just on the object view).
*/
const base = {
type: 'list' as const,
object: 'showcase_task',
kind: 'full' as const,
template: 'default',
isDefault: false,
regions: [],
};
const cols = ['title', 'assignee', 'status', 'priority', 'due_date'];
export const TaskBoardPage: Page = {
...base,
name: 'showcase_task_board',
label: 'Task Board',
interfaceConfig: {
source: 'showcase_task',
columns: [...cols, 'estimate_hours'],
appearance: { showDescription: true, allowedVisualizations: ['kanban'] },
userActions: { sort: true, search: true, filter: false, rowHeight: false, addRecordForm: false },
showRecordCount: true,
},
};
export const TaskCalendarPage: Page = {
...base,
name: 'showcase_task_calendar',
label: 'Task Calendar',
interfaceConfig: {
source: 'showcase_task',
columns: cols,
appearance: { showDescription: true, allowedVisualizations: ['calendar'] },
userActions: { sort: false, search: true, filter: false, rowHeight: false, addRecordForm: false },
showRecordCount: true,
},
};
export const TaskGalleryPage: Page = {
...base,
name: 'showcase_task_gallery',
label: 'Task Gallery',
interfaceConfig: {
source: 'showcase_task',
columns: [...cols, 'cover'],
appearance: { showDescription: true, allowedVisualizations: ['gallery'] },
userActions: { sort: true, search: true, filter: false, rowHeight: false, addRecordForm: false },
showRecordCount: true,
},
};
export const TaskSchedulePage: Page = {
...base,
name: 'showcase_task_schedule',
label: 'Team Schedule (Gantt)',
interfaceConfig: {
source: 'showcase_task',
columns: [...cols, 'start_date', 'end_date', 'progress'],
appearance: { showDescription: true, allowedVisualizations: ['gantt'] },
userActions: { sort: true, search: true, filter: false, rowHeight: false, addRecordForm: false },
showRecordCount: true,
},
};
export const TaskTimelinePage: Page = {
...base,
name: 'showcase_task_timeline',
label: 'Activity Timeline',
interfaceConfig: {
source: 'showcase_task',
columns: [...cols, 'created_at'],
appearance: { showDescription: true, allowedVisualizations: ['timeline'] },
userActions: { sort: true, search: true, filter: false, rowHeight: false, addRecordForm: false },
showRecordCount: true,
},
};
export const TaskMapPage: Page = {
...base,
name: 'showcase_task_map',
label: 'Work Map',
interfaceConfig: {
source: 'showcase_task',
columns: [...cols, 'location'],
appearance: { showDescription: true, allowedVisualizations: ['map'] },
userActions: { sort: false, search: true, filter: false, rowHeight: false, addRecordForm: false },
showRecordCount: true,
},
};
export const TaskAllViewsPage: Page = {
...base,
name: 'showcase_task_all_views',
label: 'All Views',
interfaceConfig: {
source: 'showcase_task',
columns: [...cols, 'cover', 'start_date', 'end_date', 'created_at', 'progress', 'location'],
// Switcher open across every record visualization — the runtime
// visualization choice ON an interface page.
appearance: {
showDescription: true,
allowedVisualizations: ['grid', 'kanban', 'gallery', 'calendar', 'timeline', 'gantt', 'map'],
},
userActions: { sort: true, search: true, filter: false, rowHeight: false, addRecordForm: false },
showRecordCount: true,
},
};