dce-reactkit 3.2.2-beta.44 → 3.2.2-beta.47
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 +331 -261
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/types/LogMetadataContextMap.d.ts +11 -0
- package/dist/cjs/types/types/LogMetadataTagMap.d.ts +8 -0
- package/dist/cjs/types/types/LogMetadataTargetMap.d.ts +8 -0
- package/dist/cjs/types/types/LogMetadataType.d.ts +6 -12
- package/dist/esm/index.js +331 -261
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/types/LogMetadataContextMap.d.ts +11 -0
- package/dist/esm/types/types/LogMetadataTagMap.d.ts +8 -0
- package/dist/esm/types/types/LogMetadataTargetMap.d.ts +8 -0
- package/dist/esm/types/types/LogMetadataType.d.ts +6 -12
- package/dist/index.d.ts +30 -12
- package/package.json +1 -1
- package/src/components/IntelliTable.tsx +73 -2
- package/src/components/LogReviewer.tsx +304 -266
- package/src/types/LogMetadataContextMap.ts +15 -0
- package/src/types/LogMetadataTagMap.ts +9 -0
- package/src/types/LogMetadataTargetMap.ts +9 -0
- package/src/types/LogMetadataType.ts +8 -15
package/dist/esm/index.js
CHANGED
|
@@ -2337,6 +2337,10 @@ var ActionType$1;
|
|
|
2337
2337
|
ActionType["UpdateColumnVisibility"] = "update-column-visibility";
|
|
2338
2338
|
// Toggle the column visibility customization modal
|
|
2339
2339
|
ActionType["ToggleColVisCusModalVisibility"] = "toggle-col-vis-cus-modal-visibility";
|
|
2340
|
+
// Show all columns
|
|
2341
|
+
ActionType["ShowAllColumns"] = "show-all-columns";
|
|
2342
|
+
// Hide all columns
|
|
2343
|
+
ActionType["HideAllColumns"] = "hide-all-columns";
|
|
2340
2344
|
})(ActionType$1 || (ActionType$1 = {}));
|
|
2341
2345
|
/**
|
|
2342
2346
|
* Reducer that executes actions
|
|
@@ -2366,6 +2370,20 @@ const reducer$1 = (state, action) => {
|
|
|
2366
2370
|
case ActionType$1.ToggleColVisCusModalVisibility: {
|
|
2367
2371
|
return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
|
|
2368
2372
|
}
|
|
2373
|
+
case ActionType$1.ShowAllColumns: {
|
|
2374
|
+
const { columnVisibilityMap } = state;
|
|
2375
|
+
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2376
|
+
columnVisibilityMap[param] = true;
|
|
2377
|
+
});
|
|
2378
|
+
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2379
|
+
}
|
|
2380
|
+
case ActionType$1.HideAllColumns: {
|
|
2381
|
+
const { columnVisibilityMap } = state;
|
|
2382
|
+
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2383
|
+
columnVisibilityMap[param] = false;
|
|
2384
|
+
});
|
|
2385
|
+
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2386
|
+
}
|
|
2369
2387
|
default: {
|
|
2370
2388
|
return state;
|
|
2371
2389
|
}
|
|
@@ -2421,18 +2439,37 @@ const IntelliTable = (props) => {
|
|
|
2421
2439
|
if (columnVisibilityCustomizationModalVisible) {
|
|
2422
2440
|
// Create modal
|
|
2423
2441
|
modal = (React.createElement(Modal, { type: ModalType$1.Okay, title: "Choose columns to show:", onClose: () => {
|
|
2442
|
+
const noColumnsSelected = (Object.values(columnVisibilityMap)
|
|
2443
|
+
.every((isSelected) => {
|
|
2444
|
+
return !isSelected;
|
|
2445
|
+
}));
|
|
2446
|
+
if (noColumnsSelected) {
|
|
2447
|
+
return alert$1('Choose at least one column', 'To continue, you have to choose at least one column to show');
|
|
2448
|
+
}
|
|
2424
2449
|
dispatch({
|
|
2425
2450
|
type: ActionType$1.ToggleColVisCusModalVisibility,
|
|
2426
2451
|
});
|
|
2427
|
-
}, okayVariant: Variant$1.Light },
|
|
2428
|
-
|
|
2452
|
+
}, okayVariant: Variant$1.Light },
|
|
2453
|
+
columns.map((column) => {
|
|
2454
|
+
return (React.createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
|
|
2455
|
+
dispatch({
|
|
2456
|
+
type: ActionType$1.UpdateColumnVisibility,
|
|
2457
|
+
param: column.param,
|
|
2458
|
+
visible: checked,
|
|
2459
|
+
});
|
|
2460
|
+
}, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column in the ${title} table`, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Secondary }));
|
|
2461
|
+
}),
|
|
2462
|
+
React.createElement("div", { className: "mt-3" }, "Or you can:"),
|
|
2463
|
+
React.createElement("button", { type: "button", id: `IntelliTable-${id}-select-all-columns`, className: "btn btn-secondary me-2", "aria-label": `show all columns in the ${title} table`, onClick: () => {
|
|
2429
2464
|
dispatch({
|
|
2430
|
-
type: ActionType$1.
|
|
2431
|
-
param: column.param,
|
|
2432
|
-
visible: checked,
|
|
2465
|
+
type: ActionType$1.ShowAllColumns,
|
|
2433
2466
|
});
|
|
2434
|
-
}
|
|
2435
|
-
|
|
2467
|
+
} }, "Select All"),
|
|
2468
|
+
React.createElement("button", { type: "button", id: `IntelliTable-${id}-select-none-columns`, className: "btn btn-secondary", "aria-label": `hide all columns in the ${title} table`, onClick: () => {
|
|
2469
|
+
dispatch({
|
|
2470
|
+
type: ActionType$1.HideAllColumns,
|
|
2471
|
+
});
|
|
2472
|
+
} }, "Deselect All")));
|
|
2436
2473
|
}
|
|
2437
2474
|
/*----------------------------------------*/
|
|
2438
2475
|
/* Main UI */
|
|
@@ -2658,7 +2695,9 @@ const IntelliTable = (props) => {
|
|
|
2658
2695
|
})
|
|
2659
2696
|
.length);
|
|
2660
2697
|
// Build CSV
|
|
2661
|
-
const csv = genCSV(data, columns)
|
|
2698
|
+
const csv = genCSV(data, columns.filter((column) => {
|
|
2699
|
+
return columnVisibilityMap[column.param];
|
|
2700
|
+
}));
|
|
2662
2701
|
// Build main UI
|
|
2663
2702
|
return (React.createElement("div", { className: `IntelliTable-container-${id}` },
|
|
2664
2703
|
modal,
|
|
@@ -2784,6 +2823,195 @@ const style = `
|
|
|
2784
2823
|
}
|
|
2785
2824
|
`;
|
|
2786
2825
|
/*------------------------------------------------------------------------*/
|
|
2826
|
+
/* Constants */
|
|
2827
|
+
/*------------------------------------------------------------------------*/
|
|
2828
|
+
const columns = [
|
|
2829
|
+
{
|
|
2830
|
+
title: 'First Name',
|
|
2831
|
+
param: 'userFirstName',
|
|
2832
|
+
type: ParamType$1.String,
|
|
2833
|
+
},
|
|
2834
|
+
{
|
|
2835
|
+
title: 'Last Name',
|
|
2836
|
+
param: 'userLastName',
|
|
2837
|
+
type: ParamType$1.String,
|
|
2838
|
+
},
|
|
2839
|
+
{
|
|
2840
|
+
title: 'Email',
|
|
2841
|
+
param: 'userEmail',
|
|
2842
|
+
type: ParamType$1.String,
|
|
2843
|
+
},
|
|
2844
|
+
{
|
|
2845
|
+
title: 'Canvas Id',
|
|
2846
|
+
param: 'userId',
|
|
2847
|
+
type: ParamType$1.Int,
|
|
2848
|
+
},
|
|
2849
|
+
{
|
|
2850
|
+
title: 'Student?',
|
|
2851
|
+
param: 'isLearner',
|
|
2852
|
+
type: ParamType$1.Boolean,
|
|
2853
|
+
},
|
|
2854
|
+
{
|
|
2855
|
+
title: 'Teaching Staff?',
|
|
2856
|
+
param: 'isTTM',
|
|
2857
|
+
type: ParamType$1.Boolean,
|
|
2858
|
+
startsHidden: true,
|
|
2859
|
+
},
|
|
2860
|
+
{
|
|
2861
|
+
title: 'Admin?',
|
|
2862
|
+
param: 'isAdmin',
|
|
2863
|
+
type: ParamType$1.Boolean,
|
|
2864
|
+
startsHidden: true,
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
title: 'Course Canvas Id',
|
|
2868
|
+
param: 'courseId',
|
|
2869
|
+
type: ParamType$1.Int,
|
|
2870
|
+
startsHidden: true,
|
|
2871
|
+
},
|
|
2872
|
+
{
|
|
2873
|
+
title: 'Course Name',
|
|
2874
|
+
param: 'courseName',
|
|
2875
|
+
type: ParamType$1.String,
|
|
2876
|
+
},
|
|
2877
|
+
{
|
|
2878
|
+
title: 'Browser Name',
|
|
2879
|
+
param: 'browser.name',
|
|
2880
|
+
type: ParamType$1.String,
|
|
2881
|
+
startsHidden: true,
|
|
2882
|
+
},
|
|
2883
|
+
{
|
|
2884
|
+
title: 'Browser Version',
|
|
2885
|
+
param: 'browser.version',
|
|
2886
|
+
type: ParamType$1.String,
|
|
2887
|
+
startsHidden: true,
|
|
2888
|
+
},
|
|
2889
|
+
{
|
|
2890
|
+
title: 'OS',
|
|
2891
|
+
param: 'device.os',
|
|
2892
|
+
type: ParamType$1.String,
|
|
2893
|
+
startsHidden: true,
|
|
2894
|
+
},
|
|
2895
|
+
{
|
|
2896
|
+
title: 'Mobile?',
|
|
2897
|
+
param: 'device.isMobile',
|
|
2898
|
+
type: ParamType$1.Boolean,
|
|
2899
|
+
startsHidden: true,
|
|
2900
|
+
},
|
|
2901
|
+
{
|
|
2902
|
+
title: 'Year',
|
|
2903
|
+
param: 'year',
|
|
2904
|
+
type: ParamType$1.Int,
|
|
2905
|
+
},
|
|
2906
|
+
{
|
|
2907
|
+
title: 'Month',
|
|
2908
|
+
param: 'month',
|
|
2909
|
+
type: ParamType$1.Int,
|
|
2910
|
+
},
|
|
2911
|
+
{
|
|
2912
|
+
title: 'Day',
|
|
2913
|
+
param: 'day',
|
|
2914
|
+
type: ParamType$1.Int,
|
|
2915
|
+
},
|
|
2916
|
+
{
|
|
2917
|
+
title: 'Hour',
|
|
2918
|
+
param: 'hour',
|
|
2919
|
+
type: ParamType$1.Int,
|
|
2920
|
+
},
|
|
2921
|
+
{
|
|
2922
|
+
title: 'Minute',
|
|
2923
|
+
param: 'minute',
|
|
2924
|
+
type: ParamType$1.Int,
|
|
2925
|
+
startsHidden: true,
|
|
2926
|
+
},
|
|
2927
|
+
{
|
|
2928
|
+
title: 'Timestamp',
|
|
2929
|
+
param: 'timestamp',
|
|
2930
|
+
type: ParamType$1.Int,
|
|
2931
|
+
startsHidden: true,
|
|
2932
|
+
},
|
|
2933
|
+
{
|
|
2934
|
+
title: 'Context',
|
|
2935
|
+
param: 'context',
|
|
2936
|
+
type: ParamType$1.String,
|
|
2937
|
+
},
|
|
2938
|
+
{
|
|
2939
|
+
title: 'Subcontext',
|
|
2940
|
+
param: 'subcontext',
|
|
2941
|
+
type: ParamType$1.String,
|
|
2942
|
+
},
|
|
2943
|
+
{
|
|
2944
|
+
title: 'Tags',
|
|
2945
|
+
param: 'tags',
|
|
2946
|
+
type: ParamType$1.JSON,
|
|
2947
|
+
startsHidden: true,
|
|
2948
|
+
},
|
|
2949
|
+
{
|
|
2950
|
+
title: 'Log Level',
|
|
2951
|
+
param: 'level',
|
|
2952
|
+
type: ParamType$1.String,
|
|
2953
|
+
startsHidden: true,
|
|
2954
|
+
},
|
|
2955
|
+
{
|
|
2956
|
+
title: 'Metadata',
|
|
2957
|
+
param: 'metadata',
|
|
2958
|
+
type: ParamType$1.JSON,
|
|
2959
|
+
startsHidden: true,
|
|
2960
|
+
},
|
|
2961
|
+
{
|
|
2962
|
+
title: 'Source',
|
|
2963
|
+
param: 'source',
|
|
2964
|
+
type: ParamType$1.String,
|
|
2965
|
+
},
|
|
2966
|
+
{
|
|
2967
|
+
title: 'Server Route Path',
|
|
2968
|
+
param: 'routePath',
|
|
2969
|
+
type: ParamType$1.String,
|
|
2970
|
+
startsHidden: true,
|
|
2971
|
+
},
|
|
2972
|
+
{
|
|
2973
|
+
title: 'Server Route Template',
|
|
2974
|
+
param: 'routeTemplate',
|
|
2975
|
+
type: ParamType$1.String,
|
|
2976
|
+
startsHidden: true,
|
|
2977
|
+
},
|
|
2978
|
+
{
|
|
2979
|
+
title: 'Type',
|
|
2980
|
+
param: 'type',
|
|
2981
|
+
type: ParamType$1.String,
|
|
2982
|
+
},
|
|
2983
|
+
{
|
|
2984
|
+
title: 'Error Message',
|
|
2985
|
+
param: 'errorMessage',
|
|
2986
|
+
type: ParamType$1.String,
|
|
2987
|
+
startsHidden: true,
|
|
2988
|
+
},
|
|
2989
|
+
{
|
|
2990
|
+
title: 'Error Code',
|
|
2991
|
+
param: 'errorCode',
|
|
2992
|
+
type: ParamType$1.String,
|
|
2993
|
+
startsHidden: true,
|
|
2994
|
+
},
|
|
2995
|
+
{
|
|
2996
|
+
title: 'Error Stack',
|
|
2997
|
+
param: 'errorStack',
|
|
2998
|
+
type: ParamType$1.String,
|
|
2999
|
+
startsHidden: true,
|
|
3000
|
+
},
|
|
3001
|
+
{
|
|
3002
|
+
title: 'Action Target',
|
|
3003
|
+
param: 'target',
|
|
3004
|
+
type: ParamType$1.String,
|
|
3005
|
+
startsHidden: true,
|
|
3006
|
+
},
|
|
3007
|
+
{
|
|
3008
|
+
title: 'Action Type',
|
|
3009
|
+
param: 'action',
|
|
3010
|
+
type: ParamType$1.String,
|
|
3011
|
+
startsHidden: true,
|
|
3012
|
+
},
|
|
3013
|
+
];
|
|
3014
|
+
/*------------------------------------------------------------------------*/
|
|
2787
3015
|
/* Static Functions */
|
|
2788
3016
|
/*------------------------------------------------------------------------*/
|
|
2789
3017
|
/**
|
|
@@ -2895,34 +3123,34 @@ const LogReviewer = (props) => {
|
|
|
2895
3123
|
/*------------------------------------------------------------------------*/
|
|
2896
3124
|
/* Setup */
|
|
2897
3125
|
/*------------------------------------------------------------------------*/
|
|
2898
|
-
var _a, _b, _c, _d, _e, _f
|
|
3126
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2899
3127
|
/* -------------- Props ------------- */
|
|
2900
3128
|
// Destructure props
|
|
2901
3129
|
const { LogMetadata, onClose, } = props;
|
|
2902
|
-
//
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
if (LogMetadata.Context) {
|
|
2917
|
-
LogMetadata.Context[context] = context;
|
|
2918
|
-
}
|
|
3130
|
+
// Create complete map of contexts
|
|
3131
|
+
const contextMap = {};
|
|
3132
|
+
[
|
|
3133
|
+
((_a = LogMetadata.Context) !== null && _a !== void 0 ? _a : {}),
|
|
3134
|
+
LogBuiltInMetadata.Context,
|
|
3135
|
+
].forEach((contextMap) => {
|
|
3136
|
+
Object.keys(contextMap).forEach((context) => {
|
|
3137
|
+
// Add context
|
|
3138
|
+
contextMap[context] = context;
|
|
3139
|
+
// If context has children, add an "uncategorized" subcontext
|
|
3140
|
+
if (typeof contextMap[context] !== 'string') {
|
|
3141
|
+
contextMap[context][LogBuiltInMetadata.Context.Uncategorized] = (LogBuiltInMetadata.Context.Uncategorized);
|
|
3142
|
+
}
|
|
3143
|
+
});
|
|
2919
3144
|
});
|
|
2920
|
-
//
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
3145
|
+
// Create complete map of targets
|
|
3146
|
+
const targetMap = {};
|
|
3147
|
+
[
|
|
3148
|
+
((_b = LogMetadata.Target) !== null && _b !== void 0 ? _b : {}),
|
|
3149
|
+
LogBuiltInMetadata.Target,
|
|
3150
|
+
].forEach((targetMap) => {
|
|
3151
|
+
Object.keys(targetMap).forEach((target) => {
|
|
3152
|
+
targetMap[target] = target;
|
|
3153
|
+
});
|
|
2926
3154
|
});
|
|
2927
3155
|
/* -------------- State ------------- */
|
|
2928
3156
|
// Create initial date filter state
|
|
@@ -2943,7 +3171,7 @@ const LogReviewer = (props) => {
|
|
|
2943
3171
|
};
|
|
2944
3172
|
// Create initial context filter state
|
|
2945
3173
|
const initContextFilterState = {};
|
|
2946
|
-
Object.keys((
|
|
3174
|
+
Object.keys((_c = LogMetadata.Context) !== null && _c !== void 0 ? _c : {}).forEach((context) => {
|
|
2947
3175
|
var _a, _b;
|
|
2948
3176
|
const contextValue = ((_a = LogMetadata.Context) !== null && _a !== void 0 ? _a : {})[context];
|
|
2949
3177
|
if (typeof contextValue === 'string') {
|
|
@@ -2965,7 +3193,7 @@ const LogReviewer = (props) => {
|
|
|
2965
3193
|
});
|
|
2966
3194
|
// Create initial tag filter state
|
|
2967
3195
|
const initTagFilterState = {};
|
|
2968
|
-
Object.keys((
|
|
3196
|
+
Object.keys((_d = LogMetadata.Tag) !== null && _d !== void 0 ? _d : {}).forEach((tag) => {
|
|
2969
3197
|
initTagFilterState[tag] = false;
|
|
2970
3198
|
});
|
|
2971
3199
|
// Create advanced filter state
|
|
@@ -2992,7 +3220,7 @@ const LogReviewer = (props) => {
|
|
|
2992
3220
|
target: {},
|
|
2993
3221
|
action: {},
|
|
2994
3222
|
};
|
|
2995
|
-
Object.values((
|
|
3223
|
+
Object.values((_e = LogMetadata.Target) !== null && _e !== void 0 ? _e : {}).forEach((target) => {
|
|
2996
3224
|
initActionErrorFilterState.target[target] = true;
|
|
2997
3225
|
});
|
|
2998
3226
|
Object.values(LogAction$1).forEach((action) => {
|
|
@@ -3186,7 +3414,7 @@ const LogReviewer = (props) => {
|
|
|
3186
3414
|
initDateFilterState,
|
|
3187
3415
|
initTagFilterState,
|
|
3188
3416
|
});
|
|
3189
|
-
} }, "Reset
|
|
3417
|
+
} }, "Reset"))));
|
|
3190
3418
|
// Filter drawer
|
|
3191
3419
|
let filterDrawer;
|
|
3192
3420
|
if (expandedFilterDrawer) {
|
|
@@ -3214,10 +3442,16 @@ const LogReviewer = (props) => {
|
|
|
3214
3442
|
}
|
|
3215
3443
|
else if (expandedFilterDrawer === FilterDrawer.Context) {
|
|
3216
3444
|
// Create item picker items
|
|
3217
|
-
const
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3445
|
+
const builtInPickableItem = {
|
|
3446
|
+
id: '_',
|
|
3447
|
+
name: 'Auto-logged',
|
|
3448
|
+
isGroup: true,
|
|
3449
|
+
children: [],
|
|
3450
|
+
};
|
|
3451
|
+
const pickableItems = [];
|
|
3452
|
+
Object.keys(contextMap)
|
|
3453
|
+
.forEach((context) => {
|
|
3454
|
+
const value = (contextMap)[context];
|
|
3221
3455
|
if (typeof value === 'string') {
|
|
3222
3456
|
// No subcategories
|
|
3223
3457
|
const item = {
|
|
@@ -3226,13 +3460,24 @@ const LogReviewer = (props) => {
|
|
|
3226
3460
|
isGroup: false,
|
|
3227
3461
|
checked: !!contextFilterState[context],
|
|
3228
3462
|
};
|
|
3229
|
-
|
|
3463
|
+
// Add built-in items to its own folder
|
|
3464
|
+
const isBuiltIn = context in LogBuiltInMetadata.Context;
|
|
3465
|
+
if (isBuiltIn) {
|
|
3466
|
+
// Add to built-in pickable item
|
|
3467
|
+
builtInPickableItem.children.push(item);
|
|
3468
|
+
}
|
|
3469
|
+
else {
|
|
3470
|
+
// Add to pickable items list
|
|
3471
|
+
pickableItems.push(item);
|
|
3472
|
+
}
|
|
3230
3473
|
}
|
|
3231
3474
|
// Has subcategories
|
|
3232
3475
|
const children = (Object.keys(value)
|
|
3476
|
+
// Remove parent name
|
|
3233
3477
|
.filter((subcontext) => {
|
|
3234
3478
|
return subcontext !== '_';
|
|
3235
3479
|
})
|
|
3480
|
+
// Create child pickable items
|
|
3236
3481
|
.map((subcontext) => {
|
|
3237
3482
|
return {
|
|
3238
3483
|
id: subcontext,
|
|
@@ -3247,19 +3492,32 @@ const LogReviewer = (props) => {
|
|
|
3247
3492
|
isGroup: true,
|
|
3248
3493
|
children,
|
|
3249
3494
|
};
|
|
3250
|
-
|
|
3251
|
-
})
|
|
3495
|
+
pickableItems.push(item);
|
|
3496
|
+
});
|
|
3497
|
+
// Add built-in contexts to end ofl ist
|
|
3498
|
+
pickableItems.push(builtInPickableItem);
|
|
3252
3499
|
// Create filter UI
|
|
3253
3500
|
filterDrawer = (React.createElement(ItemPicker, { title: "Context", items: pickableItems, onChanged: (updatedItems) => {
|
|
3254
3501
|
// Update our state
|
|
3255
3502
|
updatedItems.forEach((pickableItem) => {
|
|
3256
3503
|
if (pickableItem.isGroup) {
|
|
3257
3504
|
// Has subcontexts
|
|
3258
|
-
pickableItem.
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3505
|
+
if (pickableItem.id === '_') {
|
|
3506
|
+
// Built-in
|
|
3507
|
+
// Treat as if these were top-level contexts
|
|
3508
|
+
pickableItem.children.forEach((subcontextItem) => {
|
|
3509
|
+
contextFilterState[subcontextItem.id] = ('checked' in subcontextItem
|
|
3510
|
+
&& subcontextItem.checked);
|
|
3511
|
+
});
|
|
3512
|
+
}
|
|
3513
|
+
else {
|
|
3514
|
+
// Not built-in
|
|
3515
|
+
pickableItem.children.forEach((subcontextItem) => {
|
|
3516
|
+
if (!subcontextItem.isGroup) {
|
|
3517
|
+
contextFilterState[pickableItem.id][subcontextItem.id] = (subcontextItem.checked);
|
|
3518
|
+
}
|
|
3519
|
+
});
|
|
3520
|
+
}
|
|
3263
3521
|
}
|
|
3264
3522
|
else {
|
|
3265
3523
|
// No subcontexts
|
|
@@ -3274,17 +3532,19 @@ const LogReviewer = (props) => {
|
|
|
3274
3532
|
}
|
|
3275
3533
|
else if (expandedFilterDrawer === FilterDrawer.Tag) {
|
|
3276
3534
|
// Create filter UI
|
|
3277
|
-
filterDrawer = (React.createElement(TabBox, { title: "Tags" },
|
|
3278
|
-
.
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3535
|
+
filterDrawer = (React.createElement(TabBox, { title: "Tags" },
|
|
3536
|
+
React.createElement("div", null, "If any are selected, logs must contain at least one but not necessarily all of the selected tags."),
|
|
3537
|
+
Object.keys((_f = LogMetadata.Tag) !== null && _f !== void 0 ? _f : {})
|
|
3538
|
+
.map((tag, i) => {
|
|
3539
|
+
const description = genHumanReadableName(tag);
|
|
3540
|
+
return (React.createElement(CheckboxButton, { id: `LogReviewer-tag-${tag}-checkbox`, text: description, ariaLabel: `require that logs be tagged with "${description}" or any other selected tag`, noMarginOnRight: i === Object.keys(tagFilterState).length - 1, checked: tagFilterState[tag], onChanged: (checked) => {
|
|
3541
|
+
tagFilterState[tag] = checked;
|
|
3542
|
+
dispatch({
|
|
3543
|
+
type: ActionType.UpdateTagFilterState,
|
|
3544
|
+
tagFilterState,
|
|
3545
|
+
});
|
|
3546
|
+
} }));
|
|
3547
|
+
})));
|
|
3288
3548
|
}
|
|
3289
3549
|
else if (expandedFilterDrawer === FilterDrawer.Action) {
|
|
3290
3550
|
// Create filter UI
|
|
@@ -3325,21 +3585,18 @@ const LogReviewer = (props) => {
|
|
|
3325
3585
|
});
|
|
3326
3586
|
} }));
|
|
3327
3587
|
})),
|
|
3328
|
-
React.createElement(ButtonInputGroup, { label: "Target" },
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
});
|
|
3341
|
-
}, noMarginOnRight: i === Object.keys((_a = LogMetadata.Target) !== null && _a !== void 0 ? _a : {}).length - 1 }));
|
|
3342
|
-
})))),
|
|
3588
|
+
React.createElement(ButtonInputGroup, { label: "Target" }, Object.keys(targetMap)
|
|
3589
|
+
.map((target, i) => {
|
|
3590
|
+
const description = genHumanReadableName(target);
|
|
3591
|
+
return (React.createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: actionErrorFilterState.target[target], onChanged: (checked) => {
|
|
3592
|
+
actionErrorFilterState.target[target] = checked;
|
|
3593
|
+
console.log(actionErrorFilterState, target, checked);
|
|
3594
|
+
dispatch({
|
|
3595
|
+
type: ActionType.UpdateActionErrorFilterState,
|
|
3596
|
+
actionErrorFilterState,
|
|
3597
|
+
});
|
|
3598
|
+
}, noMarginOnRight: i === Object.keys(targetMap).length - 1 }));
|
|
3599
|
+
})))),
|
|
3343
3600
|
(actionErrorFilterState.type === undefined
|
|
3344
3601
|
|| actionErrorFilterState.type === LogType$1.Error) && (React.createElement(TabBox, { title: "Error Log Details" },
|
|
3345
3602
|
React.createElement("div", { className: "input-group mb-2" },
|
|
@@ -3781,193 +4038,6 @@ const LogReviewer = (props) => {
|
|
|
3781
4038
|
/*----------------------------------------*/
|
|
3782
4039
|
/* Data */
|
|
3783
4040
|
/*----------------------------------------*/
|
|
3784
|
-
// Create data table
|
|
3785
|
-
const columns = [
|
|
3786
|
-
{
|
|
3787
|
-
title: 'First Name',
|
|
3788
|
-
param: 'userFirstName',
|
|
3789
|
-
type: ParamType$1.String,
|
|
3790
|
-
},
|
|
3791
|
-
{
|
|
3792
|
-
title: 'Last Name',
|
|
3793
|
-
param: 'userLastName',
|
|
3794
|
-
type: ParamType$1.String,
|
|
3795
|
-
},
|
|
3796
|
-
{
|
|
3797
|
-
title: 'Email',
|
|
3798
|
-
param: 'userEmail',
|
|
3799
|
-
type: ParamType$1.String,
|
|
3800
|
-
},
|
|
3801
|
-
{
|
|
3802
|
-
title: 'Canvas Id',
|
|
3803
|
-
param: 'userId',
|
|
3804
|
-
type: ParamType$1.Int,
|
|
3805
|
-
},
|
|
3806
|
-
{
|
|
3807
|
-
title: 'Student?',
|
|
3808
|
-
param: 'isLearner',
|
|
3809
|
-
type: ParamType$1.Boolean,
|
|
3810
|
-
},
|
|
3811
|
-
{
|
|
3812
|
-
title: 'Teaching Staff?',
|
|
3813
|
-
param: 'isTTM',
|
|
3814
|
-
type: ParamType$1.Boolean,
|
|
3815
|
-
startsHidden: true,
|
|
3816
|
-
},
|
|
3817
|
-
{
|
|
3818
|
-
title: 'Admin?',
|
|
3819
|
-
param: 'isAdmin',
|
|
3820
|
-
type: ParamType$1.Boolean,
|
|
3821
|
-
startsHidden: true,
|
|
3822
|
-
},
|
|
3823
|
-
{
|
|
3824
|
-
title: 'Course Canvas Id',
|
|
3825
|
-
param: 'courseId',
|
|
3826
|
-
type: ParamType$1.Int,
|
|
3827
|
-
startsHidden: true,
|
|
3828
|
-
},
|
|
3829
|
-
{
|
|
3830
|
-
title: 'Course Name',
|
|
3831
|
-
param: 'courseName',
|
|
3832
|
-
type: ParamType$1.String,
|
|
3833
|
-
},
|
|
3834
|
-
{
|
|
3835
|
-
title: 'Browser Name',
|
|
3836
|
-
param: 'browser.name',
|
|
3837
|
-
type: ParamType$1.String,
|
|
3838
|
-
startsHidden: true,
|
|
3839
|
-
},
|
|
3840
|
-
{
|
|
3841
|
-
title: 'Browser Version',
|
|
3842
|
-
param: 'browser.version',
|
|
3843
|
-
type: ParamType$1.String,
|
|
3844
|
-
startsHidden: true,
|
|
3845
|
-
},
|
|
3846
|
-
{
|
|
3847
|
-
title: 'OS',
|
|
3848
|
-
param: 'device.os',
|
|
3849
|
-
type: ParamType$1.String,
|
|
3850
|
-
startsHidden: true,
|
|
3851
|
-
},
|
|
3852
|
-
{
|
|
3853
|
-
title: 'Mobile?',
|
|
3854
|
-
param: 'device.isMobile',
|
|
3855
|
-
type: ParamType$1.Boolean,
|
|
3856
|
-
startsHidden: true,
|
|
3857
|
-
},
|
|
3858
|
-
{
|
|
3859
|
-
title: 'Year',
|
|
3860
|
-
param: 'year',
|
|
3861
|
-
type: ParamType$1.Int,
|
|
3862
|
-
},
|
|
3863
|
-
{
|
|
3864
|
-
title: 'Month',
|
|
3865
|
-
param: 'month',
|
|
3866
|
-
type: ParamType$1.Int,
|
|
3867
|
-
},
|
|
3868
|
-
{
|
|
3869
|
-
title: 'Day',
|
|
3870
|
-
param: 'day',
|
|
3871
|
-
type: ParamType$1.Int,
|
|
3872
|
-
},
|
|
3873
|
-
{
|
|
3874
|
-
title: 'Hour',
|
|
3875
|
-
param: 'hour',
|
|
3876
|
-
type: ParamType$1.Int,
|
|
3877
|
-
},
|
|
3878
|
-
{
|
|
3879
|
-
title: 'Minute',
|
|
3880
|
-
param: 'minute',
|
|
3881
|
-
type: ParamType$1.Int,
|
|
3882
|
-
startsHidden: true,
|
|
3883
|
-
},
|
|
3884
|
-
{
|
|
3885
|
-
title: 'Timestamp',
|
|
3886
|
-
param: 'timestamp',
|
|
3887
|
-
type: ParamType$1.Int,
|
|
3888
|
-
startsHidden: true,
|
|
3889
|
-
},
|
|
3890
|
-
{
|
|
3891
|
-
title: 'Context',
|
|
3892
|
-
param: 'context',
|
|
3893
|
-
type: ParamType$1.String,
|
|
3894
|
-
},
|
|
3895
|
-
{
|
|
3896
|
-
title: 'Subcontext',
|
|
3897
|
-
param: 'subcontext',
|
|
3898
|
-
type: ParamType$1.String,
|
|
3899
|
-
},
|
|
3900
|
-
{
|
|
3901
|
-
title: 'Tags',
|
|
3902
|
-
param: 'tags',
|
|
3903
|
-
type: ParamType$1.JSON,
|
|
3904
|
-
startsHidden: true,
|
|
3905
|
-
},
|
|
3906
|
-
{
|
|
3907
|
-
title: 'Log Level',
|
|
3908
|
-
param: 'level',
|
|
3909
|
-
type: ParamType$1.String,
|
|
3910
|
-
startsHidden: true,
|
|
3911
|
-
},
|
|
3912
|
-
{
|
|
3913
|
-
title: 'Metadata',
|
|
3914
|
-
param: 'metadata',
|
|
3915
|
-
type: ParamType$1.JSON,
|
|
3916
|
-
startsHidden: true,
|
|
3917
|
-
},
|
|
3918
|
-
{
|
|
3919
|
-
title: 'Source',
|
|
3920
|
-
param: 'source',
|
|
3921
|
-
type: ParamType$1.String,
|
|
3922
|
-
},
|
|
3923
|
-
{
|
|
3924
|
-
title: 'Server Route Path',
|
|
3925
|
-
param: 'routePath',
|
|
3926
|
-
type: ParamType$1.String,
|
|
3927
|
-
startsHidden: true,
|
|
3928
|
-
},
|
|
3929
|
-
{
|
|
3930
|
-
title: 'Server Route Template',
|
|
3931
|
-
param: 'routeTemplate',
|
|
3932
|
-
type: ParamType$1.String,
|
|
3933
|
-
startsHidden: true,
|
|
3934
|
-
},
|
|
3935
|
-
{
|
|
3936
|
-
title: 'Type',
|
|
3937
|
-
param: 'type',
|
|
3938
|
-
type: ParamType$1.String,
|
|
3939
|
-
},
|
|
3940
|
-
{
|
|
3941
|
-
title: 'Error Message',
|
|
3942
|
-
param: 'errorMessage',
|
|
3943
|
-
type: ParamType$1.String,
|
|
3944
|
-
startsHidden: true,
|
|
3945
|
-
},
|
|
3946
|
-
{
|
|
3947
|
-
title: 'Error Code',
|
|
3948
|
-
param: 'errorCode',
|
|
3949
|
-
type: ParamType$1.String,
|
|
3950
|
-
startsHidden: true,
|
|
3951
|
-
},
|
|
3952
|
-
{
|
|
3953
|
-
title: 'Error Stack',
|
|
3954
|
-
param: 'errorStack',
|
|
3955
|
-
type: ParamType$1.String,
|
|
3956
|
-
startsHidden: true,
|
|
3957
|
-
},
|
|
3958
|
-
{
|
|
3959
|
-
title: 'Action Target',
|
|
3960
|
-
param: 'target',
|
|
3961
|
-
type: ParamType$1.String,
|
|
3962
|
-
startsHidden: true,
|
|
3963
|
-
},
|
|
3964
|
-
{
|
|
3965
|
-
title: 'Action Type',
|
|
3966
|
-
param: 'action',
|
|
3967
|
-
type: ParamType$1.String,
|
|
3968
|
-
startsHidden: true,
|
|
3969
|
-
},
|
|
3970
|
-
];
|
|
3971
4041
|
// Nothing to show notice
|
|
3972
4042
|
const noLogsNotice = (logs.length === 0
|
|
3973
4043
|
? (React.createElement("div", { className: "alert alert-warning text-center mt-2" },
|