dce-reactkit 3.9.4-beta-logreviewer.7 → 3.9.4-beta-logreviewer.8
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 +225 -175
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Pagination.d.ts +9 -0
- package/dist/esm/index.js +225 -175
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Pagination.d.ts +9 -0
- package/package.json +1 -1
- package/src/components/LogReviewer.tsx +271 -221
- package/src/components/Pagination.tsx +147 -0
package/dist/cjs/index.js
CHANGED
|
@@ -3342,6 +3342,55 @@ const IntelliTable = (props) => {
|
|
|
3342
3342
|
} }, table)));
|
|
3343
3343
|
};
|
|
3344
3344
|
|
|
3345
|
+
/*------------------------------------------------------------------------*/
|
|
3346
|
+
/* ------------------------------ Component ----------------------------- */
|
|
3347
|
+
/*------------------------------------------------------------------------*/
|
|
3348
|
+
const Pagination = ({ currentPage, numPages, loading = false, onPageChanged, }) => {
|
|
3349
|
+
// computes an array of page numbers to display.
|
|
3350
|
+
const getPageNumbers = () => {
|
|
3351
|
+
const pages = [];
|
|
3352
|
+
const delta = 2; // how many pages to show on either side of current
|
|
3353
|
+
let start = Math.max(1, currentPage - delta);
|
|
3354
|
+
let end = Math.min(numPages, currentPage + delta);
|
|
3355
|
+
// If we are too close to the beginning or end, shift the window.
|
|
3356
|
+
if (currentPage - delta < 1) {
|
|
3357
|
+
end = Math.min(numPages, end + (1 - (currentPage - delta)));
|
|
3358
|
+
}
|
|
3359
|
+
if (currentPage + delta > numPages) {
|
|
3360
|
+
start = Math.max(1, start - ((currentPage + delta) - numPages));
|
|
3361
|
+
}
|
|
3362
|
+
for (let i = start; i <= end; i++) {
|
|
3363
|
+
pages.push(i);
|
|
3364
|
+
}
|
|
3365
|
+
return pages;
|
|
3366
|
+
};
|
|
3367
|
+
const pages = getPageNumbers();
|
|
3368
|
+
return (React__default["default"].createElement("nav", { "aria-label": "Page navigation", className: "mt-3" },
|
|
3369
|
+
React__default["default"].createElement("ul", { className: "pagination justify-content-center" },
|
|
3370
|
+
React__default["default"].createElement("li", { className: `page-item ${(currentPage <= 1 || loading) ? 'disabled' : ''}` },
|
|
3371
|
+
React__default["default"].createElement("button", { type: "button", className: "page-link", onClick: () => { return onPageChanged(currentPage - 1); }, disabled: currentPage <= 1 || loading },
|
|
3372
|
+
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faArrowLeft }),
|
|
3373
|
+
' ',
|
|
3374
|
+
"Prev")),
|
|
3375
|
+
currentPage > 3 && (React__default["default"].createElement("li", { className: "page-item" },
|
|
3376
|
+
React__default["default"].createElement("button", { type: "button", className: "page-link", onClick: () => { return onPageChanged(1); }, disabled: loading }, "1"))),
|
|
3377
|
+
currentPage > 4 && (React__default["default"].createElement("li", { className: "page-item disabled" },
|
|
3378
|
+
React__default["default"].createElement("span", { className: "page-link" }, "..."))),
|
|
3379
|
+
pages.map((pageNum) => {
|
|
3380
|
+
return (React__default["default"].createElement("li", { key: pageNum, className: `page-item ${pageNum === currentPage ? 'active' : ''}` },
|
|
3381
|
+
React__default["default"].createElement("button", { type: "button", className: "page-link", onClick: () => { return onPageChanged(pageNum); }, disabled: loading }, pageNum)));
|
|
3382
|
+
}),
|
|
3383
|
+
currentPage < numPages - 3 && (React__default["default"].createElement("li", { className: "page-item disabled" },
|
|
3384
|
+
React__default["default"].createElement("span", { className: "page-link" }, "..."))),
|
|
3385
|
+
currentPage < numPages - 2 && (React__default["default"].createElement("li", { className: "page-item" },
|
|
3386
|
+
React__default["default"].createElement("button", { type: "button", className: "page-link", onClick: () => { return onPageChanged(numPages); }, disabled: loading }, numPages))),
|
|
3387
|
+
React__default["default"].createElement("li", { className: `page-item ${(currentPage >= numPages || loading) ? 'disabled' : ''}` },
|
|
3388
|
+
React__default["default"].createElement("button", { type: "button", className: "page-link", onClick: () => { return onPageChanged(currentPage + 1); }, disabled: currentPage >= numPages || loading },
|
|
3389
|
+
"Next",
|
|
3390
|
+
' ',
|
|
3391
|
+
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faArrowRight }))))));
|
|
3392
|
+
};
|
|
3393
|
+
|
|
3345
3394
|
/**
|
|
3346
3395
|
* Log reviewer panel that allows users (must be approved admins) to
|
|
3347
3396
|
* review logs written by dce-reactkit
|
|
@@ -3721,6 +3770,8 @@ var ActionType$6;
|
|
|
3721
3770
|
ActionType["SetNumPages"] = "set-num-pages";
|
|
3722
3771
|
// Set page number
|
|
3723
3772
|
ActionType["SetPageNumber"] = "set-page-number";
|
|
3773
|
+
// Reset user made filter change indicator
|
|
3774
|
+
ActionType["ResetUserMadeFilterChange"] = "reset-user-made-filter-change";
|
|
3724
3775
|
})(ActionType$6 || (ActionType$6 = {}));
|
|
3725
3776
|
/**
|
|
3726
3777
|
* Reducer that executes actions
|
|
@@ -3745,22 +3796,22 @@ const reducer$7 = (state, action) => {
|
|
|
3745
3796
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
|
|
3746
3797
|
}
|
|
3747
3798
|
case ActionType$6.ResetFilters: {
|
|
3748
|
-
return Object.assign(Object.assign({}, state), {
|
|
3799
|
+
return Object.assign(Object.assign({}, state), { pendingDateFilterState: action.initDateFilterState, pendingContextFilterState: action.initContextFilterState, pendingTagFilterState: action.initTagFilterState, pendingActionErrorFilterState: action.initActionErrorFilterState, pendingAdvancedFilterState: action.initAdvancedFilterState, pageNumber: 1 });
|
|
3749
3800
|
}
|
|
3750
3801
|
case ActionType$6.UpdateDateFilterState: {
|
|
3751
|
-
return Object.assign(Object.assign({}, state), {
|
|
3802
|
+
return Object.assign(Object.assign({}, state), { pendingDateFilterState: action.dateFilterState, userMadeFilterChange: true });
|
|
3752
3803
|
}
|
|
3753
3804
|
case ActionType$6.UpdateContextFilterState: {
|
|
3754
|
-
return Object.assign(Object.assign({}, state), {
|
|
3805
|
+
return Object.assign(Object.assign({}, state), { pendingContextFilterState: action.contextFilterState, userMadeFilterChange: true });
|
|
3755
3806
|
}
|
|
3756
3807
|
case ActionType$6.UpdateTagFilterState: {
|
|
3757
|
-
return Object.assign(Object.assign({}, state), {
|
|
3808
|
+
return Object.assign(Object.assign({}, state), { pendingTagFilterState: action.tagFilterState, userMadeFilterChange: true });
|
|
3758
3809
|
}
|
|
3759
3810
|
case ActionType$6.UpdateActionErrorFilterState: {
|
|
3760
|
-
return Object.assign(Object.assign({}, state), {
|
|
3811
|
+
return Object.assign(Object.assign({}, state), { pendingActionErrorFilterState: action.actionErrorFilterState, userMadeFilterChange: true });
|
|
3761
3812
|
}
|
|
3762
3813
|
case ActionType$6.UpdateAdvancedFilterState: {
|
|
3763
|
-
return Object.assign(Object.assign({}, state), {
|
|
3814
|
+
return Object.assign(Object.assign({}, state), { pendingAdvancedFilterState: action.advancedFilterState, userMadeFilterChange: true });
|
|
3764
3815
|
}
|
|
3765
3816
|
case ActionType$6.SetHasAnotherPage: {
|
|
3766
3817
|
return Object.assign(Object.assign({}, state), { hasAnotherPage: action.hasAnotherPage });
|
|
@@ -3771,6 +3822,9 @@ const reducer$7 = (state, action) => {
|
|
|
3771
3822
|
case ActionType$6.SetPageNumber: {
|
|
3772
3823
|
return Object.assign(Object.assign({}, state), { pageNumber: action.pageNumber });
|
|
3773
3824
|
}
|
|
3825
|
+
case ActionType$6.ResetUserMadeFilterChange: {
|
|
3826
|
+
return Object.assign(Object.assign({}, state), { userMadeFilterChange: false });
|
|
3827
|
+
}
|
|
3774
3828
|
default: {
|
|
3775
3829
|
return state;
|
|
3776
3830
|
}
|
|
@@ -3891,19 +3945,29 @@ const LogReviewer = (props) => {
|
|
|
3891
3945
|
showSpinner: true,
|
|
3892
3946
|
logs: [],
|
|
3893
3947
|
expandedFilterDrawer: undefined,
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3948
|
+
pendingDateFilterState: initDateFilterState,
|
|
3949
|
+
pendingContextFilterState: initContextFilterState,
|
|
3950
|
+
pendingTagFilterState: initTagFilterState,
|
|
3951
|
+
pendingActionErrorFilterState: initActionErrorFilterState,
|
|
3952
|
+
pendingAdvancedFilterState: initAdvancedFilterState,
|
|
3899
3953
|
pageNumber: 1,
|
|
3900
3954
|
hasAnotherPage: false,
|
|
3901
3955
|
numPages: 1,
|
|
3956
|
+
userMadeFilterChange: false,
|
|
3902
3957
|
};
|
|
3903
3958
|
// Initialize state
|
|
3904
3959
|
const [state, dispatch] = React.useReducer(reducer$7, initialState);
|
|
3905
3960
|
// Destructure common state
|
|
3906
|
-
const { loading, showSpinner, logs, expandedFilterDrawer,
|
|
3961
|
+
const { loading, showSpinner, logs, expandedFilterDrawer, pendingDateFilterState, pendingContextFilterState, pendingTagFilterState, pendingActionErrorFilterState, pendingAdvancedFilterState, pageNumber, numPages, userMadeFilterChange, } = state;
|
|
3962
|
+
/* -------------- Refs -------------- */
|
|
3963
|
+
// Initialize refs
|
|
3964
|
+
const activeFiltersRef = React.useRef({
|
|
3965
|
+
dateFilterState: JSON.parse(JSON.stringify(pendingDateFilterState)),
|
|
3966
|
+
contextFilterState: JSON.parse(JSON.stringify(pendingContextFilterState)),
|
|
3967
|
+
tagFilterState: JSON.parse(JSON.stringify(pendingTagFilterState)),
|
|
3968
|
+
actionErrorFilterState: JSON.parse(JSON.stringify(pendingActionErrorFilterState)),
|
|
3969
|
+
advancedFilterState: JSON.parse(JSON.stringify(pendingAdvancedFilterState)),
|
|
3970
|
+
});
|
|
3907
3971
|
/*------------------------------------------------------------------------*/
|
|
3908
3972
|
/* ------------------------- Component Functions ------------------------ */
|
|
3909
3973
|
/*------------------------------------------------------------------------*/
|
|
@@ -3962,11 +4026,11 @@ const LogReviewer = (props) => {
|
|
|
3962
4026
|
React.useEffect(() => {
|
|
3963
4027
|
fetchLogs({
|
|
3964
4028
|
filters: {
|
|
3965
|
-
dateFilterState,
|
|
3966
|
-
contextFilterState,
|
|
3967
|
-
tagFilterState,
|
|
3968
|
-
actionErrorFilterState,
|
|
3969
|
-
advancedFilterState,
|
|
4029
|
+
dateFilterState: pendingDateFilterState,
|
|
4030
|
+
contextFilterState: pendingContextFilterState,
|
|
4031
|
+
tagFilterState: pendingTagFilterState,
|
|
4032
|
+
actionErrorFilterState: pendingActionErrorFilterState,
|
|
4033
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
3970
4034
|
},
|
|
3971
4035
|
pageNum: 1,
|
|
3972
4036
|
filtersChanged: true,
|
|
@@ -3989,51 +4053,25 @@ const LogReviewer = (props) => {
|
|
|
3989
4053
|
/*----------------------------------------*/
|
|
3990
4054
|
/* ------------ Pagination -------------- */
|
|
3991
4055
|
/*----------------------------------------*/
|
|
3992
|
-
const paginationControls = logs.length > 0 && (React__default["default"].createElement(
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faArrowLeft, className: "me-2" }),
|
|
4007
|
-
"Previous Page"),
|
|
4008
|
-
React__default["default"].createElement("span", { className: "mx-3" },
|
|
4009
|
-
"Page",
|
|
4010
|
-
' ',
|
|
4011
|
-
pageNumber,
|
|
4012
|
-
' ',
|
|
4013
|
-
"of",
|
|
4014
|
-
' ',
|
|
4015
|
-
numPages),
|
|
4016
|
-
React__default["default"].createElement("button", { type: "button", className: "btn btn-secondary ms-2", disabled: !hasAnotherPage || loading, onClick: () => {
|
|
4017
|
-
fetchLogs({
|
|
4018
|
-
filters: {
|
|
4019
|
-
dateFilterState,
|
|
4020
|
-
contextFilterState,
|
|
4021
|
-
tagFilterState,
|
|
4022
|
-
actionErrorFilterState,
|
|
4023
|
-
advancedFilterState,
|
|
4024
|
-
},
|
|
4025
|
-
pageNum: pageNumber + 1,
|
|
4026
|
-
filtersChanged: false,
|
|
4027
|
-
});
|
|
4028
|
-
} },
|
|
4029
|
-
"Next Page",
|
|
4030
|
-
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faArrowRight, className: "ms-2" }))));
|
|
4056
|
+
const paginationControls = logs.length > 0 && (React__default["default"].createElement(Pagination, { currentPage: pageNumber, numPages: numPages, loading: loading, onPageChanged: (targetPage) => {
|
|
4057
|
+
const { current: activeFilters } = activeFiltersRef;
|
|
4058
|
+
fetchLogs({
|
|
4059
|
+
filters: {
|
|
4060
|
+
dateFilterState: activeFilters.dateFilterState,
|
|
4061
|
+
contextFilterState: activeFilters.contextFilterState,
|
|
4062
|
+
tagFilterState: activeFilters.tagFilterState,
|
|
4063
|
+
actionErrorFilterState: activeFilters.actionErrorFilterState,
|
|
4064
|
+
advancedFilterState: activeFilters.advancedFilterState,
|
|
4065
|
+
},
|
|
4066
|
+
pageNum: targetPage,
|
|
4067
|
+
filtersChanged: false,
|
|
4068
|
+
});
|
|
4069
|
+
} }));
|
|
4031
4070
|
/*----------------------------------------*/
|
|
4032
4071
|
/* --------------- Filters -------------- */
|
|
4033
4072
|
/*----------------------------------------*/
|
|
4034
4073
|
// Filter toggle
|
|
4035
4074
|
const filterToggles = (React__default["default"].createElement("div", { className: "LogReviewer-filter-toggles" },
|
|
4036
|
-
React__default["default"].createElement("h3", { className: "m-0" }, "Filters:"),
|
|
4037
4075
|
React__default["default"].createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
|
|
4038
4076
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-date-filter-drawer", className: `btn btn-${FilterDrawer.Date === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle date filter drawer", onClick: () => {
|
|
4039
4077
|
dispatch({
|
|
@@ -4102,17 +4140,29 @@ const LogReviewer = (props) => {
|
|
|
4102
4140
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faTimes }),
|
|
4103
4141
|
' ',
|
|
4104
4142
|
"Reset"),
|
|
4105
|
-
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-submit-filters-button", className: "btn btn-primary ms-2", "aria-label": "submit filters", onClick: () => {
|
|
4143
|
+
userMadeFilterChange && (React__default["default"].createElement("button", { type: "button", id: "LogReviewer-submit-filters-button", className: "btn btn-primary ms-2", "aria-label": "submit filters", onClick: () => {
|
|
4106
4144
|
dispatch({
|
|
4107
4145
|
type: ActionType$6.HideFilterDrawer,
|
|
4108
4146
|
});
|
|
4147
|
+
// Reset user made filter change indicator
|
|
4148
|
+
dispatch({
|
|
4149
|
+
type: ActionType$6.ResetUserMadeFilterChange,
|
|
4150
|
+
});
|
|
4151
|
+
// Save active filters
|
|
4152
|
+
activeFiltersRef.current = {
|
|
4153
|
+
dateFilterState: JSON.parse(JSON.stringify(pendingDateFilterState)),
|
|
4154
|
+
contextFilterState: JSON.parse(JSON.stringify(pendingContextFilterState)),
|
|
4155
|
+
tagFilterState: JSON.parse(JSON.stringify(pendingTagFilterState)),
|
|
4156
|
+
actionErrorFilterState: JSON.parse(JSON.stringify(pendingActionErrorFilterState)),
|
|
4157
|
+
advancedFilterState: JSON.parse(JSON.stringify(pendingAdvancedFilterState)),
|
|
4158
|
+
};
|
|
4109
4159
|
fetchLogs({
|
|
4110
4160
|
filters: {
|
|
4111
|
-
dateFilterState,
|
|
4112
|
-
contextFilterState,
|
|
4113
|
-
tagFilterState,
|
|
4114
|
-
actionErrorFilterState,
|
|
4115
|
-
advancedFilterState,
|
|
4161
|
+
dateFilterState: pendingDateFilterState,
|
|
4162
|
+
contextFilterState: pendingContextFilterState,
|
|
4163
|
+
tagFilterState: pendingTagFilterState,
|
|
4164
|
+
actionErrorFilterState: pendingActionErrorFilterState,
|
|
4165
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4116
4166
|
},
|
|
4117
4167
|
pageNum: 1,
|
|
4118
4168
|
filtersChanged: true,
|
|
@@ -4120,35 +4170,35 @@ const LogReviewer = (props) => {
|
|
|
4120
4170
|
} },
|
|
4121
4171
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faSearch }),
|
|
4122
4172
|
' ',
|
|
4123
|
-
"
|
|
4173
|
+
"Apply Filters")))));
|
|
4124
4174
|
// Filter drawer
|
|
4125
4175
|
let filterDrawer;
|
|
4126
4176
|
if (expandedFilterDrawer) {
|
|
4127
4177
|
if (expandedFilterDrawer === FilterDrawer.Date) {
|
|
4128
4178
|
filterDrawer = (React__default["default"].createElement(TabBox, { title: "Date" },
|
|
4129
|
-
React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter start date", name: "filter-start-date", year:
|
|
4130
|
-
|
|
4179
|
+
React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter start date", name: "filter-start-date", year: pendingDateFilterState.startDate.year, month: pendingDateFilterState.startDate.month, day: pendingDateFilterState.startDate.day, chooseFromPast: true, numMonthsToShow: 36, onChange: (month, day, year) => {
|
|
4180
|
+
pendingDateFilterState.startDate = { month, day, year };
|
|
4131
4181
|
dispatch({
|
|
4132
4182
|
type: ActionType$6.UpdateDateFilterState,
|
|
4133
|
-
dateFilterState,
|
|
4183
|
+
dateFilterState: pendingDateFilterState,
|
|
4134
4184
|
});
|
|
4135
4185
|
} }),
|
|
4136
4186
|
' ',
|
|
4137
4187
|
"to",
|
|
4138
4188
|
' ',
|
|
4139
|
-
React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter end date", name: "filter-end-date", year:
|
|
4140
|
-
if (year <
|
|
4141
|
-
|| (year ===
|
|
4142
|
-
&& month <
|
|
4143
|
-
|| (year ===
|
|
4144
|
-
&& month ===
|
|
4145
|
-
&& day <
|
|
4189
|
+
React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter end date", name: "filter-end-date", year: pendingDateFilterState.endDate.year, month: pendingDateFilterState.endDate.month, day: pendingDateFilterState.endDate.day, chooseFromPast: true, numMonthsToShow: 12, onChange: (month, day, year) => {
|
|
4190
|
+
if (year < pendingDateFilterState.startDate.year
|
|
4191
|
+
|| (year === pendingDateFilterState.startDate.year
|
|
4192
|
+
&& month < pendingDateFilterState.startDate.month)
|
|
4193
|
+
|| (year === pendingDateFilterState.startDate.year
|
|
4194
|
+
&& month === pendingDateFilterState.startDate.month
|
|
4195
|
+
&& day < pendingDateFilterState.startDate.day)) {
|
|
4146
4196
|
return alert('Invalid Start Date', 'The start date cannot be before the end date.');
|
|
4147
4197
|
}
|
|
4148
|
-
|
|
4198
|
+
pendingDateFilterState.endDate = { month, day, year };
|
|
4149
4199
|
dispatch({
|
|
4150
4200
|
type: ActionType$6.UpdateDateFilterState,
|
|
4151
|
-
dateFilterState,
|
|
4201
|
+
dateFilterState: pendingDateFilterState,
|
|
4152
4202
|
});
|
|
4153
4203
|
} })));
|
|
4154
4204
|
}
|
|
@@ -4170,7 +4220,7 @@ const LogReviewer = (props) => {
|
|
|
4170
4220
|
id: context,
|
|
4171
4221
|
name: genHumanReadableName(context),
|
|
4172
4222
|
isGroup: false,
|
|
4173
|
-
checked: !!
|
|
4223
|
+
checked: !!pendingContextFilterState[context],
|
|
4174
4224
|
};
|
|
4175
4225
|
// Add built-in items to its own folder
|
|
4176
4226
|
const isBuiltIn = context in LogBuiltInMetadata.Context;
|
|
@@ -4196,7 +4246,7 @@ const LogReviewer = (props) => {
|
|
|
4196
4246
|
id: subcontext,
|
|
4197
4247
|
name: genHumanReadableName(subcontext),
|
|
4198
4248
|
isGroup: false,
|
|
4199
|
-
checked:
|
|
4249
|
+
checked: pendingContextFilterState[context][subcontext],
|
|
4200
4250
|
};
|
|
4201
4251
|
}));
|
|
4202
4252
|
const item = {
|
|
@@ -4219,7 +4269,7 @@ const LogReviewer = (props) => {
|
|
|
4219
4269
|
// Built-in
|
|
4220
4270
|
// Treat as if these were top-level contexts
|
|
4221
4271
|
pickableItem.children.forEach((subcontextItem) => {
|
|
4222
|
-
|
|
4272
|
+
pendingContextFilterState[subcontextItem.id] = ('checked' in subcontextItem
|
|
4223
4273
|
&& subcontextItem.checked);
|
|
4224
4274
|
});
|
|
4225
4275
|
}
|
|
@@ -4227,19 +4277,19 @@ const LogReviewer = (props) => {
|
|
|
4227
4277
|
// Not built-in
|
|
4228
4278
|
pickableItem.children.forEach((subcontextItem) => {
|
|
4229
4279
|
if (!subcontextItem.isGroup) {
|
|
4230
|
-
|
|
4280
|
+
pendingContextFilterState[pickableItem.id][subcontextItem.id] = (subcontextItem.checked);
|
|
4231
4281
|
}
|
|
4232
4282
|
});
|
|
4233
4283
|
}
|
|
4234
4284
|
}
|
|
4235
4285
|
else {
|
|
4236
4286
|
// No subcontexts
|
|
4237
|
-
|
|
4287
|
+
pendingContextFilterState[pickableItem.id] = (pickableItem.checked);
|
|
4238
4288
|
}
|
|
4239
4289
|
});
|
|
4240
4290
|
dispatch({
|
|
4241
4291
|
type: ActionType$6.UpdateContextFilterState,
|
|
4242
|
-
contextFilterState,
|
|
4292
|
+
contextFilterState: pendingContextFilterState,
|
|
4243
4293
|
});
|
|
4244
4294
|
} }));
|
|
4245
4295
|
}
|
|
@@ -4250,13 +4300,13 @@ const LogReviewer = (props) => {
|
|
|
4250
4300
|
React__default["default"].createElement("div", { className: "d-flex gap-1 flex-wrap" }, Object.keys((_d = LogMetadata.Tag) !== null && _d !== void 0 ? _d : {})
|
|
4251
4301
|
.map((tag) => {
|
|
4252
4302
|
const description = genHumanReadableName(tag);
|
|
4253
|
-
return (React__default["default"].createElement(CheckboxButton, { key: tag, id: `LogReviewer-tag-${tag}-checkbox`, text: description, ariaLabel: `require that logs be tagged with "${description}" or any other selected tag`, checked:
|
|
4254
|
-
|
|
4303
|
+
return (React__default["default"].createElement(CheckboxButton, { key: tag, id: `LogReviewer-tag-${tag}-checkbox`, text: description, ariaLabel: `require that logs be tagged with "${description}" or any other selected tag`, checked: pendingTagFilterState[tag], onChanged: (checked) => {
|
|
4304
|
+
pendingTagFilterState[tag] = checked;
|
|
4255
4305
|
dispatch({
|
|
4256
4306
|
type: ActionType$6.UpdateTagFilterState,
|
|
4257
|
-
tagFilterState,
|
|
4307
|
+
tagFilterState: pendingTagFilterState,
|
|
4258
4308
|
});
|
|
4259
|
-
} }));
|
|
4309
|
+
}, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
|
|
4260
4310
|
}))));
|
|
4261
4311
|
}
|
|
4262
4312
|
else if (expandedFilterDrawer === FilterDrawer.Action) {
|
|
@@ -4264,70 +4314,70 @@ const LogReviewer = (props) => {
|
|
|
4264
4314
|
filterDrawer = (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4265
4315
|
React__default["default"].createElement(TabBox, { title: "Log Type" },
|
|
4266
4316
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
|
|
4267
|
-
|
|
4317
|
+
pendingActionErrorFilterState.type = undefined;
|
|
4268
4318
|
dispatch({
|
|
4269
4319
|
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4270
|
-
actionErrorFilterState,
|
|
4320
|
+
actionErrorFilterState: pendingActionErrorFilterState,
|
|
4271
4321
|
});
|
|
4272
|
-
}, ariaLabel: "show logs of all types", selected:
|
|
4322
|
+
}, ariaLabel: "show logs of all types", selected: pendingActionErrorFilterState.type === undefined, unselectedVariant: Variant$1.Light }),
|
|
4273
4323
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
|
|
4274
|
-
|
|
4324
|
+
pendingActionErrorFilterState.type = LogType$1.Action;
|
|
4275
4325
|
dispatch({
|
|
4276
4326
|
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4277
|
-
actionErrorFilterState,
|
|
4327
|
+
actionErrorFilterState: pendingActionErrorFilterState,
|
|
4278
4328
|
});
|
|
4279
|
-
}, ariaLabel: "only show action logs", selected:
|
|
4329
|
+
}, ariaLabel: "only show action logs", selected: pendingActionErrorFilterState.type === LogType$1.Action, unselectedVariant: Variant$1.Light }),
|
|
4280
4330
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
|
|
4281
|
-
|
|
4331
|
+
pendingActionErrorFilterState.type = LogType$1.Error;
|
|
4282
4332
|
dispatch({
|
|
4283
4333
|
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4284
|
-
actionErrorFilterState,
|
|
4334
|
+
actionErrorFilterState: pendingActionErrorFilterState,
|
|
4285
4335
|
});
|
|
4286
|
-
}, ariaLabel: "only show error logs", selected:
|
|
4287
|
-
(
|
|
4288
|
-
||
|
|
4336
|
+
}, ariaLabel: "only show error logs", selected: pendingActionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })),
|
|
4337
|
+
(pendingActionErrorFilterState.type === undefined
|
|
4338
|
+
|| pendingActionErrorFilterState.type === LogType$1.Action) && (React__default["default"].createElement(TabBox, { title: "Action Log Details" },
|
|
4289
4339
|
React__default["default"].createElement(ButtonInputGroup, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(LogAction$1)
|
|
4290
4340
|
.map((action) => {
|
|
4291
4341
|
const description = genHumanReadableName(action);
|
|
4292
|
-
return (React__default["default"].createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked:
|
|
4293
|
-
|
|
4342
|
+
return (React__default["default"].createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: pendingActionErrorFilterState.action[action], onChanged: (checked) => {
|
|
4343
|
+
pendingActionErrorFilterState.action[action] = checked;
|
|
4294
4344
|
dispatch({
|
|
4295
4345
|
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4296
|
-
actionErrorFilterState,
|
|
4346
|
+
actionErrorFilterState: pendingActionErrorFilterState,
|
|
4297
4347
|
});
|
|
4298
|
-
} }));
|
|
4348
|
+
}, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
|
|
4299
4349
|
})),
|
|
4300
4350
|
React__default["default"].createElement(ButtonInputGroup, { label: "Target", wrapButtonsAndAddGaps: true }, Object.keys(targetMap)
|
|
4301
4351
|
.map((target) => {
|
|
4302
4352
|
const description = genHumanReadableName(target);
|
|
4303
|
-
return (React__default["default"].createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked:
|
|
4304
|
-
|
|
4353
|
+
return (React__default["default"].createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: pendingActionErrorFilterState.target[target], noMarginOnRight: true, onChanged: (checked) => {
|
|
4354
|
+
pendingActionErrorFilterState.target[target] = checked;
|
|
4305
4355
|
dispatch({
|
|
4306
4356
|
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4307
|
-
actionErrorFilterState,
|
|
4357
|
+
actionErrorFilterState: pendingActionErrorFilterState,
|
|
4308
4358
|
});
|
|
4309
|
-
} }));
|
|
4359
|
+
}, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
|
|
4310
4360
|
})))),
|
|
4311
|
-
(
|
|
4312
|
-
||
|
|
4361
|
+
(pendingActionErrorFilterState.type === undefined
|
|
4362
|
+
|| pendingActionErrorFilterState.type === LogType$1.Error) && (React__default["default"].createElement(TabBox, { title: "Error Log Details" },
|
|
4313
4363
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4314
4364
|
React__default["default"].createElement("span", { className: "input-group-text" }, "Error Message"),
|
|
4315
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error message", value:
|
|
4316
|
-
|
|
4365
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error message", value: pendingActionErrorFilterState.errorMessage, placeholder: "e.g. undefined is not a function", onChange: (e) => {
|
|
4366
|
+
pendingActionErrorFilterState.errorMessage = e.target.value;
|
|
4317
4367
|
dispatch({
|
|
4318
4368
|
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4319
|
-
actionErrorFilterState,
|
|
4369
|
+
actionErrorFilterState: pendingActionErrorFilterState,
|
|
4320
4370
|
});
|
|
4321
4371
|
} })),
|
|
4322
4372
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4323
4373
|
React__default["default"].createElement("span", { className: "input-group-text" }, "Error Code"),
|
|
4324
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error code", value:
|
|
4325
|
-
|
|
4374
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error code", value: pendingActionErrorFilterState.errorCode, placeholder: "e.g. GC22", onChange: (e) => {
|
|
4375
|
+
pendingActionErrorFilterState.errorCode = ((e.target.value)
|
|
4326
4376
|
.trim()
|
|
4327
4377
|
.toUpperCase());
|
|
4328
4378
|
dispatch({
|
|
4329
4379
|
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4330
|
-
actionErrorFilterState,
|
|
4380
|
+
actionErrorFilterState: pendingActionErrorFilterState,
|
|
4331
4381
|
});
|
|
4332
4382
|
} }))))));
|
|
4333
4383
|
}
|
|
@@ -4337,157 +4387,157 @@ const LogReviewer = (props) => {
|
|
|
4337
4387
|
React__default["default"].createElement(TabBox, { title: "User" },
|
|
4338
4388
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4339
4389
|
React__default["default"].createElement("span", { className: "input-group-text" }, "User First Name"),
|
|
4340
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user first name", value:
|
|
4341
|
-
|
|
4390
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user first name", value: pendingAdvancedFilterState.userFirstName, placeholder: "e.g. Divardo", onChange: (e) => {
|
|
4391
|
+
pendingAdvancedFilterState.userFirstName = e.target.value;
|
|
4342
4392
|
dispatch({
|
|
4343
4393
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4344
|
-
advancedFilterState,
|
|
4394
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4345
4395
|
});
|
|
4346
4396
|
} })),
|
|
4347
4397
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4348
4398
|
React__default["default"].createElement("span", { className: "input-group-text" }, "User Last Name"),
|
|
4349
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user last name", value:
|
|
4350
|
-
|
|
4399
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user last name", value: pendingAdvancedFilterState.userLastName, placeholder: "e.g. Calicci", onChange: (e) => {
|
|
4400
|
+
pendingAdvancedFilterState.userLastName = e.target.value;
|
|
4351
4401
|
dispatch({
|
|
4352
4402
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4353
|
-
advancedFilterState,
|
|
4403
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4354
4404
|
});
|
|
4355
4405
|
} })),
|
|
4356
4406
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4357
4407
|
React__default["default"].createElement("span", { className: "input-group-text" }, "User Email"),
|
|
4358
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user email", value:
|
|
4359
|
-
|
|
4408
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user email", value: pendingAdvancedFilterState.userEmail, placeholder: "e.g. calicci@fas.harvard.edu", onChange: (e) => {
|
|
4409
|
+
pendingAdvancedFilterState.userEmail = ((e.target.value)
|
|
4360
4410
|
.trim());
|
|
4361
4411
|
dispatch({
|
|
4362
4412
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4363
|
-
advancedFilterState,
|
|
4413
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4364
4414
|
});
|
|
4365
4415
|
} })),
|
|
4366
4416
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4367
4417
|
React__default["default"].createElement("span", { className: "input-group-text" }, "User Canvas Id"),
|
|
4368
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user canvas id", value:
|
|
4418
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user canvas id", value: pendingAdvancedFilterState.userId, placeholder: "e.g. 104985", onChange: (e) => {
|
|
4369
4419
|
const { value } = e.target;
|
|
4370
4420
|
// Only update if value contains only numbers
|
|
4371
4421
|
if (/^\d+$/.test(value) || value === '') {
|
|
4372
|
-
|
|
4422
|
+
pendingAdvancedFilterState.userId = ((e.target.value)
|
|
4373
4423
|
.trim());
|
|
4374
4424
|
}
|
|
4375
4425
|
dispatch({
|
|
4376
4426
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4377
|
-
advancedFilterState,
|
|
4427
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4378
4428
|
});
|
|
4379
4429
|
} })),
|
|
4380
4430
|
React__default["default"].createElement(ButtonInputGroup, { label: "Role" },
|
|
4381
4431
|
React__default["default"].createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
|
|
4382
|
-
|
|
4432
|
+
pendingAdvancedFilterState.includeLearners = checked;
|
|
4383
4433
|
dispatch({
|
|
4384
4434
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4385
|
-
advancedFilterState,
|
|
4435
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4386
4436
|
});
|
|
4387
|
-
}, checked:
|
|
4437
|
+
}, checked: pendingAdvancedFilterState.includeLearners, ariaLabel: "show logs from students", checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }),
|
|
4388
4438
|
React__default["default"].createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
|
|
4389
|
-
|
|
4439
|
+
pendingAdvancedFilterState.includeTTMs = checked;
|
|
4390
4440
|
dispatch({
|
|
4391
4441
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4392
|
-
advancedFilterState,
|
|
4442
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4393
4443
|
});
|
|
4394
|
-
}, checked:
|
|
4444
|
+
}, checked: pendingAdvancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members", checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }),
|
|
4395
4445
|
React__default["default"].createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
|
|
4396
|
-
|
|
4446
|
+
pendingAdvancedFilterState.includeAdmins = checked;
|
|
4397
4447
|
dispatch({
|
|
4398
4448
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4399
|
-
advancedFilterState,
|
|
4449
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4400
4450
|
});
|
|
4401
|
-
}, checked:
|
|
4451
|
+
}, checked: pendingAdvancedFilterState.includeAdmins, ariaLabel: "show logs from admins", checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }))),
|
|
4402
4452
|
React__default["default"].createElement(TabBox, { title: "Course" },
|
|
4403
4453
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4404
4454
|
React__default["default"].createElement("span", { className: "input-group-text" }, "Course Name"),
|
|
4405
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for course name", value:
|
|
4406
|
-
|
|
4455
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for course name", value: pendingAdvancedFilterState.courseName, placeholder: "e.g. GLC 200", onChange: (e) => {
|
|
4456
|
+
pendingAdvancedFilterState.courseName = e.target.value;
|
|
4407
4457
|
dispatch({
|
|
4408
4458
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4409
|
-
advancedFilterState,
|
|
4459
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4410
4460
|
});
|
|
4411
4461
|
} })),
|
|
4412
4462
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4413
4463
|
React__default["default"].createElement("span", { className: "input-group-text" }, "Course Canvas Id"),
|
|
4414
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for course canvas id", value:
|
|
4464
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for course canvas id", value: pendingAdvancedFilterState.courseId, placeholder: "e.g. 15948", onChange: (e) => {
|
|
4415
4465
|
const { value } = e.target;
|
|
4416
4466
|
// Only update if value contains only numbers
|
|
4417
4467
|
if (/^\d+$/.test(value)) {
|
|
4418
|
-
|
|
4468
|
+
pendingAdvancedFilterState.courseId = ((e.target.value)
|
|
4419
4469
|
.trim());
|
|
4420
4470
|
}
|
|
4421
4471
|
dispatch({
|
|
4422
4472
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4423
|
-
advancedFilterState,
|
|
4473
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4424
4474
|
});
|
|
4425
4475
|
} }))),
|
|
4426
4476
|
React__default["default"].createElement(TabBox, { title: "Device" },
|
|
4427
4477
|
React__default["default"].createElement(ButtonInputGroup, { label: "Device Type" },
|
|
4428
|
-
React__default["default"].createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected:
|
|
4429
|
-
|
|
4478
|
+
React__default["default"].createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: pendingAdvancedFilterState.isMobile === undefined, onSelected: () => {
|
|
4479
|
+
pendingAdvancedFilterState.isMobile = undefined;
|
|
4430
4480
|
dispatch({
|
|
4431
4481
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4432
|
-
advancedFilterState,
|
|
4482
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4433
4483
|
});
|
|
4434
|
-
} }),
|
|
4435
|
-
React__default["default"].createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected:
|
|
4436
|
-
|
|
4484
|
+
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4485
|
+
React__default["default"].createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: pendingAdvancedFilterState.isMobile === true, onSelected: () => {
|
|
4486
|
+
pendingAdvancedFilterState.isMobile = true;
|
|
4437
4487
|
dispatch({
|
|
4438
4488
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4439
|
-
advancedFilterState,
|
|
4489
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4440
4490
|
});
|
|
4441
|
-
} }),
|
|
4442
|
-
React__default["default"].createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected:
|
|
4443
|
-
|
|
4491
|
+
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4492
|
+
React__default["default"].createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: pendingAdvancedFilterState.isMobile === false, onSelected: () => {
|
|
4493
|
+
pendingAdvancedFilterState.isMobile = false;
|
|
4444
4494
|
dispatch({
|
|
4445
4495
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4446
|
-
advancedFilterState,
|
|
4496
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4447
4497
|
});
|
|
4448
|
-
}, noMarginOnRight: true }))),
|
|
4498
|
+
}, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }))),
|
|
4449
4499
|
React__default["default"].createElement(TabBox, { title: "Source" },
|
|
4450
4500
|
React__default["default"].createElement(ButtonInputGroup, { label: "Source Type" },
|
|
4451
|
-
React__default["default"].createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected:
|
|
4452
|
-
|
|
4501
|
+
React__default["default"].createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: pendingAdvancedFilterState.source === undefined, onSelected: () => {
|
|
4502
|
+
pendingAdvancedFilterState.source = undefined;
|
|
4453
4503
|
dispatch({
|
|
4454
4504
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4455
|
-
advancedFilterState,
|
|
4505
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4456
4506
|
});
|
|
4457
|
-
} }),
|
|
4458
|
-
React__default["default"].createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected:
|
|
4459
|
-
|
|
4507
|
+
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4508
|
+
React__default["default"].createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: pendingAdvancedFilterState.source === LogSource$1.Client, onSelected: () => {
|
|
4509
|
+
pendingAdvancedFilterState.source = LogSource$1.Client;
|
|
4460
4510
|
dispatch({
|
|
4461
4511
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4462
|
-
advancedFilterState,
|
|
4512
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4463
4513
|
});
|
|
4464
|
-
} }),
|
|
4465
|
-
React__default["default"].createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected:
|
|
4466
|
-
|
|
4514
|
+
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4515
|
+
React__default["default"].createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: pendingAdvancedFilterState.source === LogSource$1.Server, onSelected: () => {
|
|
4516
|
+
pendingAdvancedFilterState.source = LogSource$1.Server;
|
|
4467
4517
|
dispatch({
|
|
4468
4518
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4469
|
-
advancedFilterState,
|
|
4519
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4470
4520
|
});
|
|
4471
|
-
}, noMarginOnRight: true })),
|
|
4472
|
-
|
|
4521
|
+
}, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })),
|
|
4522
|
+
pendingAdvancedFilterState.source !== LogSource$1.Client && (React__default["default"].createElement("div", { className: "mt-2" },
|
|
4473
4523
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4474
4524
|
React__default["default"].createElement("span", { className: "input-group-text" }, "Server Route Path"),
|
|
4475
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for server route path", value:
|
|
4476
|
-
|
|
4525
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for server route path", value: pendingAdvancedFilterState.routePath, placeholder: "e.g. /api/ttm/courses/12345", onChange: (e) => {
|
|
4526
|
+
pendingAdvancedFilterState.courseName = ((e.target.value)
|
|
4477
4527
|
.trim());
|
|
4478
4528
|
dispatch({
|
|
4479
4529
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4480
|
-
advancedFilterState,
|
|
4530
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4481
4531
|
});
|
|
4482
4532
|
} })),
|
|
4483
4533
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
4484
4534
|
React__default["default"].createElement("span", { className: "input-group-text" }, "Server Route Template"),
|
|
4485
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for server route template", value:
|
|
4486
|
-
|
|
4535
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for server route template", value: pendingAdvancedFilterState.routeTemplate, placeholder: "e.g. /api/ttm/courses/:courseId", onChange: (e) => {
|
|
4536
|
+
pendingAdvancedFilterState.courseName = ((e.target.value)
|
|
4487
4537
|
.trim());
|
|
4488
4538
|
dispatch({
|
|
4489
4539
|
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4490
|
-
advancedFilterState,
|
|
4540
|
+
advancedFilterState: pendingAdvancedFilterState,
|
|
4491
4541
|
});
|
|
4492
4542
|
} })))))));
|
|
4493
4543
|
}
|
|
@@ -4501,10 +4551,10 @@ const LogReviewer = (props) => {
|
|
|
4501
4551
|
body = (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4502
4552
|
filters,
|
|
4503
4553
|
React__default["default"].createElement("div", { className: "mt-2" },
|
|
4504
|
-
React__default["default"].createElement(
|
|
4505
|
-
logs.length === 0 && (React__default["default"].createElement("div", { className: "alert alert-warning text-center mt-2" },
|
|
4554
|
+
logs.length === 0 ? (React__default["default"].createElement("div", { className: "alert alert-warning text-center mt-2" },
|
|
4506
4555
|
React__default["default"].createElement("h4", { className: "m-1" }, "No Logs to Show"),
|
|
4507
|
-
React__default["default"].createElement("div", null, "Either your filters are too strict or no matching logs have been created yet.")))
|
|
4556
|
+
React__default["default"].createElement("div", null, "Either your filters are too strict or no matching logs have been created yet.")))
|
|
4557
|
+
: (React__default["default"].createElement(IntelliTable, { title: "Matching Logs", csvName: `Logs from ${getHumanReadableDate()}`, id: "logs", data: logs, columns: columns })),
|
|
4508
4558
|
paginationControls)));
|
|
4509
4559
|
}
|
|
4510
4560
|
/* ---------- Wrap in Modal --------- */
|
|
@@ -4513,7 +4563,7 @@ const LogReviewer = (props) => {
|
|
|
4513
4563
|
React__default["default"].createElement("div", { className: "LogReviewer-inner-container" },
|
|
4514
4564
|
React__default["default"].createElement("div", { className: "LogReviewer-header" },
|
|
4515
4565
|
React__default["default"].createElement("div", { className: "LogReviewer-header-title" },
|
|
4516
|
-
React__default["default"].createElement("h3", { className: "text-center
|
|
4566
|
+
React__default["default"].createElement("h3", { className: "text-center" }, "Log Review Dashboard")),
|
|
4517
4567
|
React__default["default"].createElement("div", { style: { width: 0 } },
|
|
4518
4568
|
React__default["default"].createElement("button", { type: "button", className: "LogReviewer-header-close-button btn btn-dark btn-lg pe-0", "aria-label": "close log reviewer panel", onClick: onClose },
|
|
4519
4569
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faTimes })))),
|