dce-reactkit 3.2.2-beta.35 → 3.2.2-beta.37
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/dist/cjs/index.js +23 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +23 -13
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ButtonInputGroup.tsx +1 -1
- package/src/components/IntelliTable.tsx +20 -11
- package/src/components/LogReviewer.tsx +8 -1
package/package.json
CHANGED
|
@@ -69,7 +69,7 @@ const ButtonInputGroup: React.FC<Props> = (props) => {
|
|
|
69
69
|
|
|
70
70
|
{/* Contents */}
|
|
71
71
|
<span
|
|
72
|
-
className="input-group-text flex-grow-1 rounded-right"
|
|
72
|
+
className="input-group-text flex-grow-1 rounded-right d-flex flex-wrap"
|
|
73
73
|
style={{
|
|
74
74
|
backgroundColor: 'white',
|
|
75
75
|
borderTopLeftRadius: 0,
|
|
@@ -87,7 +87,7 @@ enum ActionType {
|
|
|
87
87
|
// Toggle sort column param
|
|
88
88
|
ToggleSortColumn = 'toggle-sort-column',
|
|
89
89
|
// Toggle the visibility of a column
|
|
90
|
-
|
|
90
|
+
UpdateColumnVisibility = 'update-column-visibility',
|
|
91
91
|
// Toggle the column visibility customization modal
|
|
92
92
|
ToggleColVisCusModalVisibility = 'toggle-col-vis-cus-modal-visibility',
|
|
93
93
|
}
|
|
@@ -102,9 +102,11 @@ type Action = (
|
|
|
102
102
|
}
|
|
103
103
|
| {
|
|
104
104
|
// Action type
|
|
105
|
-
type: ActionType.
|
|
106
|
-
// Param for the column to
|
|
105
|
+
type: ActionType.UpdateColumnVisibility,
|
|
106
|
+
// Param for the column to update
|
|
107
107
|
param: string,
|
|
108
|
+
// If true, make the column visible
|
|
109
|
+
visible: boolean,
|
|
108
110
|
}
|
|
109
111
|
| {
|
|
110
112
|
// Action type
|
|
@@ -145,9 +147,9 @@ const reducer = (state: State, action: Action): State => {
|
|
|
145
147
|
sortType: SortType.Ascending,
|
|
146
148
|
};
|
|
147
149
|
}
|
|
148
|
-
case ActionType.
|
|
150
|
+
case ActionType.UpdateColumnVisibility: {
|
|
149
151
|
const { columnVisibilityMap } = state;
|
|
150
|
-
columnVisibilityMap[action.param] =
|
|
152
|
+
columnVisibilityMap[action.param] = action.visible;
|
|
151
153
|
return {
|
|
152
154
|
...state,
|
|
153
155
|
columnVisibilityMap,
|
|
@@ -245,10 +247,11 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
245
247
|
id={`IntelliTable-${id}-toggle-visibility-${column.param}`}
|
|
246
248
|
className="mb-2"
|
|
247
249
|
text={column.title}
|
|
248
|
-
onChanged={() => {
|
|
250
|
+
onChanged={(checked) => {
|
|
249
251
|
dispatch({
|
|
250
|
-
type: ActionType.
|
|
252
|
+
type: ActionType.UpdateColumnVisibility,
|
|
251
253
|
param: column.param,
|
|
254
|
+
visible: checked,
|
|
252
255
|
});
|
|
253
256
|
}}
|
|
254
257
|
checked={columnVisibilityMap[column.param]}
|
|
@@ -360,6 +363,12 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
360
363
|
const aVal = a[sortColumnParam];
|
|
361
364
|
const bVal = b[sortColumnParam];
|
|
362
365
|
|
|
366
|
+
// Tiebreaker sort by timestamp, most recent first (used if tied)
|
|
367
|
+
const tiebreaker = (
|
|
368
|
+
(b.timestamp ?? 0)
|
|
369
|
+
- (a.timestamp ?? 0)
|
|
370
|
+
);
|
|
371
|
+
|
|
363
372
|
// Auto-sort undefined and null to end of list
|
|
364
373
|
if (
|
|
365
374
|
(aVal === undefined || aVal === null)
|
|
@@ -371,7 +380,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
371
380
|
&& (bVal === undefined || bVal === null)
|
|
372
381
|
) {
|
|
373
382
|
// Both undefined
|
|
374
|
-
return
|
|
383
|
+
return tiebreaker;
|
|
375
384
|
}
|
|
376
385
|
if (aVal === undefined || aVal === null) {
|
|
377
386
|
// First was undefined
|
|
@@ -390,7 +399,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
390
399
|
if (!aVal && bVal) {
|
|
391
400
|
return (descending ? 1 : -1);
|
|
392
401
|
}
|
|
393
|
-
return
|
|
402
|
+
return tiebreaker;
|
|
394
403
|
}
|
|
395
404
|
// > Number
|
|
396
405
|
if (
|
|
@@ -411,7 +420,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
411
420
|
if (aVal > bVal) {
|
|
412
421
|
return (descending ? -1 : 1);
|
|
413
422
|
}
|
|
414
|
-
return
|
|
423
|
+
return tiebreaker;
|
|
415
424
|
}
|
|
416
425
|
// > JSON
|
|
417
426
|
if (paramType === ParamType.JSON) {
|
|
@@ -433,7 +442,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
433
442
|
}
|
|
434
443
|
|
|
435
444
|
// No sort
|
|
436
|
-
return
|
|
445
|
+
return tiebreaker;
|
|
437
446
|
});
|
|
438
447
|
}
|
|
439
448
|
|
|
@@ -631,6 +631,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
631
631
|
Object.values(LogBuiltInMetadata.Target).forEach((target) => {
|
|
632
632
|
initActionErrorFilterState.target[target] = true;
|
|
633
633
|
});
|
|
634
|
+
console.log(initActionErrorFilterState);
|
|
634
635
|
|
|
635
636
|
// Initial state
|
|
636
637
|
const initialState: State = {
|
|
@@ -727,7 +728,6 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
727
728
|
|
|
728
729
|
// Check which year/month combos we need to load
|
|
729
730
|
const toLoad = listMonthsToLoad(newDateFilterState);
|
|
730
|
-
console.log('Filter update:', newDateFilterState, toLoad, logMap);
|
|
731
731
|
|
|
732
732
|
// If nothing to load, finished
|
|
733
733
|
if (toLoad.length === 0) {
|
|
@@ -1067,6 +1067,10 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1067
1067
|
checked={tagFilterState[tag]}
|
|
1068
1068
|
onChanged={(checked) => {
|
|
1069
1069
|
tagFilterState[tag] = checked;
|
|
1070
|
+
dispatch({
|
|
1071
|
+
type: ActionType.UpdateTagFilterState,
|
|
1072
|
+
tagFilterState,
|
|
1073
|
+
});
|
|
1070
1074
|
}}
|
|
1071
1075
|
/>
|
|
1072
1076
|
);
|
|
@@ -1143,8 +1147,10 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1143
1147
|
text={description}
|
|
1144
1148
|
ariaLabel={`include logs with action type "${description}" in results`}
|
|
1145
1149
|
noMarginOnRight={i === Object.keys(LogAction).length - 1}
|
|
1150
|
+
checked={actionErrorFilterState.action[action]}
|
|
1146
1151
|
onChanged={(checked) => {
|
|
1147
1152
|
actionErrorFilterState.action[action] = checked;
|
|
1153
|
+
console.log(actionErrorFilterState);
|
|
1148
1154
|
dispatch({
|
|
1149
1155
|
type: ActionType.UpdateActionErrorFilterState,
|
|
1150
1156
|
actionErrorFilterState,
|
|
@@ -1173,6 +1179,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1173
1179
|
id={`LogReviewer-target-${target}-checkbox`}
|
|
1174
1180
|
text={description}
|
|
1175
1181
|
ariaLabel={`include logs with target "${description}" in results`}
|
|
1182
|
+
checked={actionErrorFilterState.target[target]}
|
|
1176
1183
|
onChanged={(checked) => {
|
|
1177
1184
|
actionErrorFilterState.target[target] = checked;
|
|
1178
1185
|
dispatch({
|