@object-ui/plugin-report 4.2.1 → 4.3.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,171 @@
1
1
  # @object-ui/plugin-report
2
2
 
3
+ ## 4.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f196cf4: feat(plugin-report): popup picker for groupings + section-aware test ids
8
+
9
+ The matrix/summary "Group by" (rows) and "Columns axis" (cols) sections now
10
+ share the same searchable popup picker as the columns section, with a
11
+ commit-on-select single-pick mode wired through `FieldPickerDialog`.
12
+ - Per-row field buttons display the human-readable field label and open a
13
+ dialog scoped to swap that single field (already-used fields filtered out)
14
+ - "Add grouping" trigger uses the same dialog
15
+ - `GroupingsBuilder` accepts a `testIdPrefix` prop; ReportConfigPanel passes
16
+ `rows-grouping` and `cols-grouping` so both instances no longer share the
17
+ ambiguous `grouping-field-0` testid
18
+ - Bigger row spacing (h-7 / text-xs) — the old `text-[10px]` was unreadable
19
+
20
+ `FieldPickerDialog` gains:
21
+ - `commitOnSelect`: hides the Confirm/Cancel footer; clicking a row commits
22
+ - closes immediately (intended for `singleSelect` flows)
23
+ - `trigger`: custom trigger element override (used by the per-row field button)
24
+
25
+ - 079c3b2: feat(plugin-report): per-block field resolution for joined reports
26
+
27
+ Joined report blocks can override `objectName` to query a different
28
+ object than the container, but the editor was always offering the
29
+ container's fields — wrong field names, wrong types, broken granularity
30
+ and chart-axis filtering.
31
+
32
+ `ReportConfigPanel` now accepts an optional `getFieldsForObject`
33
+ resolver. `JoinedBlocksEditor` uses it to source fields for each
34
+ block based on `block.objectName ?? containerObjectName`, falling
35
+ back to the static `availableFields` when the resolver returns
36
+ `undefined` (unknown object).
37
+
38
+ `ReportView` wires the resolver against the app's loaded `objects`
39
+ list and reuses the same parsing path internally to derive its
40
+ top-level `availableFields`, removing the duplicated schema lookup.
41
+
42
+ 5 new RTL tests verify the resolver wiring, fallback behaviour,
43
+ add-block flow, and inline duplicate-name validation (111 plugin-report
44
+ tests green).
45
+
46
+ - ee1cc96: feat(plugin-report): joined-report block editor
47
+
48
+ `type: 'joined'` reports were a black hole in the editor — the type
49
+ selector exposed them but no UI knew how to edit the `blocks` array,
50
+ so users could neither create nor modify joined reports without
51
+ hand-editing JSON.
52
+
53
+ This change adds a `Blocks` section to the report editor, visible only
54
+ when `type === 'joined'`. Each block renders as a collapsible card with
55
+ its own name (required + unique-validated), label, description, block
56
+ type, object override, and reuses the existing `ColumnsEditor`,
57
+ `GroupingsBuilder`, `SpecFilterAdapter`, and `ChartConfig` builders so
58
+ every block behaves like a mini standalone report — matching the
59
+ runtime contract of `JoinedReportRenderer`.
60
+
61
+ Block-level validation is surfaced in the main `ValidationBanner`:
62
+ empty blocks array, missing or duplicate block names, and blocks
63
+ without columns all become editor-time errors so saves stay safe.
64
+
65
+ The non-joined sections (Columns / Rows / Columns axis / Filters /
66
+ Chart) are hidden when `type === 'joined'` since they live per-block
67
+ in the spec.
68
+
69
+ New exports from `@object-ui/plugin-report`:
70
+ - `JoinedBlocksEditor` — standalone component for embedding the
71
+ block editor anywhere.
72
+ - `validateJoinedBlocks` — pure helper returning translated
73
+ problem strings, suitable for custom validation banners.
74
+ - `ColumnsEditor`, `GroupingsBuilder`, `ChartConfig`,
75
+ `SpecFilterAdapter`, `normalizeColumns` are now exported so
76
+ downstream consumers can build their own report-editor surfaces.
77
+
78
+ i18n: added `report.editor.blocks*` / `report.editor.addBlock` /
79
+ `report.editor.removeBlock` / `report.editor.blockName*` /
80
+ `report.editor.blockLabel*` / `report.editor.blockDescription*` /
81
+ `report.editor.validationJoinedNeedsBlocks` /
82
+ `report.editor.validationBlockNameRequired` /
83
+ `report.editor.validationBlockNameDuplicate` /
84
+ `report.editor.validationBlockNeedsColumns` to en + zh.
85
+
86
+ - 0b032be: feat(plugin-report): replace inline column picker with a popup field picker
87
+
88
+ The columns section now opens a Dialog-based multi-select picker (`FieldPickerDialog`)
89
+ instead of rendering the unselected field list inline. The popup supports search,
90
+ batched multi-selection (commit several fields in one click), per-field type badges,
91
+ cancel-discards-pending semantics, and is fully i18n'd. Also fixes a latent
92
+ `ReferenceError: normalizeColumns is not defined` that crashed the editor whenever
93
+ the chart section was expanded.
94
+
95
+ - 4e7bc1b: **Report editor panel overhaul**
96
+
97
+ The report configuration panel is now safe to open on any spec-shape `Report` and only exposes fields that are actually persisted by `@objectstack/spec`.
98
+
99
+ `@object-ui/plugin-report`:
100
+ - Add a bidirectional `SpecFilterAdapter` so `ReportConfigPanel` can edit
101
+ spec `FilterCondition` filters (`{field: value}`, `{field: {$op: value}}`,
102
+ top-level `$and`/`$or`). Complex / nested filters fall back to a
103
+ read-only banner and are preserved verbatim on save.
104
+ - Drop sections that never round-tripped through the spec
105
+ (`conditionalFormatting`, `sections`, `export`, `schedule`, `appearance`)
106
+ and their helper components.
107
+ - Add type-driven section visibility: `tabular` shows Columns/Filters,
108
+ `summary` adds Rows + Chart, `matrix` adds Rows + Columns axis + Chart.
109
+ - New `GroupingsBuilder` covers `groupingsDown`/`groupingsAcross` with
110
+ `sortOrder` and date-aware `dateGranularity` controls.
111
+ - New `ColumnsEditor` lets users reorder picked columns, override labels,
112
+ set aggregates and choose a display format.
113
+ - Chart subset now mirrors the spec: chart `title`, `showLegend`,
114
+ `showDataLabels`, plus `funnel` (scatter removed).
115
+ - Validation banner highlights missing `objectName` and missing
116
+ rows/columns for `matrix`/`summary` reports.
117
+ - All editor labels and hints are i18n-driven (`report.editor.*`).
118
+ - 18 new unit tests cover the filter adapter round-trip.
119
+
120
+ `@object-ui/components`:
121
+ - `FilterBuilder` now guards against malformed external `value` props.
122
+ Previously a spec-shape filter (`{is_active: true}`) would crash the
123
+ component on first render; the builder now falls back to an empty
124
+ AND group whenever `value` is not a valid `FilterGroup`.
125
+
126
+ `@object-ui/i18n`:
127
+ - Add `report.editor.*` strings to `en` and `zh`.
128
+
129
+ - 8442c05: Improve report editor panel usability based on real-user browser testing:
130
+ - **Wider config panel** — the report editor now defaults to a `--config-panel-width`
131
+ of 440px (up from 280px), driven by a new optional `style` prop on
132
+ `ConfigPanelRenderer`. Long field labels, report titles, type labels, and filter
133
+ rows no longer truncate to "Account Na" / "kup" / "ct" / 1-character widths.
134
+ - **Disambiguated "Columns" sections** — for `summary` and `matrix` reports the
135
+ measure list is now labelled **"Values / 度量"** (pivot-style vocabulary) instead
136
+ of "Columns", which previously clashed with the matrix's pivot column axis
137
+ (also called "Columns / 列"). The two sections used to be indistinguishable.
138
+ New i18n key `report.editor.values` / `valuesHint` is shipped for all 10
139
+ locales (en, zh, ar, de, es, fr, ja, ko, pt, ru).
140
+ - **Reordered sections for matrix/summary** — the editor now surfaces _Rows_
141
+ and _Columns_ (the pivot axes) **before** _Values_, mirroring how a business
142
+ user thinks about a pivot table.
143
+ - **Per-row aggregate/format headers** — each column row in `ColumnsEditor` now
144
+ shows small "Aggregate" / "Format" labels above the respective selects, and
145
+ the row uses a 2-line layout so the label input has its own line. The cramped
146
+ 3-dropdowns-side-by-side layout at 10px font is gone.
147
+ - **Searchable field picker** — the "Add columns" list now has a search box,
148
+ a `filtered / total` counter, an empty-state message, and a scrollable bordered
149
+ container. New i18n keys: `report.editor.searchFields`,
150
+ `report.editor.noMatchingFields`.
151
+
152
+ ### Patch Changes
153
+
154
+ - 12c3b7c: refactor(plugin-report): split ReportConfigPanel.tsx (~1200 lines) into per-builder modules. The orchestrator file now only hosts `buildReportSchema`, `ValidationBanner`, and the public `ReportConfigPanel` component; each sub-editor (`SpecFilterAdapter`, `ColumnsEditor`, `GroupingsBuilder`, `ChartConfig`) lives in its own file alongside `editorTypes.ts` for shared types/constants. All existing exports are re-exported from `ReportConfigPanel` so test files and downstream consumers (`JoinedBlocksEditor`, `app-shell`) keep their current import paths. Pure refactor — no behavior change, 111 tests green.
155
+ - Updated dependencies [f196cf4]
156
+ - Updated dependencies [ee1cc96]
157
+ - Updated dependencies [0b032be]
158
+ - Updated dependencies [115d36a]
159
+ - Updated dependencies [4e7bc1b]
160
+ - Updated dependencies [8442c05]
161
+ - @object-ui/i18n@4.3.0
162
+ - @object-ui/components@4.3.0
163
+ - @object-ui/fields@4.3.0
164
+ - @object-ui/react@4.3.0
165
+ - @object-ui/plugin-grid@4.3.0
166
+ - @object-ui/types@4.3.0
167
+ - @object-ui/core@4.3.0
168
+
3
169
  ## 4.2.1
4
170
 
5
171
  ### Patch Changes