@xh/hoist 63.0.0 → 63.0.2

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 63.0.2 - 2024-04-16
4
+
5
+ ### 🐞 Bug Fixes
6
+
7
+ * Fixed issue with GroupingChooser: dragged items were not correctly positioned.
8
+ * Removed extraneous internal padding override to Blueprint menu styles. Fixes overhang of menu
9
+ divider borders and avoids possible triggering of horizontal scrollbars.
10
+
11
+ ## 63.0.1 - 2024-04-05
12
+
13
+ ### 🐞 Bug Fixes
14
+
15
+ * New filterable fields exposed in the Admin Console for `ActivityTracking` and `ClientErrors` modules.
16
+ * `url`, `appEnvironment`, `appVersion` in `ActivityTracking`
17
+ * `impersonating` in `ClientErrors`
18
+
3
19
  ## 63.0.0 - 2024-04-04
4
20
 
5
21
  ### 💥 Breaking Changes (upgrade difficulty: 🟠 MEDIUM - for apps with styling overrides or direct use of Blueprint components)
@@ -35,12 +35,32 @@ export const clientErrorDetail = hoistCmp.factory<ClientErrorsModel>(({model}) =
35
35
  style: {width: '400px'},
36
36
  items: [
37
37
  h3(Icon.info(), 'Error Info'),
38
- formField({field: 'username'}),
38
+ formField({
39
+ field: 'username',
40
+ readonlyRenderer: username => {
41
+ if (!username) return naSpan();
42
+ const {impersonating} = formModel.values,
43
+ impSpan = impersonating
44
+ ? span({
45
+ className: 'xh-text-color-accent',
46
+ item: ` (impersonating ${impersonating})`
47
+ })
48
+ : null;
49
+ return span(username, impSpan);
50
+ }
51
+ }),
39
52
  formField({
40
53
  field: 'dateCreated',
41
54
  readonlyRenderer: v => fmtDateTimeSec(v)
42
55
  }),
43
- formField({field: 'appVersion'}),
56
+ formField({
57
+ field: 'appVersion',
58
+ readonlyRenderer: appVersion => {
59
+ if (!appVersion) return naSpan();
60
+ const {appEnvironment} = formModel.values;
61
+ return `${appVersion} (${appEnvironment})`;
62
+ }
63
+ }),
44
64
  formField({
45
65
  field: 'userAlerted',
46
66
  label: 'User Alerted?'
@@ -53,6 +53,7 @@ export class ClientErrorsModel extends HoistModel {
53
53
  {...Col.userMessageFlag},
54
54
  {...Col.userAlertedFlag},
55
55
  {...Col.entryId, hidden},
56
+ {...Col.impersonatingFlag},
56
57
  {...Col.username},
57
58
  {...Col.browser},
58
59
  {...Col.device},
@@ -63,7 +64,8 @@ export class ClientErrorsModel extends HoistModel {
63
64
  {...Col.error, hidden},
64
65
  {...Col.url},
65
66
  {...Col.day},
66
- {...Col.dateCreatedWithSec, displayName: 'Timestamp'}
67
+ {...Col.dateCreatedWithSec, displayName: 'Timestamp'},
68
+ {...Col.impersonating, hidden}
67
69
  ]
68
70
  });
69
71
 
@@ -102,6 +104,9 @@ export class ClientErrorsModel extends HoistModel {
102
104
  },
103
105
  {
104
106
  field: 'url'
107
+ },
108
+ {
109
+ field: 'impersonating'
105
110
  }
106
111
  ]
107
112
  });
@@ -99,7 +99,10 @@ export class ActivityTrackingModel extends HoistModel {
99
99
  Col.userAgent.field,
100
100
  Col.username.field,
101
101
  {name: 'count', type: 'int', aggregator: 'CHILD_COUNT'},
102
- {name: 'month', type: 'string', isDimension: true, aggregator: 'UNIQUE'}
102
+ {name: 'month', type: 'string', isDimension: true, aggregator: 'UNIQUE'},
103
+ Col.url.field,
104
+ Col.appVersion.field,
105
+ Col.appEnvironment.field
103
106
  ] as CubeFieldSpec[]
104
107
  });
105
108
 
@@ -131,20 +134,17 @@ export class ActivityTrackingModel extends HoistModel {
131
134
  },
132
135
  fieldType: 'number'
133
136
  },
