@xh/hoist 76.1.0 → 76.2.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 +8 -0
- package/admin/jsonsearch/impl/JsonSearchImplModel.ts +1 -1
- package/admin/tabs/activity/tracking/ActivityTrackingModel.ts +1 -1
- package/admin/tabs/cluster/instances/logs/LogDisplayModel.ts +1 -1
- package/admin/tabs/userData/users/UserModel.ts +1 -0
- package/build/types/data/Store.d.ts +1 -0
- package/build/types/data/cube/ViewRowData.d.ts +2 -0
- package/data/Store.ts +13 -3
- package/data/cube/ViewRowData.ts +3 -0
- package/data/cube/row/AggregateRow.ts +1 -0
- package/data/cube/row/BucketRow.ts +1 -0
- package/data/cube/row/LeafRow.ts +1 -1
- package/package.json +1 -1
- package/promise/Promise.ts +3 -3
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 76.2.0 - 2025-10-22
|
|
4
|
+
|
|
5
|
+
### ⚙️ Technical
|
|
6
|
+
|
|
7
|
+
* Performance improvements to Store for large data sets.
|
|
8
|
+
* New property `cubeRowType` on `ViewRowData` supports identifying bucketed rows.
|
|
9
|
+
* `waitFor` can accept a null value for a timeout.
|
|
10
|
+
|
|
3
11
|
## 76.1.0 - 2025-10-17
|
|
4
12
|
|
|
5
13
|
### 🎁 New Features
|
|
@@ -395,7 +395,7 @@ export class ActivityTrackingModel extends HoistModel implements ActivityDetailP
|
|
|
395
395
|
treeStyle: TreeStyle.HIGHLIGHTS_AND_BORDERS,
|
|
396
396
|
autosizeOptions: {mode: 'managed', includeCollapsedChildren: true},
|
|
397
397
|
exportOptions: {filename: exportFilename('activity-summary')},
|
|
398
|
-
emptyText: 'No activity reported
|
|
398
|
+
emptyText: 'No activity reported.',
|
|
399
399
|
sortBy: ['cubeLabel'],
|
|
400
400
|
expandLevel: 1,
|
|
401
401
|
levelLabels: () => ['Total', ...this.groupingChooserModel.valueDisplayNames],
|
|
@@ -136,7 +136,7 @@ export class LogDisplayModel extends HoistModel {
|
|
|
136
136
|
hideHeaders: true,
|
|
137
137
|
rowBorders: false,
|
|
138
138
|
sizingMode: 'tiny',
|
|
139
|
-
emptyText: 'No log entries found
|
|
139
|
+
emptyText: 'No log entries found.',
|
|
140
140
|
sortBy: 'rowNum|asc',
|
|
141
141
|
autosizeOptions: {mode: 'disabled'},
|
|
142
142
|
store: {
|
|
@@ -7,6 +7,8 @@ export declare class ViewRowData {
|
|
|
7
7
|
constructor(id: string);
|
|
8
8
|
/** Unique id. */
|
|
9
9
|
id: string;
|
|
10
|
+
/** Denotes a type for the row */
|
|
11
|
+
cubeRowType: 'leaf' | 'aggregate' | 'bucket';
|
|
10
12
|
/**
|
|
11
13
|
* Label of the row. The dimension value or, for leaf rows. the underlying cubeId.
|
|
12
14
|
* Suitable for display, although apps will typically wish to customize leaf row rendering.
|
package/data/Store.ts
CHANGED
|
@@ -1041,26 +1041,36 @@ export class Store extends HoistBase {
|
|
|
1041
1041
|
return ret;
|
|
1042
1042
|
}
|
|
1043
1043
|
|
|
1044
|
-
private createRecords(
|
|
1044
|
+
private createRecords(
|
|
1045
|
+
rawData: PlainObject[],
|
|
1046
|
+
parent: StoreRecord,
|
|
1047
|
+
recordMap: Map<StoreRecordId, StoreRecord> = new Map(),
|
|
1048
|
+
summaryRecordIds: Set<StoreRecordId> = this.summaryRecordIds
|
|
1049
|
+
) {
|
|
1045
1050
|
const {loadTreeData, loadTreeDataFrom} = this;
|
|
1051
|
+
|
|
1046
1052
|
rawData.forEach(raw => {
|
|
1047
1053
|
const rec = this.createRecord(raw, parent),
|
|
1048
1054
|
{id} = rec;
|
|
1049
1055
|
|
|
1050
1056
|
throwIf(
|
|
1051
|
-
recordMap.has(id) ||
|
|
1057
|
+
recordMap.has(id) || summaryRecordIds.has(id),
|
|
1052
1058
|
`ID ${id} is not unique. Use the 'Store.idSpec' config to resolve a unique ID for each record.`
|
|
1053
1059
|
);
|
|
1054
1060
|
|
|
1055
1061
|
recordMap.set(id, rec);
|
|
1056
1062
|
|
|
1057
1063
|
if (loadTreeData && raw[loadTreeDataFrom]) {
|
|
1058
|
-
this.createRecords(raw[loadTreeDataFrom], rec, recordMap);
|
|
1064
|
+
this.createRecords(raw[loadTreeDataFrom], rec, recordMap, summaryRecordIds);
|
|
1059
1065
|
}
|
|
1060
1066
|
});
|
|
1061
1067
|
return recordMap;
|
|
1062
1068
|
}
|
|
1063
1069
|
|
|
1070
|
+
private get summaryRecordIds(): Set<StoreRecordId> {
|
|
1071
|
+
return new Set(this.summaryRecords?.map(it => it.id) ?? []);
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1064
1074
|
private parseRaw(data: PlainObject): PlainObject {
|
|
1065
1075
|
// a) create/prepare the data object
|
|
1066
1076
|
const ret = Object.create(this._dataDefaults);
|
package/data/cube/ViewRowData.ts
CHANGED
|
@@ -19,6 +19,9 @@ export class ViewRowData {
|
|
|
19
19
|
/** Unique id. */
|
|
20
20
|
id: string;
|
|
21
21
|
|
|
22
|
+
/** Denotes a type for the row */
|
|
23
|
+
cubeRowType: 'leaf' | 'aggregate' | 'bucket';
|
|
24
|
+
|
|
22
25
|
/**
|
|
23
26
|
* Label of the row. The dimension value or, for leaf rows. the underlying cubeId.
|
|
24
27
|
* Suitable for display, although apps will typically wish to customize leaf row rendering.
|
package/data/cube/row/LeafRow.ts
CHANGED
|
@@ -33,8 +33,8 @@ export class LeafRow extends BaseRow {
|
|
|
33
33
|
|
|
34
34
|
constructor(view: View, id: string, rawRecord: StoreRecord) {
|
|
35
35
|
super(view, id);
|
|
36
|
-
|
|
37
36
|
this.cubeRecordId = rawRecord.id;
|
|
37
|
+
this.data.cubeRowType = 'leaf';
|
|
38
38
|
this.data.cubeLabel = rawRecord.id.toString();
|
|
39
39
|
this.data.cubeDimension = null;
|
|
40
40
|
|
package/package.json
CHANGED
package/promise/Promise.ts
CHANGED
|
@@ -132,15 +132,15 @@ export function waitFor(
|
|
|
132
132
|
condition: () => boolean,
|
|
133
133
|
{interval = 50, timeout = 5 * SECONDS}: {interval?: number; timeout?: number} = {}
|
|
134
134
|
): Promise<void> {
|
|
135
|
-
if (
|
|
136
|
-
if (
|
|
135
|
+
if (interval <= 0) throw new Error('Invalid interval');
|
|
136
|
+
if (timeout != null && timeout <= 0) throw new Error('Invalid timeout');
|
|
137
137
|
|
|
138
138
|
const startTime = Date.now();
|
|
139
139
|
return new Promise((resolve, reject) => {
|
|
140
140
|
const resolveOnMet = () => {
|
|
141
141
|
if (condition()) {
|
|
142
142
|
resolve();
|
|
143
|
-
} else if (olderThan(startTime, timeout)) {
|
|
143
|
+
} else if (timeout != null && olderThan(startTime, timeout)) {
|
|
144
144
|
reject(Exception.timeout({interval: Date.now() - startTime}));
|
|
145
145
|
} else {
|
|
146
146
|
setTimeout(resolveOnMet, interval);
|