@masterteam/dashboard-builder 0.0.58 → 0.0.60

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/README.md CHANGED
@@ -1,231 +1,343 @@
1
- # @masterteam/dashboard-builder
2
-
3
- Dashboard Builder components and services for Angular 21+ with Tailwind CSS 4.
4
- The package supports authoring, saving, loading, and rendering dashboards with
5
- charts, header widgets, topbar widgets, metadata-driven data sources, source
6
- links, and responsive ECharts output.
7
-
8
- ## Features
9
-
10
- - Multilingual dashboard item titles stored as `clientConfig.title.en/ar`.
11
- - Header, topbar, and chart item title editing in builder mode.
12
- - Host-interceptor-owned save messages, with automatic saves marked silent.
13
- - Registry-driven chart query schemas, including safe preview states for
14
- incomplete draft charts.
15
- - Stacked-bar query fields switch between auto-stack and manual-stack modes so
16
- only the relevant stack property selector is displayed and emitted.
17
- - Quick Manage style changes stay local in the drawer until Apply, with an
18
- isolated Preview tab for checking the edited chart config before the dashboard
19
- canvas is updated.
20
- - Chart header icons provide preset-based appearance and placement controls,
21
- including independent standalone/group visibility and grouped icon-only mode.
22
- - Timeline multi-level queries persist per-level `extraProperties` and still
23
- read legacy `extras` fields. Open timeline detail popovers close when the
24
- page, dashboard, or timeline scrolls outside the overlay, while the detail
25
- panel's own scrolling remains available.
26
- - PhaseGate Table uses a dedicated semantic-role editor and sends every
27
- configured runtime property in one deduplicated backend projection.
28
- - Ring Gauge with Formula accepts either `valueProperty` or `formula` for each
29
- series, exposes no Group By or Extra Properties controls, and renders legacy
30
- `values[].bars[]` responses through the concentric-ring gauge adapter.
31
- - Every GeneralQuery capability that includes `formula` exposes a visible
32
- per-series Show/Hide advanced settings action and a Formula Builder scoped to
33
- that series; formula availability is schema-driven rather than chart-specific.
34
- - Selected-property chips in dashboard query editors can be removed inline.
35
- - Properties/card-list items normalize null Percentage values to `0` with an
36
- empty progress track and never inherit a sibling card's runtime percentage.
37
- - Duplicated charts receive a new local dashboard identity, omit the source
38
- link/component IDs so the next save creates a new backend chart, and persist
39
- `duplicatedFrom` as provenance to the source dashboard identity.
40
- - Workspace-aware metadata loading for modules and properties.
41
- - A dedicated chart Filters action separates viewer-facing filter controls and
42
- built-in conditions from datasource configuration, using shared `mt-*` form
43
- fields throughout the condition editor.
44
- - Navigation actions expose a `Navigation Target` selector. Both page and
45
- entity navigation default to the current tab and can explicitly open in a
46
- new tab through `action.config.navigationTarget`.
47
- - Progress Update cards render activity HTML through ngx-quill's read-only
48
- renderer, preserving the rich-text size, color, font, alignment, direction,
49
- and semantic formatting configured in the source editor.
50
- - Persisted dashboards can be deleted from the page-settings drawer after a
51
- named, danger-styled confirmation; successful deletion returns the host to
52
- its dashboard list while standalone builders keep deletion unavailable.
53
- - Module multi-select serialized as selectors such as `Level:1,2,3`.
54
- - Source-link chaining with previous result fields, relationship fields, and the
55
- `Parent` option exposed to child-level configuration.
56
- - Distinct aggregation normalization from legacy `DisticntCount` to
57
- `DistinctCount`.
58
- - Container-aware ECharts option mapping for compact dashboard grid cells,
59
- including shared legend placement for donut, pie, bar, line, stacked bar, and
60
- other ECharts-based charts. Pie/donut radius, center, and slice-label geometry
61
- stay handler-owned to match the old dashboard builder; the shared EChart
62
- wrapper reserves the same chart area as the old wrapper and does not apply
63
- pie-specific responsive overrides. Native ECharts legend rendering stays
64
- authoritative; the wrapper maps legend dimensions before grid offsets and
65
- clamps saved percentage grid values against the current card pixels so stacked
66
- bar legends keep reserved space after resize. Donut slice labels are hidden so
67
- category names stay in the legend instead of being drawn over the ring. Pie
68
- legend vertical alignment applies only to left/right legends, so old saved
69
- vertical-align values do not move the default bottom legend into the chart
70
- body. Compact bar and line charts preserve their configured value-label
71
- visibility instead of hiding labels when the card height crosses a responsive
72
- breakpoint.
73
-
74
- ## Installation
75
-
76
- ```bash
77
- pnpm add @masterteam/dashboard-builder
78
- ```
79
-
80
- ## Usage
81
-
82
- ```typescript
83
- import { Component } from "@angular/core";
84
- import { DashboardBuilder } from "@masterteam/dashboard-builder";
85
-
86
- @Component({
87
- imports: [DashboardBuilder],
88
- template: ` <mt-dashboard-builder [services]="['pplus', 'splus']" (onSave)="saveDashboard()" /> `,
89
- })
90
- export class MyComponent {
91
- saveDashboard(): void {
92
- // React to a completed explicit save.
93
- }
94
- }
95
- ```
96
-
97
- ## Metadata Contract
98
-
99
- Hosts must provide the dashboard metadata endpoints used by
100
- `DashboardBuilderService`:
101
-
102
- - `GET metadata/workspaces` returns workspace options:
103
- `WorkspaceOption { id: string | number; name: string }`.
104
- - `GET metadata/modules/tree` accepts `services`, `workspaceId`, and
105
- `includeValues`. Returned module groups, items, and values may include
106
- `workspaceId` for client-side filtering.
107
- - `POST metadata/modules/properties` accepts `items` and optional
108
- `workspaceId`. Each request item may also include `workspaceId`.
109
-
110
- When a workspace changes, the builder clears selections and source links that no
111
- longer belong to the selected workspace.
112
-
113
- ## Host Currency Settings Contract
114
-
115
- Dashboard currency labels, tooltips, and values read the host's canonical
116
- `systemSettings.settings` local-storage entry. The stored value must be a
117
- JSON-encoded array containing a case-sensitive `Currency` key whose `value`
118
- provides the currency code, localized units, and numeric format:
119
-
120
- ```typescript
121
- localStorage.setItem(
122
- "systemSettings.settings",
123
- JSON.stringify([
124
- {
125
- key: "Currency",
126
- value: {
127
- name: "OMR",
128
- unit: {
129
- en: "OMR",
130
- ar: "ريال عماني",
131
- },
132
- format: "{0:N3}",
133
- },
134
- },
135
- ]),
136
- );
137
- ```
138
-
139
- Runtime currency precedence is:
140
-
141
- 1. The valid `Currency` entry in `systemSettings.settings`.
142
- 2. The legacy JSON object stored under `currency` (its `unit` string).
143
- 3. The built-in SAR unit and legacy number formatting.
144
-
145
- Arabic dashboards (including regional language codes such as `ar-SA`) use
146
- `value.unit.ar`; every other language uses `value.unit.en`. Supported system
147
- formats include decimal/grouping patterns such as `{0:#,0.00}`, compact
148
- thousands such as `{0:#,0, K}`, and named decimal patterns such as `{0:N3}`.
149
- The host currency format is authoritative; a chart's legacy decimal option does
150
- not override its decimal count.
151
-
152
- The showcase's opt-in offline dashboard fixture
153
- (`showcase-mock-dashboard-builder=1`) appends the OMR example above only when
154
- the settings array has no `Currency` entry, so an existing host choice remains
155
- authoritative.
156
-
157
- ## PhaseGate Table Query Contract
158
-
159
- `2-table-view` does not use the generic table pivot/aggregation query. Its
160
- canonical service query is:
161
-
162
- ```typescript
163
- {
164
- rowIdentityProperty: string;
165
- phaseNameProperty: string;
166
- phaseIdProperty: string;
167
- phaseOrderProperty: string;
168
- phaseStatusProperty: string;
169
- phaseProgressProperty: string;
170
- phaseIsCurrentProperty: string;
171
- phaseIsCompletedProperty: string;
172
- phaseAllItemsCompletedProperty: string;
173
- baseProperties: string[];
174
- properties: string[];
175
- selectedProperties: string[];
176
- }
177
- ```
178
-
179
- `baseProperties` is the ordered multi-select of visible business columns. Both
180
- `properties` and `selectedProperties` are rebuilt before save/request as the
181
- same deduplicated union of those columns and every non-empty semantic role, so
182
- the chart service receives all fields needed by the renderer.
183
-
184
- The runtime resolves configured roles by property identity, matching the row
185
- object key or wrapper `key`, `normalizedKey`, `label`, or `name` without
186
- depending on response order. Consequently a visible project Status and the
187
- phase Status can coexist safely. Legacy generic-table configs are still read;
188
- `lookupProperty` becomes the phase-status role, with conservative runtime
189
- fallbacks until the remaining roles are configured and saved.
190
-
191
- ## Compatibility Notes
192
-
193
- - Saved selectors remain backward-compatible with legacy `moduleType/moduleId`
194
- values and comma-based module ids.
195
- - Existing multilingual title objects are preserved. Plain string titles are
196
- normalized to the active title object shape.
197
- - The builder does not show save toasts directly. Save response messages belong
198
- to the host HTTP interceptor; automatic/internal save requests are sent with
199
- `noMessage: true`.
200
- - Aggregation requests normalize legacy `DisticntCount` values to
201
- `DistinctCount`; backends should accept both names and execute distinct-count
202
- semantics.
203
- - Table-card status legends support both grouped and flat label payloads,
204
- display legacy `label` text alongside the color indicator, and expose
205
- visibility plus per-entry order/color controls in Style Studio for Table,
206
- Dialog Table, and PhaseGate Table items.
207
- - `ChartDataService.clearCache(dashboardId?)` clears `LimitedHttpService`
208
- cache entries by chart item id (`serviceConfig.dashboardId`) when an id is
209
- passed, or clears all chart responses when omitted. Scoped clears also bypass
210
- matching in-flight requests so the next fetch cannot reuse stale data after a
211
- host create/edit/delete action.
212
- - `DashboardViewer.reloadPage()` is a host-facing mutation refresh API: it
213
- clears the dashboard chart HTTP cache before triggering all chart items, so
214
- calls such as `viewer()?.reloadPage()` always send fresh backend requests.
215
-
216
- ## Development
217
-
218
- ```bash
219
- # Build only the dashboard-builder package
220
- pnpm build:db
221
-
222
- # Focused tests for changed specs
223
- pnpm --filter @masterteam/dashboard-builder test -- --watch=false --include=<path>.spec.ts
224
- ```
225
-
226
- Do not use the full `@masterteam/components` build for routine component work
227
- unless the caller explicitly approves it.
228
-
229
- ## License
230
-
231
- MIT
1
+ # @masterteam/dashboard-builder
2
+
3
+ Dashboard Builder components and services for Angular 21+ with Tailwind CSS 4.
4
+ The package supports authoring, saving, loading, and rendering dashboards with
5
+ charts, header widgets, topbar widgets, metadata-driven data sources, source
6
+ links, and responsive ECharts output.
7
+
8
+ ## Features
9
+
10
+ - Multilingual dashboard item titles stored as `clientConfig.title.en/ar`.
11
+ - Header, topbar, and chart item title editing in builder mode.
12
+ - Host-interceptor-owned save messages, with automatic saves marked silent.
13
+ - Registry-driven chart query schemas, including safe preview states for
14
+ incomplete draft charts.
15
+ - Stacked-bar query fields switch between auto-stack and manual-stack modes so
16
+ only the relevant stack property selector is displayed and emitted.
17
+ - Quick Manage style changes stay local in the drawer until Apply, with an
18
+ isolated Preview tab for checking the edited chart config before the dashboard
19
+ canvas is updated.
20
+ - Chart header icons provide preset-based appearance and placement controls,
21
+ including independent standalone/group visibility and grouped icon-only mode.
22
+ - Timeline multi-level queries persist per-level `extraProperties` and still
23
+ read legacy `extras` fields. Open timeline detail popovers close when the
24
+ page, dashboard, or timeline scrolls outside the overlay, while the detail
25
+ panel's own scrolling remains available.
26
+ - PhaseGate Table uses a dedicated semantic-role editor and sends every
27
+ configured runtime property in one deduplicated backend projection.
28
+ - Ring Gauge with Formula accepts either `valueProperty` or `formula` for each
29
+ series, exposes no Group By or Extra Properties controls, and renders legacy
30
+ `values[].bars[]` responses through the concentric-ring gauge adapter.
31
+ - Every GeneralQuery capability that includes `formula` exposes a visible
32
+ per-series Show/Hide advanced settings action and a Formula Builder scoped to
33
+ that series; formula availability is schema-driven rather than chart-specific.
34
+ - Selected-property chips in dashboard query editors can be removed inline.
35
+ - Properties/card-list items normalize null Percentage values to `0` with an
36
+ empty progress track and never inherit a sibling card's runtime percentage.
37
+ - Duplicated charts receive a new local dashboard identity, omit the source
38
+ link/component IDs so the next save creates a new backend chart, and persist
39
+ `duplicatedFrom` as provenance to the source dashboard identity.
40
+ - Workspace-aware metadata loading for modules and properties.
41
+ - A dedicated chart Filters action separates viewer-facing filter controls and
42
+ built-in conditions from datasource configuration, using shared `mt-*` form
43
+ fields throughout the condition editor.
44
+ - Navigation actions expose a `Navigation Target` selector. Both page and
45
+ entity navigation default to the current tab and can explicitly open in a
46
+ new tab through `action.config.navigationTarget`.
47
+ - Progress Update cards render activity HTML through ngx-quill's read-only
48
+ renderer, preserving the rich-text size, color, font, alignment, direction,
49
+ and semantic formatting configured in the source editor.
50
+ - Persisted dashboards can be deleted from the page-settings drawer after a
51
+ named, danger-styled confirmation; successful deletion returns the host to
52
+ its dashboard list while standalone builders keep deletion unavailable.
53
+ - Module multi-select serialized as selectors such as `Level:1,2,3`.
54
+ - Source-link chaining with previous result fields, relationship fields, and the
55
+ `Parent` option exposed to child-level configuration.
56
+ - Distinct aggregation normalization from legacy `DisticntCount` to
57
+ `DistinctCount`.
58
+ - Container-aware ECharts option mapping for compact dashboard grid cells,
59
+ including shared legend placement for donut, pie, bar, line, stacked bar, and
60
+ other ECharts-based charts. Pie/donut radius, center, and slice-label geometry
61
+ stay handler-owned to match the old dashboard builder; the shared EChart
62
+ wrapper reserves the same chart area as the old wrapper and does not apply
63
+ pie-specific responsive overrides. Native ECharts legend rendering stays
64
+ authoritative; the wrapper maps legend dimensions before grid offsets and
65
+ clamps saved percentage grid values against the current card pixels so stacked
66
+ bar legends keep reserved space after resize. Donut slice labels are hidden so
67
+ category names stay in the legend instead of being drawn over the ring. Pie
68
+ legend vertical alignment applies only to left/right legends, so old saved
69
+ vertical-align values do not move the default bottom legend into the chart
70
+ body. Compact bar and line charts preserve their configured value-label
71
+ visibility instead of hiding labels when the card height crosses a responsive
72
+ breakpoint.
73
+
74
+ ## Installation
75
+
76
+ ```bash
77
+ pnpm add @masterteam/dashboard-builder
78
+ ```
79
+
80
+ ## Usage
81
+
82
+ ```typescript
83
+ import { Component } from "@angular/core";
84
+ import { DashboardBuilder } from "@masterteam/dashboard-builder";
85
+
86
+ @Component({
87
+ imports: [DashboardBuilder],
88
+ template: ` <mt-dashboard-builder [services]="['pplus', 'splus']" (onSave)="saveDashboard()" /> `,
89
+ })
90
+ export class MyComponent {
91
+ saveDashboard(): void {
92
+ // React to a completed explicit save.
93
+ }
94
+ }
95
+ ```
96
+
97
+ ## Metadata Contract
98
+
99
+ Hosts must provide the dashboard metadata endpoints used by
100
+ `DashboardBuilderService`:
101
+
102
+ - `GET metadata/workspaces` returns workspace options:
103
+ `WorkspaceOption { id: string | number; name: string }`.
104
+ - `GET metadata/modules/tree` accepts `services`, `workspaceId`, and
105
+ `includeValues`. Returned module groups, items, and values may include
106
+ `workspaceId` for client-side filtering.
107
+ - `POST metadata/modules/properties` accepts `items` and optional
108
+ `workspaceId`. Each request item may also include `workspaceId`.
109
+
110
+ When a workspace changes, the builder clears selections and source links that no
111
+ longer belong to the selected workspace.
112
+
113
+ ## Snapshot Query Contract
114
+
115
+ Snapshot charts distinguish the selected Level schema from the concrete Level
116
+ record whose history is requested:
117
+
118
+ ```typescript
119
+ interface SnapshotQuery {
120
+ workspaceSelector?: string | null;
121
+ levelId: number; // schema id used to load record options
122
+ levelDataId: number; // record id sent to GetSnapShotInfo
123
+ snapshotTargetVersion: 2; // prevents schema ids from using the legacy fallback
124
+ timeFrame: "yearly" | "monthly" | "weekly";
125
+ year: number | "{{currentYear}}";
126
+ getAveragePerPeriod?: boolean;
127
+ selectedProperties: string[];
128
+ }
129
+ ```
130
+
131
+ After a Level is selected, the builder requests its records through
132
+ `POST fetch/query` with:
133
+
134
+ ```typescript
135
+ {
136
+ contextKey: `level:${levelId}`;
137
+ projection: "Card";
138
+ display: {
139
+ areas: ["card"];
140
+ }
141
+ }
142
+ ```
143
+
144
+ This authoring request deliberately omits `includeState`. Record options map
145
+ directly from `data.records[].id/name`. Runtime calls
146
+ `POST dashboards/{apiVersion}GetSnapShotInfo/{levelDataId}/{timeFrame}?year={year}`
147
+ with `{ AvgPerPeriod, dashboardId }`; the schema `levelId` must not be used in
148
+ that URL. Supported selected-property
149
+ keys are `plannedProgress`, `actualProgress`, `budget`, `baselineProgress`,
150
+ `spent`, `remaining`, and `paymentPlan`.
151
+
152
+ ## Axis Label Wrapping Contract
153
+
154
+ Bar and stacked-bar category labels preserve their original casing and wrap
155
+ normal spaces, underscores, existing line breaks, and single tokens that exceed
156
+ the selected character limit. Runtime keeps all generated lines visible and
157
+ sets `hideOverlap: false`; the shared ECharts responsive layout still owns the
158
+ available label width and grid containment.
159
+
160
+ The persisted controls live under `clientConfig.barConfigOverride` and
161
+ `clientConfig.stackBarConfigOverride`:
162
+
163
+ ```typescript
164
+ {
165
+ axisLabelWrapMode: "characters" | "words" | "none";
166
+ maxCharsPerLine?: 8 | 12 | 16 | 20 | 24 | 30 | 40;
167
+ maxWordsPerLine?: 1 | 2 | 3 | 4 | 5 | 6;
168
+ }
169
+ ```
170
+
171
+ Missing mode values use character wrapping, so old dashboards that only saved
172
+ `maxCharsPerLine` remain compatible. The default is 20 characters per line;
173
+ word mode defaults to three words per line. `none` normalizes separators but
174
+ keeps the label on one line.
175
+
176
+ ## Host Currency Settings Contract
177
+
178
+ Dashboard currency labels, tooltips, and values read the host's canonical
179
+ `systemSettings.settings` local-storage entry. The stored value must be a
180
+ JSON-encoded array containing a case-sensitive `Currency` key whose `value`
181
+ provides the currency code, localized units, and numeric format:
182
+
183
+ ```typescript
184
+ localStorage.setItem(
185
+ "systemSettings.settings",
186
+ JSON.stringify([
187
+ {
188
+ key: "Currency",
189
+ value: {
190
+ name: "OMR",
191
+ unit: {
192
+ en: "OMR",
193
+ ar: "ريال عماني",
194
+ },
195
+ format: "{0:N3}",
196
+ },
197
+ },
198
+ ]),
199
+ );
200
+ ```
201
+
202
+ Runtime currency precedence is:
203
+
204
+ 1. The valid `Currency` entry in `systemSettings.settings`.
205
+ 2. The legacy JSON object stored under `currency` (its `unit` string).
206
+ 3. The built-in SAR unit and legacy number formatting.
207
+
208
+ Arabic dashboards (including regional language codes such as `ar-SA`) use
209
+ `value.unit.ar`; every other language uses `value.unit.en`. Supported system
210
+ formats include decimal/grouping patterns such as `{0:#,0.00}`, compact
211
+ thousands such as `{0:#,0, K}`, and named decimal patterns such as `{0:N3}`.
212
+ The host currency format is authoritative; a chart's legacy decimal option does
213
+ not override its decimal count.
214
+
215
+ The showcase's opt-in offline dashboard fixture
216
+ (`showcase-mock-dashboard-builder=1`) appends the OMR example above only when
217
+ the settings array has no `Currency` entry, so an existing host choice remains
218
+ authoritative.
219
+
220
+ ## PhaseGate Table Query Contract
221
+
222
+ `2-table-view` does not use the generic table pivot/aggregation query. Its
223
+ canonical service query is:
224
+
225
+ ```typescript
226
+ {
227
+ rowIdentityProperty: string;
228
+ phaseNameProperty: string;
229
+ phaseIdProperty: string;
230
+ phaseOrderProperty: string;
231
+ phaseStatusProperty: string;
232
+ phaseProgressProperty: string;
233
+ phaseIsCurrentProperty: string;
234
+ phaseIsCompletedProperty: string;
235
+ phaseAllItemsCompletedProperty: string;
236
+ baseProperties: string[];
237
+ properties: string[];
238
+ selectedProperties: string[];
239
+ }
240
+ ```
241
+
242
+ `baseProperties` is the ordered multi-select of visible business columns. Both
243
+ `properties` and `selectedProperties` are rebuilt before save/request as the
244
+ same deduplicated union of those columns and every non-empty semantic role, so
245
+ the chart service receives all fields needed by the renderer.
246
+
247
+ The runtime resolves configured roles by property identity, matching the row
248
+ object key or wrapper `key`, `normalizedKey`, `label`, or `name` without
249
+ depending on response order. Consequently a visible project Status and the
250
+ phase Status can coexist safely. Legacy generic-table configs are still read;
251
+ `lookupProperty` becomes the phase-status role, with conservative runtime
252
+ fallbacks until the remaining roles are configured and saved.
253
+
254
+ ## Runtime Filter Contract
255
+
256
+ Dashboard filters have two independent scopes:
257
+
258
+ - Page/general filter definitions live in the dashboard configuration's
259
+ `filters` collection. The viewer supplies their applied values to every item;
260
+ request templates consume the keys they reference, and an item can explicitly
261
+ ignore the page query-filter scope. The viewer opens a default-closed shared
262
+ MT drawer from its in-flow Manage Filters action, so the host does not need a
263
+ fixed sidebar or overlay CSS.
264
+ - Chart filter definitions live canonically in
265
+ `clientConfig.dynamicFilters`. Legacy
266
+ `clientConfig.extraFilters.dynamicFilters` is read and migrated when the chart
267
+ is edited. Runtime values are stored per widget identity and override a page
268
+ value with the same key for that widget only.
269
+
270
+ Both drawers edit a private draft. Apply commits and refreshes the relevant
271
+ scope; closing without Apply discards the draft. Clear replaces only the keys
272
+ owned by that drawer's field set: optional values are removed, required
273
+ non-date values remain selected, and static chart conditions plus the other
274
+ runtime scope are preserved. `false` and `0` are valid applied values rather
275
+ than empty values. Drawer ownership follows the viewer/widget lifecycle, so an
276
+ open body-appended drawer is closed when its owner is destroyed and cannot
277
+ commit into a stale chart store.
278
+
279
+ Compatibility key mapping follows the original dashboard builder while keeping
280
+ each scope's natural runtime types:
281
+
282
+ - page/query values serialize multi-selects as comma-delimited strings, users
283
+ as the id under `key` plus the display name under `<key>Name`, checkboxes as
284
+ `"true"`/`"false"`, and quarters under `<key>S` plus `<key>E`;
285
+ - chart item-store values keep multi-selects as arrays, checkboxes as booleans,
286
+ users as `{ userId, displayName }` objects (or arrays of those objects), and
287
+ quarters as the combined `start,end` value under the base key;
288
+ - Clear owns every compatibility key for its field: users own `key` and
289
+ `<key>Name`, while quarters own `key`, `<key>S`, and `<key>E`.
290
+
291
+ Request substitution accepts both representations. Page values are merged
292
+ first and a chart's typed item-store values win only for that widget.
293
+
294
+ The parent report id (`pageId`) is the request execution context. A chart's
295
+ `serviceConfig.dashboardId` remains its widget/store/cache identity and must not
296
+ replace the report id. Route query parameters, including a legitimate filter
297
+ named `id`, are never used as the report identity.
298
+
299
+ Dialog actions retain that report id and expose the merged page/chart context
300
+ both under `parentFilter` and as flat keys. This keeps current
301
+ `{{parentFilter.year}}` templates and legacy `{{year}}` templates compatible.
302
+
303
+ ## Compatibility Notes
304
+
305
+ - Saved selectors remain backward-compatible with legacy `moduleType/moduleId`
306
+ values and comma-based module ids.
307
+ - Existing multilingual title objects are preserved. Plain string titles are
308
+ normalized to the active title object shape.
309
+ - The builder does not show save toasts directly. Save response messages belong
310
+ to the host HTTP interceptor; automatic/internal save requests are sent with
311
+ `noMessage: true`.
312
+ - Aggregation requests normalize legacy `DisticntCount` values to
313
+ `DistinctCount`; backends should accept both names and execute distinct-count
314
+ semantics.
315
+ - Table-card status legends support both grouped and flat label payloads,
316
+ display legacy `label` text alongside the color indicator, and expose
317
+ visibility plus per-entry order/color controls in Style Studio for Table,
318
+ Dialog Table, and PhaseGate Table items.
319
+ - `ChartDataService.clearCache(dashboardId?)` clears `LimitedHttpService`
320
+ cache entries by chart item id (`serviceConfig.dashboardId`) when an id is
321
+ passed, or clears all chart responses when omitted. Scoped clears also bypass
322
+ matching in-flight requests so the next fetch cannot reuse stale data after a
323
+ host create/edit/delete action.
324
+ - `DashboardViewer.reloadPage()` is a host-facing mutation refresh API: it
325
+ clears the dashboard chart HTTP cache before triggering all chart items, so
326
+ calls such as `viewer()?.reloadPage()` always send fresh backend requests.
327
+
328
+ ## Development
329
+
330
+ ```bash
331
+ # Build only the dashboard-builder package
332
+ pnpm build:db
333
+
334
+ # Focused tests for changed specs
335
+ pnpm --filter @masterteam/dashboard-builder test -- --watch=false --include=<path>.spec.ts
336
+ ```
337
+
338
+ Do not use the full `@masterteam/components` build for routine component work
339
+ unless the caller explicitly approves it.
340
+
341
+ ## License
342
+
343
+ MIT