@datalabz_/dashboard-kit 6.0.4 → 6.0.6
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 +63 -6
- package/package.json +1 -1
- package/v4.js +1 -1
- package/v5.js +1 -1
- package/v6.js +933 -41
- package/wrapper.css +47 -0
- package/wrapper.js +58 -2
package/README.md
CHANGED
|
@@ -53,6 +53,20 @@ A major's files are one served bundle; the repo's per-file line budget
|
|
|
53
53
|
(AGENTS.md #2) does not apply to it — it cannot be split without changing the
|
|
54
54
|
URLs already pinned by live dashboards.
|
|
55
55
|
|
|
56
|
+
## Filters from the parent
|
|
57
|
+
|
|
58
|
+
Any key in the `filters` of `CUSTOM_DASHBOARDS_PARAMS` other than `dateFrom`, `dateTo`, `timezone` and
|
|
59
|
+
`hierarchyId` is a header filter of the dashboard. At its first boot the kit writes the value into the
|
|
60
|
+
control with that `id` (for a radio group, the `name` its radios share), reads it back, and locks it. Later
|
|
61
|
+
messages never touch it. `null`, `undefined` and an empty string are errors, and so is a value the control
|
|
62
|
+
does not keep, such as an option that is not there, a date in the wrong format or text in a number field.
|
|
63
|
+
An error, or a key with no control, means the dashboard does not load: it says why and posts
|
|
64
|
+
`{ type: 'DK_FILTERS_REFUSED', message }` to its parent. It never opens unfiltered.
|
|
65
|
+
|
|
66
|
+
A select with no option but the empty one at boot gets its options from a query that runs later, so the
|
|
67
|
+
value cannot be checked against them. It goes in as an option of its own, selected, and stays selected
|
|
68
|
+
while the dashboard fills in the rest. A static select keeps the check.
|
|
69
|
+
|
|
56
70
|
## Asking a dashboard for its filters
|
|
57
71
|
|
|
58
72
|
A parent may post `{ type: 'DK_GET_FILTERS_INFO' }` to a dashboard's frame; the kit answers the parent with
|
|
@@ -62,7 +76,7 @@ what the kit can write into a header control at its first boot, one entry each:
|
|
|
62
76
|
|
|
63
77
|
```js
|
|
64
78
|
{ id: 'playerUsername', label: 'Player username', type: 'text', // type: the input's type, 'select' or 'textarea'
|
|
65
|
-
required: true,
|
|
79
|
+
required: true, defaultValue: '',
|
|
66
80
|
placeholder, min, max, // only when the control sets them
|
|
67
81
|
disabled: true, // only when it is disabled
|
|
68
82
|
multiple: false, optionsTotal: 2, // select only
|
|
@@ -71,17 +85,60 @@ what the kit can write into a header control at its first boot, one entry each:
|
|
|
71
85
|
|
|
72
86
|
The list follows the fill, so it holds only what a filter can actually be given:
|
|
73
87
|
|
|
74
|
-
- Left out: a control with no `id`, a second control with an `id` already listed, and
|
|
75
|
-
|
|
88
|
+
- Left out: a control with no `id`, a second control with an `id` already listed, and file, hidden,
|
|
89
|
+
password and button controls, which the kit refuses to fill.
|
|
90
|
+
- A radio group is one filter, keyed by the `name` its radios share (a radio with no name is left out): it
|
|
91
|
+
is listed once, labelled by its `<fieldset><legend>`, with the radios as `options`; filling it checks
|
|
92
|
+
the radio with that value and locks the group, and a value that is none of them is refused.
|
|
76
93
|
- A select lists only options with a value, since an empty value is refused, and `optionsTotal` counts
|
|
77
|
-
those. A select with none is
|
|
94
|
+
those. A select with none at boot is dynamic: its options come from a query that runs later, so it is
|
|
95
|
+
listed with `dynamicOptions: true` and no options, and takes any value (below).
|
|
78
96
|
- What exists when the dashboard boots is what counts. Once it has booted, the answer is the list taken
|
|
79
97
|
at that moment, so options a section loads later by query, and controls added later, are not in it, as
|
|
80
|
-
they were not there for the fill.
|
|
81
|
-
|
|
98
|
+
they were not there for the fill. Nothing is read again, so `defaultValue` is the value the dashboard starts with.
|
|
99
|
+
- A dynamic select cannot be checked against options that are not there yet. The value goes in as an
|
|
100
|
+
option of its own, selected, and stays selected while the dashboard fills in the rest: whatever
|
|
101
|
+
replaces the options, the filter is still the one asked for, so the dashboard never opens unfiltered.
|
|
102
|
+
A static select keeps the check: a value that is not one of its options is refused.
|
|
82
103
|
|
|
83
104
|
The answer always goes to the dashboard's parent, whoever asked.
|
|
84
105
|
|
|
106
|
+
## Drillthrough
|
|
107
|
+
|
|
108
|
+
A click on a table column or a card opens another dashboard in a popup over this one, filtered to the
|
|
109
|
+
clicked value. The user sets it up in the host (spec: [../docs/drillthrough-setup.md](../docs/drillthrough-setup.md));
|
|
110
|
+
the kit shows the points, reports them, and does the opening.
|
|
111
|
+
|
|
112
|
+
The host sends, in `CUSTOM_DASHBOARDS_PARAMS` (and `{ type: 'DK_DRILL_POINTS', drillPoints }` to change the
|
|
113
|
+
setup without the reload that message causes), only from the parent frame:
|
|
114
|
+
|
|
115
|
+
| Field | Meaning |
|
|
116
|
+
| --- | --- |
|
|
117
|
+
| `dashboardsApi` | where the dashboards live; https, or http for localhost. Without it the cells stay plain text. |
|
|
118
|
+
| `dashboardsPermissionKey` | sent as `x-permission-key` |
|
|
119
|
+
| `drillPoints` | `[{ point, dashboardId, pass }]`; `pass` maps a header filter id of B to `{ from: 'row', name }`, `{ from: 'filter', name }` or `{ from: 'value', value }` |
|
|
120
|
+
| `depth` | how deep this dashboard is opened; set by the kit for the dashboard it opens. At 3 the cells stay plain text. |
|
|
121
|
+
|
|
122
|
+
A point is a column (`renderTable`) or a card (`renderKpiCard`, `renderKpiStrip`, `renderInfoGrid`,
|
|
123
|
+
`renderTotalsStrip`), keyed by the container's `id` and the column `key` or the card label, each URI-encoded
|
|
124
|
+
and joined by `|`. A container with no `id`, a column key used twice in one table and a label used twice in
|
|
125
|
+
one strip are not points that can be set up.
|
|
126
|
+
|
|
127
|
+
| Message | From → to | Carries |
|
|
128
|
+
| --- | --- | --- |
|
|
129
|
+
| `DK_POINTS` | kit → parent | `{ points: [{ point, section, title?, configurable }] }`, sent when the list changes |
|
|
130
|
+
| `DK_SETUP_MODE` | parent → kit | `{ on }`: a button on every point that can be set up; no hover highlight and no pointer cursor except on those buttons and the tabs, and the page behind faintly blurred and dimmed (the set-up buttons and the tabs stay sharp) |
|
|
131
|
+
| `DK_CLOSE_REQUEST` | opened dashboard → parent | Esc pressed inside it with no popup of its own; the parent closes the popup only if the message came from that popup's frame |
|
|
132
|
+
| `DK_POINT_SETUP` | kit → parent | a click on such a button: `{ point, section, title?, row?, columns?, localFilters }` |
|
|
133
|
+
|
|
134
|
+
On a click the kit builds B's filters from the clicked row, the header filters and the period as the section
|
|
135
|
+
last loaded with, fetches B with the viewer's token, and opens it. A `pass` key may be a header filter of B
|
|
136
|
+
only: a context key (`dateFrom`, `dateTo`, `timezone`, `hierarchyId`) is refused. An open popup closes when the host changes the period, time zone or hierarchy; a theme change does not close it.
|
|
137
|
+
A table cell or card value that holds a link, a button, a control, an `onclick` or a tab stop is not made a
|
|
138
|
+
drillthrough link: it answers its own click. A column in which any cell does, and a card whose value does, get no
|
|
139
|
+
set-up button either (`configurable: false`). A row without the key a setup names, a filter the dashboard does not have, or a dashboard the viewer cannot open shows
|
|
140
|
+
its reason in the popup and opens nothing. A header filter that exists but is empty is simply not passed.
|
|
141
|
+
|
|
85
142
|
## Rules
|
|
86
143
|
|
|
87
144
|
- **Where a change lands — the current `vN` or a new major — is decided by
|
package/package.json
CHANGED
package/v4.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
let _activeTabId = '';
|
|
21
21
|
let _sections = []; // { id, label, load, loaded, errors }
|
|
22
22
|
let _title = '';
|
|
23
|
-
let _gitVer = '
|
|
23
|
+
let _gitVer = 'cc1be64'; // replaced at deploy: sed -i "s/cc1be64/$(git rev-parse --short HEAD)/g" v4.js
|
|
24
24
|
let _calls = []; // System Info call log
|
|
25
25
|
let _sectionErrors = {}; // sectionId → error count
|
|
26
26
|
let _generation = 0;
|
package/v5.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
let _activeTabId = '';
|
|
21
21
|
let _sections = []; // { id, label, load, loaded, errors }
|
|
22
22
|
let _title = '';
|
|
23
|
-
let _gitVer = '
|
|
23
|
+
let _gitVer = 'cc1be64'; // replaced at deploy: sed -i "s/cc1be64/$(git rev-parse --short HEAD)/g" v4.js
|
|
24
24
|
let _calls = []; // System Info call log
|
|
25
25
|
let _sectionErrors = {}; // sectionId → error count
|
|
26
26
|
let _generation = 0;
|