-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.ts
More file actions
75 lines (68 loc) · 2.38 KB
/
Copy pathindex.ts
File metadata and controls
75 lines (68 loc) · 2.38 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 type { Report } from '@objectstack/spec/ui';
const task = 'showcase_task';
// ADR-0021 Phase 2: the former `TaskListReport` (showcase_task_list) — a flat
// record list — was converted to the `tabular` ListView on showcase_task
// (src/views/task.view.ts). A flat list is an object-bound row lens (ADR-0017),
// not analytics, so it is no longer a report.
/** 2 ── Summary: grouped down by status with a sum. */
export const HoursByStatusReport: Report = {
name: 'showcase_hours_by_status',
label: 'Hours by Status (Summary)',
description: 'Estimated hours grouped by task status.',
type: 'summary',
drilldown: true,
// ADR-0021 Phase 2 — dataset binding (dual-form).
dataset: 'showcase_task_metrics',
rows: ['status'],
values: ['est_hours'],
};
/** 3 ── Matrix: status (down) × priority (across) cross-tab. */
export const StatusPriorityMatrixReport: Report = {
name: 'showcase_status_priority_matrix',
label: 'Status × Priority (Matrix)',
description: 'Task counts cross-tabulated by status and priority.',
type: 'matrix',
drilldown: true,
// ADR-0021 D2 — true pivot: `rows` down × `columns` across, measures in cells.
dataset: 'showcase_task_metrics',
rows: ['status'],
columns: ['priority'],
values: ['est_hours'],
};
/** 4 ── Joined: multiple stacked blocks in one report. */
export const TaskOverviewReport: Report = {
name: 'showcase_task_overview',
label: 'Task Overview (Joined)',
description: 'Multiple task sub-reports stacked into one joined view.',
type: 'joined',
drilldown: true,
blocks: [
{
// Analytics block → dataset-bound (dual-form); reconciled by the harness.
name: 'open_block',
label: 'Open Tasks',
type: 'summary',
dataset: 'showcase_task_metrics',
rows: ['status'],
values: ['est_hours'],
runtimeFilter: { done: false },
},
{
// Single-form: a count of completed tasks (the former record-list detail
// moves to a click-through drilldown).
name: 'done_block',
label: 'Completed Tasks',
type: 'summary',
dataset: 'showcase_task_metrics',
rows: ['status'],
values: ['task_count'],
runtimeFilter: { done: true },
},
],
};
export const allReports = [
HoursByStatusReport,
StatusPriorityMatrixReport,
TaskOverviewReport,
];