@xh/hoist 69.0.0-SNAPSHOT.1728209550024 → 69.0.0-SNAPSHOT.1728431598764
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 +1 -0
- package/admin/tabs/activity/clienterrors/ClientErrorsModel.ts +4 -0
- package/admin/tabs/activity/clienterrors/ClientErrorsPanel.ts +8 -4
- package/admin/tabs/activity/tracking/ActivityTrackingModel.ts +5 -0
- package/admin/tabs/activity/tracking/ActivityTrackingPanel.ts +8 -4
- package/admin/tabs/cluster/logs/levels/LogLevelDialogModel.ts +1 -0
- package/admin/tabs/userData/prefs/editor/PrefEditorModel.ts +1 -0
- package/build/types/admin/tabs/activity/clienterrors/ClientErrorsModel.d.ts +1 -0
- package/build/types/admin/tabs/activity/tracking/ActivityTrackingModel.d.ts +1 -0
- package/build/types/desktop/cmp/rest/RestGridModel.d.ts +5 -2
- package/desktop/cmp/rest/RestGridModel.ts +7 -1
- package/desktop/cmp/rest/impl/RestGridToolbar.ts +4 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,7 @@ is not expected to affect any applications.
|
|
|
11
11
|
* Added new AppStates `AUTHENTICATING`, `INITIALIZING_HOIST`, and `INITIALIZING_APP` to support
|
|
12
12
|
more granular tracking and timing of app startup lifecycle.
|
|
13
13
|
* Improved the default "Loaded App" activity tracking entry with more granular data on load timing.
|
|
14
|
+
* `RestGrid` now displays an optional refresh button in its toolbar.
|
|
14
15
|
|
|
15
16
|
### ⚙️ Technical
|
|
16
17
|
|
|
@@ -180,6 +180,10 @@ export class ClientErrorsModel extends HoistModel {
|
|
|
180
180
|
this.startDay = this.endDay.subtract(value, unit).nextDay();
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
isInterval(value, unit) {
|
|
184
|
+
return this.startDay === this.endDay.subtract(value, unit).nextDay();
|
|
185
|
+
}
|
|
186
|
+
|
|
183
187
|
@computed
|
|
184
188
|
private get query() {
|
|
185
189
|
return {
|
|
@@ -49,25 +49,29 @@ const tbar = hoistCmp.factory<ClientErrorsModel>(({model}) => {
|
|
|
49
49
|
text: '6m',
|
|
50
50
|
outlined: true,
|
|
51
51
|
width: 40,
|
|
52
|
-
onClick: () => model.adjustStartDate(6, 'months')
|
|
52
|
+
onClick: () => model.adjustStartDate(6, 'months'),
|
|
53
|
+
active: model.isInterval(6, 'months')
|
|
53
54
|
}),
|
|
54
55
|
button({
|
|
55
56
|
text: '1m',
|
|
56
57
|
outlined: true,
|
|
57
58
|
width: 40,
|
|
58
|
-
onClick: () => model.adjustStartDate(1, 'months')
|
|
59
|
+
onClick: () => model.adjustStartDate(1, 'months'),
|
|
60
|
+
active: model.isInterval(1, 'months')
|
|
59
61
|
}),
|
|
60
62
|
button({
|
|
61
63
|
text: '7d',
|
|
62
64
|
outlined: true,
|
|
63
65
|
width: 40,
|
|
64
|
-
onClick: () => model.adjustStartDate(7, 'days')
|
|
66
|
+
onClick: () => model.adjustStartDate(7, 'days'),
|
|
67
|
+
active: model.isInterval(7, 'days')
|
|
65
68
|
}),
|
|
66
69
|
button({
|
|
67
70
|
text: '1d',
|
|
68
71
|
outlined: true,
|
|
69
72
|
width: 40,
|
|
70
|
-
onClick: () => model.adjustStartDate(1, 'days')
|
|
73
|
+
onClick: () => model.adjustStartDate(1, 'days'),
|
|
74
|
+
active: model.isInterval(1, 'days')
|
|
71
75
|
})
|
|
72
76
|
),
|
|
73
77
|
hspacer(),
|
|
@@ -288,6 +288,11 @@ export class ActivityTrackingModel extends HoistModel {
|
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
isInterval(value, unit) {
|
|
292
|
+
const {startDay, endDay} = this.formModel.values;
|
|
293
|
+
return startDay === endDay.subtract(value, unit).nextDay();
|
|
294
|
+
}
|
|
295
|
+
|
|
291
296
|
cubeLabelComparator(valA, valB, sortDir, abs, {recordA, recordB, defaultComparator}) {
|
|
292
297
|
const rawA = recordA?.raw,
|
|
293
298
|
rawB = recordB?.raw,
|
|
@@ -69,25 +69,29 @@ const tbar = hoistCmp.factory<ActivityTrackingModel>(({model}) => {
|
|
|
69
69
|
text: '6m',
|
|
70
70
|
outlined: true,
|
|
71
71
|
width: 40,
|
|
72
|
-
onClick: () => model.adjustStartDate(6, 'months')
|
|
72
|
+
onClick: () => model.adjustStartDate(6, 'months'),
|
|
73
|
+
active: model.isInterval(6, 'months')
|
|
73
74
|
}),
|
|
74
75
|
button({
|
|
75
76
|
text: '1m',
|
|
76
77
|
outlined: true,
|
|
77
78
|
width: 40,
|
|
78
|
-
onClick: () => model.adjustStartDate(1, 'months')
|
|
79
|
+
onClick: () => model.adjustStartDate(1, 'months'),
|
|
80
|
+
active: model.isInterval(1, 'months')
|
|
79
81
|
}),
|
|
80
82
|
button({
|
|
81
83
|
text: '7d',
|
|
82
84
|
outlined: true,
|
|
83
85
|
width: 40,
|
|
84
|
-
onClick: () => model.adjustStartDate(7, 'days')
|
|
86
|
+
onClick: () => model.adjustStartDate(7, 'days'),
|
|
87
|
+
active: model.isInterval(7, 'days')
|
|
85
88
|
}),
|
|
86
89
|
button({
|
|
87
90
|
text: '1d',
|
|
88
91
|
outlined: true,
|
|
89
92
|
width: 40,
|
|
90
|
-
onClick: () => model.adjustStartDate(1, 'days')
|
|
93
|
+
onClick: () => model.adjustStartDate(1, 'days'),
|
|
94
|
+
active: model.isInterval(1, 'days')
|
|
91
95
|
})
|
|
92
96
|
),
|
|
93
97
|
toolbarSep(),
|
|
@@ -48,6 +48,7 @@ export class LogLevelDialogModel extends HoistModel {
|
|
|
48
48
|
enableExport: true,
|
|
49
49
|
exportOptions: {filename: exportFilenameWithDate('log-levels')},
|
|
50
50
|
readonly: AppModel.readonly,
|
|
51
|
+
showRefreshButton: true,
|
|
51
52
|
store: {
|
|
52
53
|
url: 'rest/logLevelAdmin',
|
|
53
54
|
fieldDefaults: {disableXssProtection: true},
|
|
@@ -43,6 +43,7 @@ export class PrefEditorModel extends HoistModel {
|
|
|
43
43
|
enableExport: true,
|
|
44
44
|
exportOptions: {filename: exportFilenameWithDate('prefs')},
|
|
45
45
|
selModel: 'multiple',
|
|
46
|
+
showRefreshButton: true,
|
|
46
47
|
store: {
|
|
47
48
|
url: 'rest/preferenceAdmin',
|
|
48
49
|
reloadLookupsOnLoad: true,
|
|
@@ -22,6 +22,7 @@ export declare class ClientErrorsModel extends HoistModel {
|
|
|
22
22
|
showEntryDetail(detailRec: StoreRecord): void;
|
|
23
23
|
adjustDates(dir: 'subtract' | 'add'): void;
|
|
24
24
|
adjustStartDate(value: any, unit: any): void;
|
|
25
|
+
isInterval(value: any, unit: any): boolean;
|
|
25
26
|
private get query();
|
|
26
27
|
private get defaultStartDay();
|
|
27
28
|
private get defaultEndDay();
|
|
@@ -39,6 +39,7 @@ export declare class ActivityTrackingModel extends HoistModel {
|
|
|
39
39
|
resetQuery(): void;
|
|
40
40
|
adjustDates(dir: any): void;
|
|
41
41
|
adjustStartDate(value: any, unit: any): void;
|
|
42
|
+
isInterval(value: any, unit: any): boolean;
|
|
42
43
|
cubeLabelComparator(valA: any, valB: any, sortDir: any, abs: any, { recordA, recordB, defaultComparator }: {
|
|
43
44
|
recordA: any;
|
|
44
45
|
recordB: any;
|
|
@@ -18,7 +18,9 @@ export interface RestGridConfig extends GridConfig {
|
|
|
18
18
|
menuActions?: Array<RecordAction | RecordActionSpec | '-'>;
|
|
19
19
|
/** Actions to display in the form toolbar. Defaults to delete. */
|
|
20
20
|
formActions?: Array<RecordAction | RecordActionSpec>;
|
|
21
|
-
/**
|
|
21
|
+
/** Show a refresh button in the toolbar. Defaults to false. **/
|
|
22
|
+
showRefreshButton?: boolean;
|
|
23
|
+
/** Warning to display before actions on a selection of records. */
|
|
22
24
|
actionWarning?: {
|
|
23
25
|
add?: string | ((recs: StoreRecord[]) => string);
|
|
24
26
|
del?: string | ((recs: StoreRecord[]) => string);
|
|
@@ -70,6 +72,7 @@ export declare class RestGridModel extends HoistModel {
|
|
|
70
72
|
toolbarActions: Array<RecordAction | RecordActionSpec>;
|
|
71
73
|
menuActions: Array<RecordAction | RecordActionSpec | '-'>;
|
|
72
74
|
formActions: Array<RecordAction | RecordActionSpec>;
|
|
75
|
+
showRefreshButton: boolean;
|
|
73
76
|
prepareCloneFn: (input: {
|
|
74
77
|
record: StoreRecord;
|
|
75
78
|
clone: PlainObject;
|
|
@@ -83,7 +86,7 @@ export declare class RestGridModel extends HoistModel {
|
|
|
83
86
|
get selModel(): import("@xh/hoist/data").StoreSelectionModel;
|
|
84
87
|
get selectedRecords(): StoreRecord[];
|
|
85
88
|
get selectedRecord(): StoreRecord;
|
|
86
|
-
constructor({ readonly, toolbarActions, menuActions, formActions, actionWarning, prepareCloneFn, unit, filterFields, editors, onRowDoubleClicked, store, appData, ...rest }: RestGridConfig);
|
|
89
|
+
constructor({ readonly, toolbarActions, menuActions, formActions, showRefreshButton, actionWarning, prepareCloneFn, unit, filterFields, editors, onRowDoubleClicked, store, appData, ...rest }: RestGridConfig);
|
|
87
90
|
/** Load the underlying store. */
|
|
88
91
|
doLoadAsync(loadSpec: any): Promise<void>;
|
|
89
92
|
/** Load the underlying store. */
|
|
@@ -34,7 +34,10 @@ export interface RestGridConfig extends GridConfig {
|
|
|
34
34
|
/** Actions to display in the form toolbar. Defaults to delete. */
|
|
35
35
|
formActions?: Array<RecordAction | RecordActionSpec>;
|
|
36
36
|
|
|
37
|
-
/**
|
|
37
|
+
/** Show a refresh button in the toolbar. Defaults to false. **/
|
|
38
|
+
showRefreshButton?: boolean;
|
|
39
|
+
|
|
40
|
+
/** Warning to display before actions on a selection of records. */
|
|
38
41
|
actionWarning?: {
|
|
39
42
|
add?: string | ((recs: StoreRecord[]) => string);
|
|
40
43
|
del?: string | ((recs: StoreRecord[]) => string);
|
|
@@ -97,6 +100,7 @@ export class RestGridModel extends HoistModel {
|
|
|
97
100
|
toolbarActions: Array<RecordAction | RecordActionSpec>;
|
|
98
101
|
menuActions: Array<RecordAction | RecordActionSpec | '-'>;
|
|
99
102
|
formActions: Array<RecordAction | RecordActionSpec>;
|
|
103
|
+
showRefreshButton: boolean;
|
|
100
104
|
prepareCloneFn: (input: {record: StoreRecord; clone: PlainObject}) => void;
|
|
101
105
|
unit: string;
|
|
102
106
|
filterFields: string[] = null;
|
|
@@ -133,6 +137,7 @@ export class RestGridModel extends HoistModel {
|
|
|
133
137
|
toolbarActions = !readonly ? [addAction, editAction, deleteAction] : [viewAction],
|
|
134
138
|
menuActions = !readonly ? [addAction, editAction, deleteAction] : [viewAction],
|
|
135
139
|
formActions = !readonly ? [deleteAction] : [],
|
|
140
|
+
showRefreshButton = false,
|
|
136
141
|
actionWarning,
|
|
137
142
|
prepareCloneFn,
|
|
138
143
|
unit = 'record',
|
|
@@ -149,6 +154,7 @@ export class RestGridModel extends HoistModel {
|
|
|
149
154
|
this.toolbarActions = toolbarActions;
|
|
150
155
|
this.menuActions = menuActions;
|
|
151
156
|
this.formActions = formActions;
|
|
157
|
+
this.showRefreshButton = showRefreshButton;
|
|
152
158
|
|
|
153
159
|
this.actionWarning = Object.assign(this.actionWarning, actionWarning);
|
|
154
160
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "69.0.0-SNAPSHOT.
|
|
3
|
+
"version": "69.0.0-SNAPSHOT.1728431598764",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|