@object-ui/plugin-report 17.5.0 → 17.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,338 @@
1
1
  # @object-ui/plugin-report
2
2
 
3
+ ## 17.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a945271: `DatasetReportRenderer` no longer reads `filter` as an alias for `runtimeFilter`.
8
+
9
+ `filter` is not an authorable key. `ReportSchema` in `@objectstack/spec` (17.0.0)
10
+ is `z.core.$strict` and rejects it outright, going out of its way to name the
11
+ replacement: ``Unrecognized key(s) on this report: `filter`. Did you mean
12
+ `filter` → `runtimeFilter`?`` The renderer accepted the rejected spelling anyway,
13
+ at two sites — the report-level `report.runtimeFilter ?? report.filter` and the
14
+ per-joined-block `block.runtimeFilter ?? block.filter`. Metadata that could not
15
+ be authored through the validated path still rendered when it arrived by some
16
+ other route, so the strictness the spec promises was not the strictness the
17
+ runtime enforced. It matters most for AI-authored metadata: a generator emitting
18
+ `filter` got a working report from this renderer and a hard validation failure
19
+ from anything that parsed the document first, and which one the author met was a
20
+ function of which path the document travelled.
21
+
22
+ **Behaviour change — read this if you store report documents.** A stored document
23
+ still carrying `filter` no longer has that filter applied: it renders
24
+ **unfiltered**, showing rows the report was scoped to exclude. Server-side
25
+ permissions are unaffected and still apply, so this is not an access-control
26
+ change — it is a report showing more rows than its author intended. Scored
27
+ `minor` per this repo's version policy (AGENTS.md §版本号策略), which reserves
28
+ `major` for the synchronized `@objectstack` major bump; the narrowing is
29
+ described here rather than encoded in the number.
30
+
31
+ Because rendering unfiltered *in silence* would be worse than an error, the
32
+ dropped key is not silent. When a document carrying `filter` reaches the
33
+ renderer, a dev-mode warning fires once per offending report or block, naming the
34
+ key, quoting the spec's own rename hint verbatim (so an author meets one message
35
+ rather than two dialects of one message), and stating that no filter was applied.
36
+ It is a no-op under `NODE_ENV=production` and changes no types.
37
+
38
+ Fix your documents by renaming `filter` to `runtimeFilter` — the key the schema
39
+ actually declares, and the one the suggestion has always pointed at. Reports that
40
+ already author `runtimeFilter`, and hosts that pass the `runtimeFilter` prop, are
41
+ entirely unaffected.
42
+
43
+ ### Patch Changes
44
+
45
+ - cb5a7de: A report's embedded chart now paints its category dimension's own option colours and renders ordered-sequence charts (funnel/pyramid) in the field's declared picklist order — the same two derivations a dashboard chart has always gotten for the identical dimension (objectui#4906).
46
+
47
+ `DatasetReportChart` (`DatasetReportRenderer.tsx`) resolved its dimension's option **labels** but called neither `buildOptionColorMap` nor `buildCategoryOrder` — the two `@object-ui/core` helpers `DatasetWidget` (plugin-dashboard) already runs off the same resolved field metadata. The chart forwarded only an author-supplied `colors` record (objectui#4877); with none authored it fell back to the positional palette, and a funnel's stages sorted by value instead of the declared pipeline.
48
+
49
+ This is convergence onto an already-ruled behavior, not new capability: the report path now runs the identical `useDatasetDimensionMeta` → `localizeFieldOptions` → `buildOptionColorMap`/`buildCategoryOrder` chain the dashboard widget uses (framework#3588's declared-picklist-order ruling), reused rather than re-derived.
50
+
51
+ **This visibly changes rendering for an existing report** that groups by a select/lookup dimension carrying option colours, or is declared on an ordered field:
52
+
53
+ - a chart with no authored `colors` now paints each category in that dimension's own option colour (e.g. a `health` dimension now paints its own green/amber/red) instead of the renderer's positional palette;
54
+ - a `funnel`/`pyramid` chart now orders its stages by the field's declared picklist order instead of sorting by value.
55
+
56
+ Precedence is unchanged and preserved: an authored `colors` record (objectui#4877) still wins over the derived per-category map, merged UNDER it exactly as the dashboard already does — an author's explicit colour for a category is never overridden by the field's own.
57
+ - 0237208: docs(plugin-report): teach the dataset-bound report as the sole authoring shape
58
+
59
+ `packages/plugin-report/README.md` and `content/docs/plugins/plugin-report.mdx`
60
+ still taught the pre-9.0 query form (`objectName` + column-definition `columns` +
61
+ `groupingsDown` / `groupingsAcross`) as the live way to write a report, and named
62
+ three renderers plus `applyInMemoryAggregation` that were removed at the ADR-0021
63
+ cutover. The current `ReportSchema` is strict and rejects that form outright, so
64
+ every copyable example on both pages now authors the dataset-bound shape
65
+ (`dataset` + `rows` / `columns` / `values`, `runtimeFilter`, `order`, `drilldown`,
66
+ `chart`) through `defineReport`. Stored pre-9.0 documents keep one clearly
67
+ labelled migration-only section describing the lossy bridge that renders them and
68
+ the key-by-key direction of migration.
69
+ - 82a9417: docs(plugin-report): rewrite the README export snippets against the real export signatures
70
+
71
+ The `### Export` and `### Live Export` snippets called every export function with
72
+ the wrong arity or argument order. Every name was real, so the name-set check
73
+ could not see it — only the calls were wrong:
74
+
75
+ - The six format exporters are `(report: ReportComponentSchema, data: any[], config?: ReportExportConfig): void`.
76
+ The README called them `(data, filename)`, so a filename string landed in the
77
+ `data` slot the engine iterates as rows, and there is no filename parameter at
78
+ all — the download name comes from `config.filename`, else `report.title`. All
79
+ five are synchronous `void`, so the snippet's `await` was inert.
80
+ `exportReport` takes the format **first**, which no snippet showed.
81
+ - `exportWithLiveData(report, options)` requires `dataSource` and `resource` in
82
+ `LiveExportOptions`; the README passed only `{ format: 'pdf' }`.
83
+ - `exportExcelWithFormulas(report, data, options)` takes three parameters; the
84
+ README passed two, and spelled the column key `field` where `ExcelColumnConfig`
85
+ has the required `name` and `header`. Formula templates use the `{ROW}`
86
+ placeholder, which the old `SUM(B2:B100)` never exercised.
87
+
88
+ The rewritten blocks are the exporters' own (correct) JSDoc examples, and each
89
+ one now compiles against the package's built `dist/index.d.ts`. Docs only — no
90
+ API, export surface or runtime behaviour changed.
91
+ - f331f5a: Docs only: `packages/plugin-report/README.md` no longer teaches three exports the
92
+ package does not have (objectui#5016). Each was judged individually against the
93
+ entry module's export surface, and all three turned out to be **survivors of the
94
+ 9.0 cutover** rather than renames — `CHANGELOG.md` records `ReportBuilder`,
95
+ `ScheduleConfig` and the drill helpers as removed with the pre-9.0 query-form
96
+ renderers, and the README kept teaching them afterwards:
97
+
98
+ - **`ReportBuilder`** — taught as the main editor component. Removed; there is no
99
+ authoring component in this package. The Quick Start now teaches the real ones,
100
+ with their real signatures: `ReportRenderer` (the dispatcher, which takes the
101
+ report as `schema`), `DatasetReportRenderer` (which takes it as `report`), and
102
+ `ReportViewer` — whose props are `{ schema, onRefresh }`, so the old
103
+ `< ReportViewer report={…} showToolbar />` would not have compiled either.
104
+ `report` / `showToolbar` are keys inside a `ReportViewerSchema`.
105
+ - **`registerDrillHandler(actionRunner, …)`** — taught as the drill registration
106
+ call. Removed, and its mechanism no longer exists: drill-down is now a host
107
+ callback, `onDrill?: (args: DatasetDrillArgs) => void`, and the host owns
108
+ navigation because the renderer only knows dimension names (ADR-0021 D2). The
109
+ section is rewritten around what a click actually emits, including why
110
+ `objectFilter` (raw stored values) is what filters select/lookup dimensions
111
+ correctly where a display-label `groupKey` would not.
112
+ - **`ScheduleConfig`** — taught as a configuration component. Removed. A schedule
113
+ is *data* on the report schema: `ReportComponentSchema.schedule`, typed
114
+ `ReportScheduleConfig`. Both types live in `@object-ui/types` and are not
115
+ re-exported here, so the corrected snippet imports them from there —
116
+ `createScheduleTrigger` is the real export, and its real signature takes
117
+ `(report, dataSource, resource, onComplete)` and returns
118
+ `() => Promise< LiveExportResult[] >`, not the single callback the old snippet
119
+ passed.
120
+
121
+ Two further leftovers of the same removal are corrected: the stale survivor
122
+ sentence that listed `ReportBuilder` as still available, and the schema-driven
123
+ example's `"type": "report-builder"`, which no component registers — the
124
+ registered types are `report`, `spec-report` and `report-viewer`, now listed
125
+ explicitly. The two feature bullets asserting the removed mechanisms (a
126
+ `useReportData()` query pipeline, an `ActionRunner`-dispatched `drill` action)
127
+ state the dataset-bound path instead.
128
+
129
+ No code, types or runtime behaviour change — the diff is one README and this
130
+ changeset. The correction reaches npm with the package's next publish, which is
131
+ why it declares a patch: `README.md` is in the package's published `files`.
132
+ - 5ffcc14: fix(plugin-report): forward the chart chrome and series presentation `ReportChartSchema` declares (objectui#4877)
133
+
134
+ A report's embedded chart forwarded exactly six keys to the registered chart
135
+ component — `chartType`, `data`, `height`, `isAnimationActive`, `series`,
136
+ `xAxisKey`. Everything else `ReportChartSchema` declares as authorable never
137
+ left the report renderer, so it was inert metadata: the author writes it, the
138
+ schema accepts it, nothing reads it.
139
+
140
+ `showLegend` was the sharpest case because dropping it does not merely ignore
141
+ the author, it INVERTS them: `AdvancedChartImpl` computes
142
+ `legendVisible = showLegend !== false`, so an absent value means the legend is
143
+ on and an explicit `showLegend: false` still drew one.
144
+
145
+ Now lowered, under objectui#4229's ruled data/presentation split:
146
+
147
+ - chrome — `showLegend`, `showDataLabels`, `colors` (both the positional-palette
148
+ array and the per-category record), `subtitle`, `description`, `annotations`,
149
+ `interaction`, `height`;
150
+ - per-series presentation — `color`, `stack`, `type`, `yAxis`, `dashArray`,
151
+ `opacity`, `variant`, matched by `series[].name` so series MEMBERSHIP stays
152
+ with the dataset.
153
+
154
+ `title` is deliberately not forwarded: the report renderer paints it as its own
155
+ heading above the plot, and forwarding it would draw a second one inside the
156
+ chart's frame. `aria` is not lowered either — nothing on this path reads it
157
+ (`AdvancedChartImpl` has no `aria` prop, and this renderer hands the component a
158
+ schema directly rather than through `SchemaRenderer`'s flat ARIA injection), so
159
+ forwarding it would move declared-but-unread one layer down.
160
+
161
+ The two helpers (`chartConfigPresentation`, `mergeAuthoredPresentation`) moved
162
+ from `plugin-dashboard`'s `DatasetWidget` to `@object-ui/core` beside
163
+ `buildChartSeries`, the derivation they merge onto, so both surfaces lower one
164
+ vocabulary once instead of keeping a second copy (the duplication objectui#4389
165
+ filed as a defect). `@object-ui/core` additionally exports `mergeAuthoredSeries`
166
+ — the series merge alone — for a surface whose axes are bare dimension/measure
167
+ NAME strings rather than spec `ChartAxis` objects, which is what a report chart
168
+ declares. `DatasetWidget` re-exports both names, so its public surface and its
169
+ rendering are unchanged.
170
+ - 6bb39c4: 报表内嵌图表的度量显示名按三级回落解析,不再直接印原始 `name`
171
+
172
+ 数据集绑定的 report chart 此前把度量原样交给图表组件(`series: [{ dataKey }]`,无 label),
173
+ 于是图例、标记 tooltip 与单值卡片的说明文字都落回 dataKey——在全中文控制台上打出
174
+ `potential_upside_tons`,而同一张报表下方的汇总表、以及绑定同一数据集的 dashboard 图表
175
+ 都能正确解析出授权 `label`。`ReportChartSchema` 自 rc.1 起声明的 `series[].label` 也从未
176
+ 被读取,作者因此没有任何可授权的手段控制这个字符串。
177
+
178
+ 现按三级回落解析,与汇总表和 dashboard 的既有口径对齐:
179
+
180
+ 1. `chart.series[]` 中 `name` 命中该度量的条目的 `label`(spec 的 `I18nLabel`,按控制台
181
+ 语言解析;同名重复以第一条为准);
182
+ 2. 绑定数据集的度量 `label`(结果字段的 `label`,即汇总表表头一直在读的同一个值);
183
+ 3. 度量 `name` 兜底。
184
+
185
+ 图例与 tooltip 同源同修:`ChartRenderer` 把 series 的 `label` 写进 `config[dataKey].label`,
186
+ 三处读的是同一个输入。单值族(`metric`/`kpi`/`gauge`)的说明文字与系列图共用这一次解析。
187
+ - 5ffcc14: fix(plugin-report): route a report's embedded chart through `buildChartSeries` so a NULL category is bucketed (objectui#4878)
188
+
189
+ `DatasetReportChart` built its rows as `relabelDimensions(state.rows, …)` and
190
+ handed them to the registered chart component verbatim. Nothing on that path
191
+ bucketed a null dimension value, so a report chart passed the renderer a null
192
+ category — the exact input objectui#4466 measured as drawing **no mark at all**.
193
+ The cost is not an empty chart but a quietly wrong one: the null group vanishes
194
+ while the y-axis scale still accommodates it, so the chart reads as valid data.
195
+
196
+ The dashboard and chart-view surfaces never had the defect because they route
197
+ through `buildChartSeries` (`@object-ui/core`), where the whole null-category
198
+ family was fixed. The report chart now routes through it too, so those
199
+ properties are INHERITED rather than re-derived on a third surface:
200
+
201
+ - the null bucket itself (objectui#4466);
202
+ - its label read from the locale bundle at the call site — `@object-ui/core` is
203
+ React-free, so a zh console would otherwise draw the bar and label it `(None)`
204
+ (objectui#4500);
205
+ - bucket IDENTITY separate from the bucket label, so a stored value that
206
+ literally spells `(None)` stays a different group (objectui#4508).
207
+
208
+ objectui#4020's three-level measure display name still outranks the label the
209
+ derivation assigns, including for an `{ en, 'zh-CN' }` label record: core holds
210
+ no i18n provider and picks first-string-wins, which is exactly the defect class
211
+ #4020 closed.
212
+
213
+ A report whose chart has no null group is unchanged, byte for byte.
214
+ - Updated dependencies [88085e3]
215
+ - Updated dependencies [69251bf]
216
+ - Updated dependencies [57e668f]
217
+ - Updated dependencies [516663d]
218
+ - Updated dependencies [41ac1b7]
219
+ - Updated dependencies [1eaf0a1]
220
+ - Updated dependencies [a09bc33]
221
+ - Updated dependencies [feb6b16]
222
+ - Updated dependencies [460c4d0]
223
+ - Updated dependencies [0ae27f7]
224
+ - Updated dependencies [9aecabe]
225
+ - Updated dependencies [2533ec5]
226
+ - Updated dependencies [78c0f9a]
227
+ - Updated dependencies [bbe8b86]
228
+ - Updated dependencies [8477be5]
229
+ - Updated dependencies [279fb13]
230
+ - Updated dependencies [2e82ab2]
231
+ - Updated dependencies [ad07b65]
232
+ - Updated dependencies [41f498b]
233
+ - Updated dependencies [ef0d150]
234
+ - Updated dependencies [f34226e]
235
+ - Updated dependencies [564b605]
236
+ - Updated dependencies [e1d4251]
237
+ - Updated dependencies [40d3a33]
238
+ - Updated dependencies [8b9dc62]
239
+ - Updated dependencies [1184192]
240
+ - Updated dependencies [a2a9747]
241
+ - Updated dependencies [65e88e6]
242
+ - Updated dependencies [a1609a6]
243
+ - Updated dependencies [53f23bc]
244
+ - Updated dependencies [c4533dc]
245
+ - Updated dependencies [be60815]
246
+ - Updated dependencies [37f6844]
247
+ - Updated dependencies [93de4f6]
248
+ - Updated dependencies [2b50261]
249
+ - Updated dependencies [384f30d]
250
+ - Updated dependencies [ac600e5]
251
+ - Updated dependencies [97fba31]
252
+ - Updated dependencies [232f61a]
253
+ - Updated dependencies [d374caf]
254
+ - Updated dependencies [5673576]
255
+ - Updated dependencies [c1ef923]
256
+ - Updated dependencies [911ceaa]
257
+ - Updated dependencies [98eab36]
258
+ - Updated dependencies [375efb4]
259
+ - Updated dependencies [af5e292]
260
+ - Updated dependencies [3fbbea1]
261
+ - Updated dependencies [0bffb18]
262
+ - Updated dependencies [3e0214c]
263
+ - Updated dependencies [800f455]
264
+ - Updated dependencies [dbbd38a]
265
+ - Updated dependencies [27c9cbd]
266
+ - Updated dependencies [5458414]
267
+ - Updated dependencies [3241559]
268
+ - Updated dependencies [7f96b10]
269
+ - Updated dependencies [167ec42]
270
+ - Updated dependencies [616a2a5]
271
+ - Updated dependencies [6c68b13]
272
+ - Updated dependencies [0046d8f]
273
+ - Updated dependencies [f1d4748]
274
+ - Updated dependencies [bea374e]
275
+ - Updated dependencies [b1119ec]
276
+ - Updated dependencies [5607092]
277
+ - Updated dependencies [9f23d2b]
278
+ - Updated dependencies [b4089be]
279
+ - Updated dependencies [578e025]
280
+ - Updated dependencies [b4bccc7]
281
+ - Updated dependencies [af025ee]
282
+ - Updated dependencies [d109a4d]
283
+ - Updated dependencies [598c89a]
284
+ - Updated dependencies [4a0bd17]
285
+ - Updated dependencies [b8b9af4]
286
+ - Updated dependencies [31676be]
287
+ - Updated dependencies [8c0d52e]
288
+ - Updated dependencies [b29488f]
289
+ - Updated dependencies [9fbb9b5]
290
+ - Updated dependencies [90517e1]
291
+ - Updated dependencies [aff10e2]
292
+ - Updated dependencies [70a774b]
293
+ - Updated dependencies [9ce096f]
294
+ - Updated dependencies [e05db88]
295
+ - Updated dependencies [7458a41]
296
+ - Updated dependencies [ad13d63]
297
+ - Updated dependencies [5ffcc14]
298
+ - Updated dependencies [d971e51]
299
+ - Updated dependencies [97abb24]
300
+ - Updated dependencies [deb157a]
301
+ - Updated dependencies [9c60144]
302
+ - Updated dependencies [e7747f1]
303
+ - Updated dependencies [d2ce342]
304
+ - Updated dependencies [9695da7]
305
+ - Updated dependencies [ac2f332]
306
+ - Updated dependencies [a777058]
307
+ - Updated dependencies [75444e3]
308
+ - Updated dependencies [58b8346]
309
+ - Updated dependencies [2d0bd16]
310
+ - Updated dependencies [a9e17b4]
311
+ - Updated dependencies [b8ce7dc]
312
+ - Updated dependencies [dad51e5]
313
+ - Updated dependencies [1c9c342]
314
+ - Updated dependencies [787c738]
315
+ - Updated dependencies [8396656]
316
+ - Updated dependencies [dbbd38a]
317
+ - Updated dependencies [2165d88]
318
+ - Updated dependencies [8871c14]
319
+ - Updated dependencies [93fe362]
320
+ - Updated dependencies [dfc6975]
321
+ - Updated dependencies [3cf4de0]
322
+ - Updated dependencies [c9dc811]
323
+ - Updated dependencies [144ef9b]
324
+ - Updated dependencies [138ab04]
325
+ - Updated dependencies [a0b9e91]
326
+ - Updated dependencies [99bd015]
327
+ - Updated dependencies [21e4585]
328
+ - @object-ui/types@17.6.0
329
+ - @object-ui/fields@17.6.0
330
+ - @object-ui/i18n@17.6.0
331
+ - @object-ui/react@17.6.0
332
+ - @object-ui/plugin-grid@17.6.0
333
+ - @object-ui/components@17.6.0
334
+ - @object-ui/core@17.6.0
335
+
3
336
  ## 17.5.0
4
337
 
5
338
  ### Patch Changes