@masterteam/dashboard-builder 0.0.58 → 0.0.59
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 +231 -231
- package/assets/i18n/ar.json +1574 -1574
- package/assets/i18n/en.json +1299 -1299
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-DKzJqB0X.mjs → masterteam-dashboard-builder-dashboard-dialog.component-d6YRBVur.mjs} +2 -2
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-DKzJqB0X.mjs.map → masterteam-dashboard-builder-dashboard-dialog.component-d6YRBVur.mjs.map} +1 -1
- package/fesm2022/{masterteam-dashboard-builder-masterteam-dashboard-builder-F3nIcsti.mjs → masterteam-dashboard-builder-masterteam-dashboard-builder-DwxEWo4J.mjs} +306 -306
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-DwxEWo4J.mjs.map +1 -0
- package/fesm2022/masterteam-dashboard-builder.mjs +1 -1
- package/package.json +5 -5
- package/types/masterteam-dashboard-builder.d.ts +5 -5
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-F3nIcsti.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,231 +1,231 @@
|
|
|
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
|
+
## 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
|