134
- {
135
- field: 'msg'
136
- },
137
- {
138
- field: 'data'
139
- },
140
- {
141
- field: 'userAgent'
142
- }
137
+ {field: 'msg'},
138
+ {field: 'data'},
139
+ {field: 'userAgent'},
140
+ {field: 'url'},
141
+ {field: 'appVersion'},
142
+ {field: 'appEnvironment'}
143
143
  ]
144
144
  });
145
145
 
146
146
  this.loadLookupsAsync();
147
-
147
+
148
148
  this.groupingChooserModel = new GroupingChooserModel({
149
149
  dimensions: this.cube.dimensions,
150
150
  persistWith: this.persistWith,
@@ -186,7 +186,10 @@ export class ActivityTrackingModel extends HoistModel {
186
186
  {...Col.elapsed, headerName: 'Elapsed (avg)', hidden},
187
187
  {...Col.dayRange, hidden},
188
188
  {...Col.entryCount},
189
- {field: 'count', hidden}
189
+ {field: 'count', hidden},
190
+ {...Col.appEnvironment, hidden},
191
+ {...Col.appVersion, hidden},
192
+ {...Col.url, hidden}
190
193
  ]
191
194
  });
192
195
 
@@ -30,8 +30,7 @@ export class ActivityDetailModel extends HoistModel {
30
30
  }
31
31
 
