-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtask.view.ts
More file actions
75 lines (70 loc) · 2.25 KB
/
Copy pathtask.view.ts
File metadata and controls
75 lines (70 loc) · 2.25 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
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import { defineView } from '@objectstack/spec';
const data = { provider: 'object' as const, object: 'todo_task' };
/**
* Task list views (ADR-0017 object-bound row lenses).
*
* ADR-0021 Phase 2: the former `overdue_tasks` *report* was a flat record list
* (no grouping / aggregation), which is a ListView concern, not analytics. It
* is converted here to an `overdue` grid view filtered to incomplete, overdue
* tasks — replacing the report entirely.
*
* Issue #1719: the dashboard's `overdue_tasks_table` / `due_today` widgets
* were count-only `table` widgets on the `task_metrics` dataset — a single
* summary row, not the record listing they intended. They are re-modelled
* here as the `overdue` / `due_today` views, surfaced via app navigation;
* the dashboard keeps the counts on its `metric` widgets.
*/
export const TaskViews = defineView({
list: {
label: 'All Tasks',
type: 'grid',
data,
columns: [
{ field: 'subject' },
{ field: 'status' },
{ field: 'priority' },
{ field: 'due_date' },
{ field: 'owner' },
{ field: 'category' },
],
},
listViews: {
// Replaces the legacy `overdue_tasks` report.
overdue: {
label: 'Overdue Tasks',
type: 'grid',
data,
columns: [
{ field: 'subject' },
{ field: 'due_date' },
{ field: 'priority' },
{ field: 'owner' },
{ field: 'category' },
],
filter: [
{ field: 'is_overdue', operator: 'equals', value: true },
{ field: 'is_completed', operator: 'equals', value: false },
],
sort: [{ field: 'due_date', order: 'asc' }],
},
// Replaces the dashboard's count-only `due_today` table widget (#1719).
due_today: {
label: 'Due Today',
type: 'grid',
data,
columns: [
{ field: 'subject' },
{ field: 'priority' },
{ field: 'status' },
{ field: 'owner' },
{ field: 'category' },
],
filter: [
{ field: 'due_date', operator: 'equals', value: '{today}' },
{ field: 'is_completed', operator: 'equals', value: false },
],
sort: [{ field: 'priority', order: 'desc' }],
},
},
});