-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.ts
More file actions
96 lines (88 loc) · 3.12 KB
/
Copy pathindex.ts
File metadata and controls
96 lines (88 loc) · 3.12 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
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import { defineReport } 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/ui/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 = defineReport({
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 = defineReport({
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 = defineReport({
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 },
},
],
});
/** 5 ── Summary with an embedded chart. Exercises the live `DatasetReportChart`
* path: `chart.xAxis`/`yAxis` name the bound dataset's dimension/measure and
* are plotted via a second `queryDataset` call (ADR-0021). */
export const HoursByStatusChartReport = defineReport({
name: 'showcase_hours_by_status_chart',
label: 'Hours by Status (Chart)',
description: 'Estimated hours by status, plotted as a bar chart.',
type: 'summary',
drilldown: true,
dataset: 'showcase_task_metrics',
rows: ['status'],
values: ['est_hours'],
chart: {
// Chart type from ChartConfig; xAxis = dataset dimension, yAxis = measure.
type: 'bar',
xAxis: 'status',
yAxis: 'est_hours',
},
});
export const allReports = [
HoursByStatusReport,
StatusPriorityMatrixReport,
TaskOverviewReport,
HoursByStatusChartReport,
];