32
32
  override onLinked() {
33
- const hidden = true,
34
- filterable = true;
33
+ const hidden = true;
35
34
 
36
35
  this.gridModel = new GridModel({
37
36
  sortBy: 'dateCreated|desc',
@@ -46,16 +45,19 @@ export class ActivityDetailModel extends HoistModel {
46
45
  columns: [
47
46
  {...Col.impersonatingFlag},
48
47
  {...Col.entryId, hidden},
49
- {...Col.username, filterable},
48
+ {...Col.username},
50
49
  {...Col.impersonating, hidden},
51
- {...Col.category, filterable},
52
- {...Col.msg, filterable},
50
+ {...Col.category},
51
+ {...Col.msg},
52
+ {...Col.url},
53
+ {...Col.appVersion},
54
+ {...Col.appEnvironment, hidden},
53
55
  {...Col.data, hidden},
54
- {...Col.device, filterable},
55
- {...Col.browser, filterable},
56
- {...Col.userAgent, hidden, filterable},
57
- {...Col.elapsed, filterable},
58
- {...Col.dateCreatedWithSec, displayName: 'Timestamp', filterable}
56
+ {...Col.device},
57
+ {...Col.browser},
58
+ {...Col.userAgent, hidden},
59
+ {...Col.elapsed},
60
+ {...Col.dateCreatedWithSec, displayName: 'Timestamp'}
59
61
  ]
60
62
  });
61
63
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import {form} from '@xh/hoist/cmp/form';
8
8
  import {grid, gridCountLabel} from '@xh/hoist/cmp/grid';
9
- import {div, filler, h3, hframe, placeholder, span} from '@xh/hoist/cmp/layout';
9
+ import {a, div, filler, h3, hframe, placeholder, span} from '@xh/hoist/cmp/layout';
10
10
  import {hoistCmp, creates} from '@xh/hoist/core';
11
11
  import {colChooserButton, exportButton} from '@xh/hoist/desktop/cmp/button';
12
12
  import {formField} from '@xh/hoist/desktop/cmp/form';
@@ -81,6 +81,14 @@ const detailRecForm = hoistCmp.factory<ActivityDetailModel>(({model}) => {
81
81
  }
82
82
  }),
83
83
  formField({field: 'category'}),
84
+ formField({
85
+ field: 'appVersion',
86
+ readonlyRenderer: appVersion => {
87
+ if (!appVersion) return naSpan();
88
+ const {appEnvironment} = formModel.values;
89
+ return `${appVersion} (${appEnvironment})`;
90
+ }
91
+ }),
84
92
  formField({field: 'msg'}),
85
93
  formField({
86
94
  field: 'dateCreated',
@@ -95,6 +103,10 @@ const detailRecForm = hoistCmp.factory<ActivityDetailModel>(({model}) => {
95
103
  })
96
104
  }),
97
105
  formField({field: 'id'}),
106
+ formField({
107
+ field: 'url',
108
+ readonlyRenderer: hyperlinkVal
109
+ }),
98
110
  h3(Icon.desktop(), 'Device / Browser'),
99
111
  formField({field: 'device'}),
100
112
  formField({field: 'browser'}),
@@ -123,3 +135,4 @@ const additionalDataJsonInput = hoistCmp.factory<ActivityDetailModel>(({model})
123
135
 
124
136
  const valOrNa = v => (v != null ? v : naSpan());
125
137
  const naSpan = () => span({item: 'N/A', className: 'xh-text-color-muted'});
138
+ const hyperlinkVal = v => a({href: v, item: v, target: '_blank'});
@@ -195,7 +195,11 @@ const dimensionRow = hoistCmp.factory<GroupingChooserModel>({
195
195
  let transform = dndProps.draggableProps.style.transform;
196
196
  if (dndState.isDragging || dndState.isDropAnimating) {
197
197
  let rowValues = parseTransform(transform),
198
- popoverValues = parseTransform(model.popoverRef.current.style.transform);
198
+ pPos = model.popoverRef.current.getBoundingClientRect(),
199
+ popoverValues = {
200
+ x: pPos.left,
201
+ y: pPos.top
202
+ };
199
203
 
200
204
  // Account for drop animation
201
205
  if (dndState.isDropAnimating) {
@@ -204,9 +208,9 @@ const dimensionRow = hoistCmp.factory<GroupingChooserModel>({
204
208
  }
205
209
 
206
210
  // Subtract the popover's X / Y translation from the row's
207
- if (!isEmpty(rowValues) && !isEmpty(popoverValues)) {
208
- const x = rowValues[0] - popoverValues[0],
209
- y = rowValues[1] - popoverValues[1];
211
+ if (!isEmpty(rowValues)) {
212
+ const x = rowValues[0] - popoverValues.x,
213
+ y = rowValues[1] - popoverValues.y;
210
214
  transform = `translate(${x}px, ${y}px)`;
211
215
  }
212
216
  }
@@ -288,7 +292,7 @@ const addDimensionControl = hoistCmp.factory<GroupingChooserModel>({
288
292
  * Works for both `translate` and `translate3d`
289
293
  * e.g. `translate3d(250px, 150px, 0px)` is equivalent to [250, 150, 0]
290
294
  */
291
- function parseTransform(transformStr) {
295
+ function parseTransform(transformStr: string): number[] {
292
296
  return transformStr
293
297
  ?.replace('3d', '')
294
298
  .match(/[-]{0,1}[\d]*[.]{0,1}[\d]+/g)
@@ -64,9 +64,9 @@ $pt-transition-ease: cubic-bezier(0.4, 1, 0.75, 0.9) !default;
64
64
  $pt-transition-ease-bounce: cubic-bezier(0.54, 1.12, 0.38, 1.11) !default;
65
65
  $pt-transition-duration: 100ms !default;
66
66
 
67
- // This override is taken from the popover source SCSS - there it is scoped under the minimal class.
68
- // https://github.com/palantir/blueprint/blob/1bfd1e42303d2626bfc3923eec2195ab4dc696d2/packages/core/src/components/popover/_popover.scss#L54
69
67
  .bp5-popover {
68
+ // This override is taken from the popover source SCSS - there it is scoped under the minimal class.
69
+ // https://github.com/palantir/blueprint/blob/1bfd1e42303d2626bfc3923eec2195ab4dc696d2/packages/core/src/components/popover/_popover.scss#L54
70
70
  @include react-transition(
71
71
  'bp5-popover',
72
72
  (
@@ -85,7 +85,13 @@ $pt-transition-duration: 100ms !default;
85
85
  background-color: var(--xh-menu-bg);
86
86
  border: var(--xh-menu-border);
87
87
  color: var(--xh-menu-item-text-color);
88
- padding: 5px 0;
88
+
89
+ // Constrain menu height to the viewport, for menus with more items than will fit vertically.
90
+ // Note that this is not perfect - menus are shown relative to their target, and if a menu is
91
+ // in the middle of the page and forced to render above/below the target, it can still clip.
92
+ // The 100px offset is designed to account for menus shown from app/tab-level top/bottom toolbars.
93
+ max-height: calc(100vh - 100px);
94
+ overflow-y: auto;
89
95
 
90
96
  .bp5-menu-item {
91
97
  // Default alignment of flex-start leaves Hoist icons shifted up - could target
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "63.0.0",
3
+ "version": "63.0.2",
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",