dce-reactkit 3.4.0-beta.3 → 3.4.0-beta.4
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 +338 -981
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +329 -972
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/addDBEditorEndpoints.ts +5 -2
package/dist/cjs/index.js
CHANGED
|
@@ -45,7 +45,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
45
45
|
PERFORMANCE OF THIS SOFTWARE.
|
|
46
46
|
***************************************************************************** */
|
|
47
47
|
|
|
48
|
-
function __awaiter
|
|
48
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
49
49
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
50
50
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
51
51
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -60,7 +60,7 @@ function __awaiter$1(thisArg, _arguments, P, generator) {
|
|
|
60
60
|
* List of error codes built into the react kit
|
|
61
61
|
* @author Gabe Abrams
|
|
62
62
|
*/
|
|
63
|
-
var ReactKitErrorCode
|
|
63
|
+
var ReactKitErrorCode;
|
|
64
64
|
(function (ReactKitErrorCode) {
|
|
65
65
|
ReactKitErrorCode["NoResponse"] = "DRK1";
|
|
66
66
|
ReactKitErrorCode["NoCode"] = "DRK2";
|
|
@@ -75,8 +75,8 @@ var ReactKitErrorCode$2;
|
|
|
75
75
|
ReactKitErrorCode["NotAllowedToReviewLogs"] = "DRK11";
|
|
76
76
|
ReactKitErrorCode["ThemeCheckedBeforeReactKitReady"] = "DRK12";
|
|
77
77
|
ReactKitErrorCode["SessionExpiredMessageGottenBeforeReactKitReady"] = "DRK13";
|
|
78
|
-
})(ReactKitErrorCode
|
|
79
|
-
var ReactKitErrorCode$
|
|
78
|
+
})(ReactKitErrorCode || (ReactKitErrorCode = {}));
|
|
79
|
+
var ReactKitErrorCode$1 = ReactKitErrorCode;
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Displays an error
|
|
@@ -116,7 +116,7 @@ const ErrorBox = (props) => {
|
|
|
116
116
|
} },
|
|
117
117
|
"code:",
|
|
118
118
|
' ',
|
|
119
|
-
String((_a = error.code) !== null && _a !== void 0 ? _a : ReactKitErrorCode$
|
|
119
|
+
String((_a = error.code) !== null && _a !== void 0 ? _a : ReactKitErrorCode$1.NoCode).toUpperCase())));
|
|
120
120
|
}
|
|
121
121
|
// Main UI
|
|
122
122
|
return (React__default["default"].createElement("div", { className: "alert alert-danger text-center", style: {
|
|
@@ -137,7 +137,7 @@ const ErrorBox = (props) => {
|
|
|
137
137
|
* Types of buttons in the modal
|
|
138
138
|
* @author Gabe Abrams
|
|
139
139
|
*/
|
|
140
|
-
var ModalButtonType
|
|
140
|
+
var ModalButtonType;
|
|
141
141
|
(function (ModalButtonType) {
|
|
142
142
|
ModalButtonType["Okay"] = "okay";
|
|
143
143
|
ModalButtonType["Cancel"] = "cancel";
|
|
@@ -149,14 +149,14 @@ var ModalButtonType$2;
|
|
|
149
149
|
ModalButtonType["ImSure"] = "imSure";
|
|
150
150
|
ModalButtonType["Delete"] = "delete";
|
|
151
151
|
ModalButtonType["Confirm"] = "confirm";
|
|
152
|
-
})(ModalButtonType
|
|
153
|
-
var ModalButtonType$
|
|
152
|
+
})(ModalButtonType || (ModalButtonType = {}));
|
|
153
|
+
var ModalButtonType$1 = ModalButtonType;
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* Types of modals
|
|
157
157
|
* @author Gabe Abrams
|
|
158
158
|
*/
|
|
159
|
-
var ModalType
|
|
159
|
+
var ModalType;
|
|
160
160
|
(function (ModalType) {
|
|
161
161
|
ModalType["Okay"] = "okay";
|
|
162
162
|
ModalType["OkayCancel"] = "okay-cancel";
|
|
@@ -167,8 +167,8 @@ var ModalType$2;
|
|
|
167
167
|
ModalType["DeleteCancel"] = "delete-cancel";
|
|
168
168
|
ModalType["ConfirmCancel"] = "confirm-cancel";
|
|
169
169
|
ModalType["NoButtons"] = "-";
|
|
170
|
-
})(ModalType
|
|
171
|
-
var ModalType$
|
|
170
|
+
})(ModalType || (ModalType = {}));
|
|
171
|
+
var ModalType$1 = ModalType;
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
174
|
* Built-in metadata for logs
|
|
@@ -193,7 +193,7 @@ const LogBuiltInMetadata = {
|
|
|
193
193
|
* @author Gabe Abrams
|
|
194
194
|
* @param ms number of ms to wait
|
|
195
195
|
*/
|
|
196
|
-
const waitMs = (ms = 0) => __awaiter
|
|
196
|
+
const waitMs = (ms = 0) => __awaiter(void 0, void 0, void 0, function* () {
|
|
197
197
|
return new Promise((resolve) => {
|
|
198
198
|
setTimeout(resolve, ms);
|
|
199
199
|
});
|
|
@@ -203,7 +203,7 @@ const waitMs = (ms = 0) => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
|
203
203
|
* Bootstrap variants
|
|
204
204
|
* @author Gabe Abrams
|
|
205
205
|
*/
|
|
206
|
-
var Variant
|
|
206
|
+
var Variant;
|
|
207
207
|
(function (Variant) {
|
|
208
208
|
Variant["Primary"] = "primary";
|
|
209
209
|
Variant["Secondary"] = "secondary";
|
|
@@ -213,21 +213,21 @@ var Variant$2;
|
|
|
213
213
|
Variant["Danger"] = "danger";
|
|
214
214
|
Variant["Light"] = "light";
|
|
215
215
|
Variant["Dark"] = "dark";
|
|
216
|
-
})(Variant
|
|
217
|
-
var Variant$
|
|
216
|
+
})(Variant || (Variant = {}));
|
|
217
|
+
var Variant$1 = Variant;
|
|
218
218
|
|
|
219
219
|
/**
|
|
220
220
|
* Modal sizes
|
|
221
221
|
* @author Gabe Abrams
|
|
222
222
|
*/
|
|
223
|
-
var ModalSize
|
|
223
|
+
var ModalSize;
|
|
224
224
|
(function (ModalSize) {
|
|
225
225
|
ModalSize["Small"] = "sm";
|
|
226
226
|
ModalSize["Medium"] = "md";
|
|
227
227
|
ModalSize["Large"] = "lg";
|
|
228
228
|
ModalSize["ExtraLarge"] = "xl";
|
|
229
|
-
})(ModalSize
|
|
230
|
-
var ModalSize$
|
|
229
|
+
})(ModalSize || (ModalSize = {}));
|
|
230
|
+
var ModalSize$1 = ModalSize;
|
|
231
231
|
|
|
232
232
|
/**
|
|
233
233
|
* A generic popup modal
|
|
@@ -240,80 +240,80 @@ var ModalSize$2 = ModalSize$1;
|
|
|
240
240
|
const MS_TO_ANIMATE = 200; // Animation duration
|
|
241
241
|
// Modal type to list of buttons
|
|
242
242
|
const modalTypeToModalButtonTypes = {
|
|
243
|
-
[ModalType$
|
|
244
|
-
ModalButtonType$
|
|
243
|
+
[ModalType$1.Okay]: [
|
|
244
|
+
ModalButtonType$1.Okay,
|
|
245
245
|
],
|
|
246
|
-
[ModalType$
|
|
247
|
-
ModalButtonType$
|
|
248
|
-
ModalButtonType$
|
|
246
|
+
[ModalType$1.OkayCancel]: [
|
|
247
|
+
ModalButtonType$1.Okay,
|
|
248
|
+
ModalButtonType$1.Cancel,
|
|
249
249
|
],
|
|
250
|
-
[ModalType$
|
|
251
|
-
ModalButtonType$
|
|
252
|
-
ModalButtonType$
|
|
250
|
+
[ModalType$1.YesNo]: [
|
|
251
|
+
ModalButtonType$1.Yes,
|
|
252
|
+
ModalButtonType$1.No,
|
|
253
253
|
],
|
|
254
|
-
[ModalType$
|
|
255
|
-
ModalButtonType$
|
|
256
|
-
ModalButtonType$
|
|
257
|
-
ModalButtonType$
|
|
254
|
+
[ModalType$1.YesNoCancel]: [
|
|
255
|
+
ModalButtonType$1.Yes,
|
|
256
|
+
ModalButtonType$1.No,
|
|
257
|
+
ModalButtonType$1.Cancel,
|
|
258
258
|
],
|
|
259
|
-
[ModalType$
|
|
260
|
-
ModalButtonType$
|
|
261
|
-
ModalButtonType$
|
|
259
|
+
[ModalType$1.AbandonGoBack]: [
|
|
260
|
+
ModalButtonType$1.Abandon,
|
|
261
|
+
ModalButtonType$1.GoBack,
|
|
262
262
|
],
|
|
263
|
-
[ModalType$
|
|
264
|
-
ModalButtonType$
|
|
265
|
-
ModalButtonType$
|
|
263
|
+
[ModalType$1.ImSureCancel]: [
|
|
264
|
+
ModalButtonType$1.ImSure,
|
|
265
|
+
ModalButtonType$1.Cancel,
|
|
266
266
|
],
|
|
267
|
-
[ModalType$
|
|
268
|
-
ModalButtonType$
|
|
269
|
-
ModalButtonType$
|
|
267
|
+
[ModalType$1.DeleteCancel]: [
|
|
268
|
+
ModalButtonType$1.Delete,
|
|
269
|
+
ModalButtonType$1.Cancel,
|
|
270
270
|
],
|
|
271
|
-
[ModalType$
|
|
272
|
-
ModalButtonType$
|
|
273
|
-
ModalButtonType$
|
|
271
|
+
[ModalType$1.ConfirmCancel]: [
|
|
272
|
+
ModalButtonType$1.Confirm,
|
|
273
|
+
ModalButtonType$1.Cancel,
|
|
274
274
|
],
|
|
275
275
|
};
|
|
276
276
|
// Button type styling and labels
|
|
277
277
|
const ModalButtonTypeToLabelAndVariant = {
|
|
278
|
-
[ModalButtonType$
|
|
278
|
+
[ModalButtonType$1.Okay]: {
|
|
279
279
|
label: 'Okay',
|
|
280
|
-
variant: Variant$
|
|
280
|
+
variant: Variant$1.Dark,
|
|
281
281
|
},
|
|
282
|
-
[ModalButtonType$
|
|
282
|
+
[ModalButtonType$1.Cancel]: {
|
|
283
283
|
label: 'Cancel',
|
|
284
|
-
variant: Variant$
|
|
284
|
+
variant: Variant$1.Secondary,
|
|
285
285
|
},
|
|
286
|
-
[ModalButtonType$
|
|
286
|
+
[ModalButtonType$1.Yes]: {
|
|
287
287
|
label: 'Yes',
|
|
288
|
-
variant: Variant$
|
|
288
|
+
variant: Variant$1.Dark,
|
|
289
289
|
},
|
|
290
|
-
[ModalButtonType$
|
|
290
|
+
[ModalButtonType$1.No]: {
|
|
291
291
|
label: 'No',
|
|
292
|
-
variant: Variant$
|
|
292
|
+
variant: Variant$1.Secondary,
|
|
293
293
|
},
|
|
294
|
-
[ModalButtonType$
|
|
294
|
+
[ModalButtonType$1.Abandon]: {
|
|
295
295
|
label: 'Abandon Changes',
|
|
296
|
-
variant: Variant$
|
|
296
|
+
variant: Variant$1.Warning,
|
|
297
297
|
},
|
|
298
|
-
[ModalButtonType$
|
|
298
|
+
[ModalButtonType$1.GoBack]: {
|
|
299
299
|
label: 'Go Back',
|
|
300
|
-
variant: Variant$
|
|
300
|
+
variant: Variant$1.Secondary,
|
|
301
301
|
},
|
|
302
|
-
[ModalButtonType$
|
|
302
|
+
[ModalButtonType$1.Continue]: {
|
|
303
303
|
label: 'Continue',
|
|
304
|
-
variant: Variant$
|
|
304
|
+
variant: Variant$1.Dark,
|
|
305
305
|
},
|
|
306
|
-
[ModalButtonType$
|
|
306
|
+
[ModalButtonType$1.ImSure]: {
|
|
307
307
|
label: 'I am sure',
|
|
308
|
-
variant: Variant$
|
|
308
|
+
variant: Variant$1.Warning,
|
|
309
309
|
},
|
|
310
|
-
[ModalButtonType$
|
|
310
|
+
[ModalButtonType$1.Delete]: {
|
|
311
311
|
label: 'Yes, Delete',
|
|
312
|
-
variant: Variant$
|
|
312
|
+
variant: Variant$1.Danger,
|
|
313
313
|
},
|
|
314
|
-
[ModalButtonType$
|
|
314
|
+
[ModalButtonType$1.Confirm]: {
|
|
315
315
|
label: 'Confirm',
|
|
316
|
-
variant: Variant$
|
|
316
|
+
variant: Variant$1.Dark,
|
|
317
317
|
},
|
|
318
318
|
};
|
|
319
319
|
/*------------------------------------------------------------------------*/
|
|
@@ -391,7 +391,7 @@ const Modal = (props) => {
|
|
|
391
391
|
/*------------------------------------------------------------------------*/
|
|
392
392
|
var _a;
|
|
393
393
|
/* -------------- Props ------------- */
|
|
394
|
-
const { type = ModalType$
|
|
394
|
+
const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, children, onClose, dontAllowBackdropExit, onTopOfOtherModals, } = props;
|
|
395
395
|
/* -------------- State ------------- */
|
|
396
396
|
// If true, the modal is shown
|
|
397
397
|
const [visible, setVisible] = React.useState(false);
|
|
@@ -408,7 +408,7 @@ const Modal = (props) => {
|
|
|
408
408
|
* @author Gabe Abrams
|
|
409
409
|
*/
|
|
410
410
|
React.useEffect(() => {
|
|
411
|
-
(() => __awaiter
|
|
411
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
412
412
|
// Set defaults
|
|
413
413
|
setVisible(false);
|
|
414
414
|
setAnimatingIn(true);
|
|
@@ -434,7 +434,7 @@ const Modal = (props) => {
|
|
|
434
434
|
* @param ModalButtonType the button that was clicked when closing the
|
|
435
435
|
* modal
|
|
436
436
|
*/
|
|
437
|
-
const handleClose = (ModalButtonType) => __awaiter
|
|
437
|
+
const handleClose = (ModalButtonType) => __awaiter(void 0, void 0, void 0, function* () {
|
|
438
438
|
// Don't close if no handler
|
|
439
439
|
if (!onClose) {
|
|
440
440
|
return;
|
|
@@ -496,7 +496,7 @@ const Modal = (props) => {
|
|
|
496
496
|
React__default["default"].createElement("style", null, style$8),
|
|
497
497
|
React__default["default"].createElement("div", { className: `Modal-backdrop ${backdropAnimationClass}`, style: {
|
|
498
498
|
zIndex: 5000000003,
|
|
499
|
-
}, onClick: () => __awaiter
|
|
499
|
+
}, onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
500
500
|
// Skip if exit via backdrop not allowed
|
|
501
501
|
if (dontAllowBackdropExit || !onClose) {
|
|
502
502
|
// Show pop animation
|
|
@@ -509,7 +509,7 @@ const Modal = (props) => {
|
|
|
509
509
|
return;
|
|
510
510
|
}
|
|
511
511
|
// Handle close
|
|
512
|
-
handleClose(ModalButtonType$
|
|
512
|
+
handleClose(ModalButtonType$1.Cancel);
|
|
513
513
|
}) }),
|
|
514
514
|
React__default["default"].createElement("div", { className: `modal-dialog modal-${size} ${animationClass}`, style: {
|
|
515
515
|
zIndex: 5000000002,
|
|
@@ -521,7 +521,7 @@ const Modal = (props) => {
|
|
|
521
521
|
} }, title),
|
|
522
522
|
onClose && (React__default["default"].createElement("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: () => {
|
|
523
523
|
// Handle close
|
|
524
|
-
handleClose(ModalButtonType$
|
|
524
|
+
handleClose(ModalButtonType$1.Cancel);
|
|
525
525
|
} }))),
|
|
526
526
|
children && (React__default["default"].createElement("div", { className: "modal-body" }, children)),
|
|
527
527
|
footer && (React__default["default"].createElement("div", { className: "modal-footer pt-1 pb-1" }, footer))))));
|
|
@@ -531,7 +531,7 @@ const Modal = (props) => {
|
|
|
531
531
|
* An error with a code
|
|
532
532
|
* @author Gabe Abrams
|
|
533
533
|
*/
|
|
534
|
-
class ErrorWithCode
|
|
534
|
+
class ErrorWithCode extends Error {
|
|
535
535
|
constructor(message, code) {
|
|
536
536
|
super(message);
|
|
537
537
|
this.name = 'ErrorWithCode';
|
|
@@ -578,10 +578,10 @@ let storedSendRequest;
|
|
|
578
578
|
* @author Gabe Abrams
|
|
579
579
|
* @returns sendRequest function
|
|
580
580
|
*/
|
|
581
|
-
const getSendRequest = () => __awaiter
|
|
581
|
+
const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
582
582
|
// Track timeout
|
|
583
583
|
let timedOut = false;
|
|
584
|
-
(() => __awaiter
|
|
584
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
585
585
|
yield waitMs(5000);
|
|
586
586
|
timedOut = true;
|
|
587
587
|
}))(),
|
|
@@ -589,7 +589,7 @@ const getSendRequest = () => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
|
589
589
|
yield initialized;
|
|
590
590
|
// Error if no send request function
|
|
591
591
|
if (timedOut) {
|
|
592
|
-
showFatalError(new ErrorWithCode
|
|
592
|
+
showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction));
|
|
593
593
|
// Return dummy function that never resolves
|
|
594
594
|
return (() => {
|
|
595
595
|
return new Promise(() => { });
|
|
@@ -649,7 +649,7 @@ const _setStubResponse = (opts) => {
|
|
|
649
649
|
const { path, body, } = opts;
|
|
650
650
|
const method = ((_a = opts.method) !== null && _a !== void 0 ? _a : 'GET').toUpperCase();
|
|
651
651
|
const errorMessage = ((_b = opts.errorMessage) !== null && _b !== void 0 ? _b : 'An unknown error has occurred.');
|
|
652
|
-
const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : ReactKitErrorCode$
|
|
652
|
+
const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : ReactKitErrorCode$1.NoCode);
|
|
653
653
|
// Store to stub responses
|
|
654
654
|
if (!stubResponses[method]) {
|
|
655
655
|
stubResponses[method] = {};
|
|
@@ -677,7 +677,7 @@ const _setStubResponse = (opts) => {
|
|
|
677
677
|
* @param [opts.params] - query/body parameters to include
|
|
678
678
|
* @returns response from server
|
|
679
679
|
*/
|
|
680
|
-
const visitServerEndpoint = (opts) => __awaiter
|
|
680
|
+
const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
681
681
|
var _a, _b, _c;
|
|
682
682
|
const method = ((_a = opts.method) !== null && _a !== void 0 ? _a : 'GET');
|
|
683
683
|
// Handle stubs
|
|
@@ -695,7 +695,7 @@ const visitServerEndpoint = (opts) => __awaiter$1(void 0, void 0, void 0, functi
|
|
|
695
695
|
return stubResponse.body;
|
|
696
696
|
}
|
|
697
697
|
// Error
|
|
698
|
-
throw new ErrorWithCode
|
|
698
|
+
throw new ErrorWithCode(stubResponse.errorMessage, stubResponse.errorCode);
|
|
699
699
|
}
|
|
700
700
|
// Send the request
|
|
701
701
|
const sendRequest = yield getSendRequest();
|
|
@@ -706,11 +706,11 @@ const visitServerEndpoint = (opts) => __awaiter$1(void 0, void 0, void 0, functi
|
|
|
706
706
|
});
|
|
707
707
|
// Check for failure
|
|
708
708
|
if (!response || !response.body) {
|
|
709
|
-
throw new ErrorWithCode
|
|
709
|
+
throw new ErrorWithCode('We didn\'t get a response from the server. Please check your internet connection.', ReactKitErrorCode$1.NoResponse);
|
|
710
710
|
}
|
|
711
711
|
if (!response.body.success) {
|
|
712
712
|
// Session expired
|
|
713
|
-
if (response.body.code === ReactKitErrorCode$
|
|
713
|
+
if (response.body.code === ReactKitErrorCode$1.SessionExpired) {
|
|
714
714
|
// Skip notice if session was already expired
|
|
715
715
|
if (sessionAlreadyExpired) {
|
|
716
716
|
// Never return (browser is already reloading)
|
|
@@ -731,9 +731,9 @@ const visitServerEndpoint = (opts) => __awaiter$1(void 0, void 0, void 0, functi
|
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
// Other errors
|
|
734
|
-
throw new ErrorWithCode
|
|
734
|
+
throw new ErrorWithCode((response.body.message
|
|
735
735
|
|| 'An unknown error occurred. Please contact an admin.'), (response.body.code
|
|
736
|
-
|| ReactKitErrorCode$
|
|
736
|
+
|| ReactKitErrorCode$1.NoCode));
|
|
737
737
|
}
|
|
738
738
|
// Success! Extract the body
|
|
739
739
|
const { body } = response.body;
|
|
@@ -745,7 +745,7 @@ const visitServerEndpoint = (opts) => __awaiter$1(void 0, void 0, void 0, functi
|
|
|
745
745
|
* Log a user action on the client (cannot be used on the server)
|
|
746
746
|
* @author Gabe Abrams
|
|
747
747
|
*/
|
|
748
|
-
const logClientEvent = (opts) => __awaiter
|
|
748
|
+
const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
749
749
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
750
750
|
return visitServerEndpoint({
|
|
751
751
|
path: LOG_ROUTE_PATH,
|
|
@@ -797,7 +797,7 @@ let onAlertClosed;
|
|
|
797
797
|
* @param title the title text to display at the top of the alert
|
|
798
798
|
* @param text the text to display in the alert
|
|
799
799
|
*/
|
|
800
|
-
const alert$1 = (title, text) => __awaiter
|
|
800
|
+
const alert$1 = (title, text) => __awaiter(void 0, void 0, void 0, function* () {
|
|
801
801
|
// Fallback if alert not available
|
|
802
802
|
if (!setAlertInfo) {
|
|
803
803
|
window.alert(`${title}\n\n${text}`);
|
|
@@ -837,7 +837,7 @@ let onConfirmClosed;
|
|
|
837
837
|
* button
|
|
838
838
|
* @returns true if the user confirmed
|
|
839
839
|
*/
|
|
840
|
-
const confirm = (title, text, opts) => __awaiter
|
|
840
|
+
const confirm = (title, text, opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
841
841
|
// Fallback if confirm is not available
|
|
842
842
|
if (!setConfirmInfo) {
|
|
843
843
|
return window.confirm(`${title}\n\n${text}`);
|
|
@@ -876,8 +876,8 @@ const showFatalError = (error, errorTitle = 'An Error Occurred') => {
|
|
|
876
876
|
? error.trim()
|
|
877
877
|
: String((_a = error.message) !== null && _a !== void 0 ? _a : 'An unknown error occurred.'));
|
|
878
878
|
const code = (typeof error === 'string'
|
|
879
|
-
? ReactKitErrorCode$
|
|
880
|
-
: String((_b = error.code) !== null && _b !== void 0 ? _b : ReactKitErrorCode$
|
|
879
|
+
? ReactKitErrorCode$1.NoCode
|
|
880
|
+
: String((_b = error.code) !== null && _b !== void 0 ? _b : ReactKitErrorCode$1.NoCode));
|
|
881
881
|
// Add log
|
|
882
882
|
logClientEvent({
|
|
883
883
|
context: LogBuiltInMetadata.Context.ClientFatalError,
|
|
@@ -936,7 +936,7 @@ const AppWrapper = (props) => {
|
|
|
936
936
|
let modal;
|
|
937
937
|
/* -------------- Alert ------------- */
|
|
938
938
|
if (alertInfo) {
|
|
939
|
-
modal = (React__default["default"].createElement(Modal, { key: `alert-${alertInfo.title}-${alertInfo.text}`, title: alertInfo.title, type: ModalType$
|
|
939
|
+
modal = (React__default["default"].createElement(Modal, { key: `alert-${alertInfo.title}-${alertInfo.text}`, title: alertInfo.title, type: ModalType$1.Okay, onClose: () => {
|
|
940
940
|
// Alert closed
|
|
941
941
|
setAlertInfo(undefined);
|
|
942
942
|
if (onAlertClosed) {
|
|
@@ -946,10 +946,10 @@ const AppWrapper = (props) => {
|
|
|
946
946
|
}
|
|
947
947
|
/* ------------- Confirm ------------ */
|
|
948
948
|
if (confirmInfo) {
|
|
949
|
-
modal = (React__default["default"].createElement(Modal, { key: `confirm-${confirmInfo.title}-${confirmInfo.text}`, title: confirmInfo.title, type: ModalType$
|
|
949
|
+
modal = (React__default["default"].createElement(Modal, { key: `confirm-${confirmInfo.title}-${confirmInfo.text}`, title: confirmInfo.title, type: ModalType$1.OkayCancel, okayLabel: confirmInfo.opts.confirmButtonText, okayVariant: confirmInfo.opts.confirmButtonVariant, cancelLabel: confirmInfo.opts.cancelButtonText, cancelVariant: confirmInfo.opts.cancelButtonVariant, onClose: (buttonType) => {
|
|
950
950
|
setConfirmInfo(undefined);
|
|
951
951
|
if (onConfirmClosed) {
|
|
952
|
-
onConfirmClosed(buttonType === ModalButtonType$
|
|
952
|
+
onConfirmClosed(buttonType === ModalButtonType$1.Okay);
|
|
953
953
|
}
|
|
954
954
|
}, dontAllowBackdropExit: true }, confirmInfo.text));
|
|
955
955
|
}
|
|
@@ -962,8 +962,8 @@ const AppWrapper = (props) => {
|
|
|
962
962
|
if (fatalErrorMessage || fatalErrorCode || sessionHasExpired) {
|
|
963
963
|
// Re-encapsulate in an error
|
|
964
964
|
const error = (sessionHasExpired
|
|
965
|
-
? new ErrorWithCode
|
|
966
|
-
: new ErrorWithCode
|
|
965
|
+
? new ErrorWithCode(getSessionExpiredMessage(), ReactKitErrorCode$1.SessionExpired)
|
|
966
|
+
: new ErrorWithCode((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode : ReactKitErrorCode$1.NoCode)));
|
|
967
967
|
// Build error screen
|
|
968
968
|
body = (React__default["default"].createElement("div", { style: {
|
|
969
969
|
display: 'block',
|
|
@@ -1188,7 +1188,7 @@ const RadioButton = (props) => {
|
|
|
1188
1188
|
/* Setup */
|
|
1189
1189
|
/*------------------------------------------------------------------------*/
|
|
1190
1190
|
/* -------------- Props ------------- */
|
|
1191
|
-
const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = Variant$
|
|
1191
|
+
const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = Variant$1.Secondary, unselectedVariant = Variant$1.Light, small, } = props;
|
|
1192
1192
|
/*------------------------------------------------------------------------*/
|
|
1193
1193
|
/* Render */
|
|
1194
1194
|
/*------------------------------------------------------------------------*/
|
|
@@ -1216,7 +1216,7 @@ const CheckboxButton = (props) => {
|
|
|
1216
1216
|
/* Setup */
|
|
1217
1217
|
/*------------------------------------------------------------------------*/
|
|
1218
1218
|
/* -------------- Props ------------- */
|
|
1219
|
-
const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = Variant$
|
|
1219
|
+
const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = Variant$1.Secondary, uncheckedVariant = Variant$1.Light, small, dashed, } = props;
|
|
1220
1220
|
/*------------------------------------------------------------------------*/
|
|
1221
1221
|
/* Render */
|
|
1222
1222
|
/*------------------------------------------------------------------------*/
|
|
@@ -1862,13 +1862,13 @@ const PopPendingMark = (props) => {
|
|
|
1862
1862
|
*/
|
|
1863
1863
|
/* ------------- Actions ------------ */
|
|
1864
1864
|
// Types of actions
|
|
1865
|
-
var ActionType$
|
|
1865
|
+
var ActionType$6;
|
|
1866
1866
|
(function (ActionType) {
|
|
1867
1867
|
// Indicate that the text was recently copied
|
|
1868
1868
|
ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
|
|
1869
1869
|
// Clear the status
|
|
1870
1870
|
ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
|
|
1871
|
-
})(ActionType$
|
|
1871
|
+
})(ActionType$6 || (ActionType$6 = {}));
|
|
1872
1872
|
/**
|
|
1873
1873
|
* Reducer that executes actions
|
|
1874
1874
|
* @author Gabe Abrams
|
|
@@ -1877,12 +1877,12 @@ var ActionType$8;
|
|
|
1877
1877
|
*/
|
|
1878
1878
|
const reducer$6 = (state, action) => {
|
|
1879
1879
|
switch (action.type) {
|
|
1880
|
-
case ActionType$
|
|
1880
|
+
case ActionType$6.IndicateRecentlyCopied: {
|
|
1881
1881
|
return {
|
|
1882
1882
|
recentlyCopied: true,
|
|
1883
1883
|
};
|
|
1884
1884
|
}
|
|
1885
|
-
case ActionType$
|
|
1885
|
+
case ActionType$6.ClearRecentlyCopiedStatus: {
|
|
1886
1886
|
return {
|
|
1887
1887
|
recentlyCopied: false,
|
|
1888
1888
|
};
|
|
@@ -1918,7 +1918,7 @@ const CopiableBox = (props) => {
|
|
|
1918
1918
|
* Perform a copy
|
|
1919
1919
|
* @author Gabe Abrams
|
|
1920
1920
|
*/
|
|
1921
|
-
const performCopy = () => __awaiter
|
|
1921
|
+
const performCopy = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1922
1922
|
// Write to clipboard
|
|
1923
1923
|
try {
|
|
1924
1924
|
yield navigator.clipboard.writeText(text);
|
|
@@ -1928,13 +1928,13 @@ const CopiableBox = (props) => {
|
|
|
1928
1928
|
}
|
|
1929
1929
|
// Show copied notice
|
|
1930
1930
|
dispatch({
|
|
1931
|
-
type: ActionType$
|
|
1931
|
+
type: ActionType$6.IndicateRecentlyCopied,
|
|
1932
1932
|
});
|
|
1933
1933
|
// Wait a moment
|
|
1934
1934
|
yield waitMs(4000);
|
|
1935
1935
|
// Hide copied notice
|
|
1936
1936
|
dispatch({
|
|
1937
|
-
type: ActionType$
|
|
1937
|
+
type: ActionType$6.ClearRecentlyCopiedStatus,
|
|
1938
1938
|
});
|
|
1939
1939
|
});
|
|
1940
1940
|
/*------------------------------------------------------------------------*/
|
|
@@ -1990,11 +1990,11 @@ const CopiableBox = (props) => {
|
|
|
1990
1990
|
*/
|
|
1991
1991
|
/* ------------- Actions ------------ */
|
|
1992
1992
|
// Types of actions
|
|
1993
|
-
var ActionType$
|
|
1993
|
+
var ActionType$5;
|
|
1994
1994
|
(function (ActionType) {
|
|
1995
1995
|
// Toggle whether a child are being shown
|
|
1996
1996
|
ActionType["ToggleChild"] = "toggle-child";
|
|
1997
|
-
})(ActionType$
|
|
1997
|
+
})(ActionType$5 || (ActionType$5 = {}));
|
|
1998
1998
|
/**
|
|
1999
1999
|
* Reducer that executes actions
|
|
2000
2000
|
* @author Gabe Abrams
|
|
@@ -2003,7 +2003,7 @@ var ActionType$7;
|
|
|
2003
2003
|
*/
|
|
2004
2004
|
const reducer$5 = (state, action) => {
|
|
2005
2005
|
switch (action.type) {
|
|
2006
|
-
case ActionType$
|
|
2006
|
+
case ActionType$5.ToggleChild: {
|
|
2007
2007
|
return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
|
|
2008
2008
|
}
|
|
2009
2009
|
default: {
|
|
@@ -2122,14 +2122,14 @@ const NestableItemList = (props) => {
|
|
|
2122
2122
|
backgroundColor: 'transparent',
|
|
2123
2123
|
}, type: "button", onClick: () => {
|
|
2124
2124
|
dispatch({
|
|
2125
|
-
type: ActionType$
|
|
2125
|
+
type: ActionType$5.ToggleChild,
|
|
2126
2126
|
id: item.id,
|
|
2127
2127
|
});
|
|
2128
2128
|
}, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
|
|
2129
2129
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: childExpanded[item.id] ? freeSolidSvgIcons.faChevronDown : freeSolidSvgIcons.faChevronRight })))),
|
|
2130
2130
|
React__default["default"].createElement(CheckboxButton, { className: `NestableItemList-CheckboxButton-${item.id}`, text: item.name, checked: item.isGroup ? allChecked(item.children) : item.checked, dashed: item.isGroup ? !noneChecked(item.children) : false, onChanged: (checked) => {
|
|
2131
2131
|
onChanged(changeChecked(item.id, checked, items));
|
|
2132
|
-
}, ariaLabel: `Select ${item.name}`, checkedVariant: Variant$
|
|
2132
|
+
}, ariaLabel: `Select ${item.name}`, checkedVariant: Variant$1.Light }),
|
|
2133
2133
|
(item.isGroup && childExpanded[item.id]) && (React__default["default"].createElement("div", { className: "NestableItemList-children-container", style: {
|
|
2134
2134
|
paddingLeft: '2.2rem',
|
|
2135
2135
|
} },
|
|
@@ -2267,7 +2267,7 @@ var LogAction$1 = LogAction;
|
|
|
2267
2267
|
* Server-side API param types
|
|
2268
2268
|
* @author Gabe Abrams
|
|
2269
2269
|
*/
|
|
2270
|
-
var ParamType
|
|
2270
|
+
var ParamType;
|
|
2271
2271
|
(function (ParamType) {
|
|
2272
2272
|
ParamType["Boolean"] = "boolean";
|
|
2273
2273
|
ParamType["BooleanOptional"] = "boolean-optional";
|
|
@@ -2279,8 +2279,8 @@ var ParamType$2;
|
|
|
2279
2279
|
ParamType["JSONOptional"] = "json-optional";
|
|
2280
2280
|
ParamType["String"] = "string";
|
|
2281
2281
|
ParamType["StringOptional"] = "string-optional";
|
|
2282
|
-
})(ParamType
|
|
2283
|
-
var ParamType$
|
|
2282
|
+
})(ParamType || (ParamType = {}));
|
|
2283
|
+
var ParamType$1 = ParamType;
|
|
2284
2284
|
|
|
2285
2285
|
/**
|
|
2286
2286
|
* Round a number to a certain number of decimals
|
|
@@ -2397,7 +2397,7 @@ var SortType;
|
|
|
2397
2397
|
})(SortType || (SortType = {}));
|
|
2398
2398
|
/* ------------- Actions ------------ */
|
|
2399
2399
|
// Types of actions
|
|
2400
|
-
var ActionType$
|
|
2400
|
+
var ActionType$4;
|
|
2401
2401
|
(function (ActionType) {
|
|
2402
2402
|
// Toggle sort column param
|
|
2403
2403
|
ActionType["ToggleSortColumn"] = "toggle-sort-column";
|
|
@@ -2409,7 +2409,7 @@ var ActionType$6;
|
|
|
2409
2409
|
ActionType["ShowAllColumns"] = "show-all-columns";
|
|
2410
2410
|
// Hide all columns
|
|
2411
2411
|
ActionType["HideAllColumns"] = "hide-all-columns";
|
|
2412
|
-
})(ActionType$
|
|
2412
|
+
})(ActionType$4 || (ActionType$4 = {}));
|
|
2413
2413
|
/**
|
|
2414
2414
|
* Reducer that executes actions
|
|
2415
2415
|
* @author Gabe Abrams
|
|
@@ -2418,7 +2418,7 @@ var ActionType$6;
|
|
|
2418
2418
|
*/
|
|
2419
2419
|
const reducer$4 = (state, action) => {
|
|
2420
2420
|
switch (action.type) {
|
|
2421
|
-
case ActionType$
|
|
2421
|
+
case ActionType$4.ToggleSortColumn: {
|
|
2422
2422
|
if (action.param !== state.sortColumnParam) {
|
|
2423
2423
|
// Different column param
|
|
2424
2424
|
return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
|
|
@@ -2430,22 +2430,22 @@ const reducer$4 = (state, action) => {
|
|
|
2430
2430
|
// Stop sorting by column
|
|
2431
2431
|
return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
|
|
2432
2432
|
}
|
|
2433
|
-
case ActionType$
|
|
2433
|
+
case ActionType$4.UpdateColumnVisibility: {
|
|
2434
2434
|
const { columnVisibilityMap } = state;
|
|
2435
2435
|
columnVisibilityMap[action.param] = action.visible;
|
|
2436
2436
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2437
2437
|
}
|
|
2438
|
-
case ActionType$
|
|
2438
|
+
case ActionType$4.ToggleColVisCusModalVisibility: {
|
|
2439
2439
|
return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
|
|
2440
2440
|
}
|
|
2441
|
-
case ActionType$
|
|
2441
|
+
case ActionType$4.ShowAllColumns: {
|
|
2442
2442
|
const { columnVisibilityMap } = state;
|
|
2443
2443
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2444
2444
|
columnVisibilityMap[param] = true;
|
|
2445
2445
|
});
|
|
2446
2446
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2447
2447
|
}
|
|
2448
|
-
case ActionType$
|
|
2448
|
+
case ActionType$4.HideAllColumns: {
|
|
2449
2449
|
const { columnVisibilityMap } = state;
|
|
2450
2450
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2451
2451
|
columnVisibilityMap[param] = false;
|
|
@@ -2506,7 +2506,7 @@ const IntelliTable = (props) => {
|
|
|
2506
2506
|
/* ------- Col Vis Customization Modal ------ */
|
|
2507
2507
|
if (columnVisibilityCustomizationModalVisible) {
|
|
2508
2508
|
// Create modal
|
|
2509
|
-
modal = (React__default["default"].createElement(Modal, { type: ModalType$
|
|
2509
|
+
modal = (React__default["default"].createElement(Modal, { type: ModalType$1.Okay, title: "Choose columns to show:", onClose: () => {
|
|
2510
2510
|
const noColumnsSelected = (Object.values(columnVisibilityMap)
|
|
2511
2511
|
.every((isSelected) => {
|
|
2512
2512
|
return !isSelected;
|
|
@@ -2515,27 +2515,27 @@ const IntelliTable = (props) => {
|
|
|
2515
2515
|
return alert$1('Choose at least one column', 'To continue, you have to choose at least one column to show');
|
|
2516
2516
|
}
|
|
2517
2517
|
dispatch({
|
|
2518
|
-
type: ActionType$
|
|
2518
|
+
type: ActionType$4.ToggleColVisCusModalVisibility,
|
|
2519
2519
|
});
|
|
2520
|
-
}, okayVariant: Variant$
|
|
2520
|
+
}, okayVariant: Variant$1.Light },
|
|
2521
2521
|
columns.map((column) => {
|
|
2522
2522
|
return (React__default["default"].createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
|
|
2523
2523
|
dispatch({
|
|
2524
|
-
type: ActionType$
|
|
2524
|
+
type: ActionType$4.UpdateColumnVisibility,
|
|
2525
2525
|
param: column.param,
|
|
2526
2526
|
visible: checked,
|
|
2527
2527
|
});
|
|
2528
|
-
}, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column in the ${title} table`, checkedVariant: Variant$
|
|
2528
|
+
}, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column in the ${title} table`, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Secondary }));
|
|
2529
2529
|
}),
|
|
2530
2530
|
React__default["default"].createElement("div", { className: "mt-3" }, "Or you can:"),
|
|
2531
2531
|
React__default["default"].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: () => {
|
|
2532
2532
|
dispatch({
|
|
2533
|
-
type: ActionType$
|
|
2533
|
+
type: ActionType$4.ShowAllColumns,
|
|
2534
2534
|
});
|
|
2535
2535
|
} }, "Select All"),
|
|
2536
2536
|
React__default["default"].createElement("button", { type: "button", id: `IntelliTable-${id}-select-none-columns`, className: "btn btn-secondary", "aria-label": `hide all columns in the ${title} table`, onClick: () => {
|
|
2537
2537
|
dispatch({
|
|
2538
|
-
type: ActionType$
|
|
2538
|
+
type: ActionType$4.HideAllColumns,
|
|
2539
2539
|
});
|
|
2540
2540
|
} }, "Deselect All")));
|
|
2541
2541
|
}
|
|
@@ -2586,7 +2586,7 @@ const IntelliTable = (props) => {
|
|
|
2586
2586
|
React__default["default"].createElement("div", null,
|
|
2587
2587
|
React__default["default"].createElement("button", { type: "button", id: `IntelliTable-${id}-sort-by-${column.param}-button`, className: `btn btn-${sortingByThisColumn ? 'light' : 'secondary'} btn-sm ms-1 ps-1 pe-1 pt-0 pb-0`, "aria-label": sortButtonAriaLabel, onClick: () => {
|
|
2588
2588
|
dispatch({
|
|
2589
|
-
type: ActionType$
|
|
2589
|
+
type: ActionType$4.ToggleSortColumn,
|
|
2590
2590
|
param: column.param,
|
|
2591
2591
|
});
|
|
2592
2592
|
} },
|
|
@@ -2626,7 +2626,7 @@ const IntelliTable = (props) => {
|
|
|
2626
2626
|
}
|
|
2627
2627
|
// Sort differently based on the data type
|
|
2628
2628
|
// > Boolean
|
|
2629
|
-
if (paramType === ParamType$
|
|
2629
|
+
if (paramType === ParamType$1.Boolean) {
|
|
2630
2630
|
if (aVal && !bVal) {
|
|
2631
2631
|
return (descending ? -1 : 1);
|
|
2632
2632
|
}
|
|
@@ -2636,14 +2636,14 @@ const IntelliTable = (props) => {
|
|
|
2636
2636
|
return tiebreaker;
|
|
2637
2637
|
}
|
|
2638
2638
|
// > Number
|
|
2639
|
-
if (paramType === ParamType$
|
|
2640
|
-
|| paramType === ParamType$
|
|
2639
|
+
if (paramType === ParamType$1.Int
|
|
2640
|
+
|| paramType === ParamType$1.Float) {
|
|
2641
2641
|
return (descending
|
|
2642
2642
|
? (bVal - aVal)
|
|
2643
2643
|
: (aVal - bVal));
|
|
2644
2644
|
}
|
|
2645
2645
|
// > String
|
|
2646
|
-
if (paramType === ParamType$
|
|
2646
|
+
if (paramType === ParamType$1.String) {
|
|
2647
2647
|
if (aVal < bVal) {
|
|
2648
2648
|
return (descending ? 1 : -1);
|
|
2649
2649
|
}
|
|
@@ -2653,7 +2653,7 @@ const IntelliTable = (props) => {
|
|
|
2653
2653
|
return tiebreaker;
|
|
2654
2654
|
}
|
|
2655
2655
|
// > JSON
|
|
2656
|
-
if (paramType === ParamType$
|
|
2656
|
+
if (paramType === ParamType$1.JSON) {
|
|
2657
2657
|
const aSize = (Array.isArray(aVal)
|
|
2658
2658
|
? aVal.length
|
|
2659
2659
|
: Object.keys(aVal).length);
|
|
@@ -2685,7 +2685,7 @@ const IntelliTable = (props) => {
|
|
|
2685
2685
|
let fullValue;
|
|
2686
2686
|
let visibleValue;
|
|
2687
2687
|
let title = '';
|
|
2688
|
-
if (column.type === ParamType$
|
|
2688
|
+
if (column.type === ParamType$1.Boolean) {
|
|
2689
2689
|
fullValue = !!(value);
|
|
2690
2690
|
const noValue = (value === undefined
|
|
2691
2691
|
|| value === null);
|
|
@@ -2697,7 +2697,7 @@ const IntelliTable = (props) => {
|
|
|
2697
2697
|
title = 'Empty Cell';
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
|
-
else if (column.type === ParamType$
|
|
2700
|
+
else if (column.type === ParamType$1.Int) {
|
|
2701
2701
|
fullValue = Number.parseInt(value, 10);
|
|
2702
2702
|
const noValue = Number.isNaN(fullValue);
|
|
2703
2703
|
visibleValue = (noValue
|
|
@@ -2708,7 +2708,7 @@ const IntelliTable = (props) => {
|
|
|
2708
2708
|
title = 'Empty Cell';
|
|
2709
2709
|
}
|
|
2710
2710
|
}
|
|
2711
|
-
else if (column.type === ParamType$
|
|
2711
|
+
else if (column.type === ParamType$1.Float) {
|
|
2712
2712
|
fullValue = Number.parseFloat(value);
|
|
2713
2713
|
const noValue = Number.isNaN(fullValue);
|
|
2714
2714
|
visibleValue = (noValue
|
|
@@ -2719,7 +2719,7 @@ const IntelliTable = (props) => {
|
|
|
2719
2719
|
title = 'Empty Cell';
|
|
2720
2720
|
}
|
|
2721
2721
|
}
|
|
2722
|
-
else if (column.type === ParamType$
|
|
2722
|
+
else if (column.type === ParamType$1.String) {
|
|
2723
2723
|
fullValue = String(value).trim();
|
|
2724
2724
|
const noValue = (value === undefined
|
|
2725
2725
|
|| value === null
|
|
@@ -2732,7 +2732,7 @@ const IntelliTable = (props) => {
|
|
|
2732
2732
|
title = 'Empty Cell';
|
|
2733
2733
|
}
|
|
2734
2734
|
}
|
|
2735
|
-
else if (column.type === ParamType$
|
|
2735
|
+
else if (column.type === ParamType$1.JSON) {
|
|
2736
2736
|
fullValue = JSON.stringify(value);
|
|
2737
2737
|
const noValue = (Array.isArray(value)
|
|
2738
2738
|
? (!value || value.length === 0)
|
|
@@ -2775,7 +2775,7 @@ const IntelliTable = (props) => {
|
|
|
2775
2775
|
React__default["default"].createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
|
|
2776
2776
|
React__default["default"].createElement("button", { type: "button", className: "btn btn-secondary ms-2", "aria-label": `show panel for customizing which columns show in table ${title}`, id: `IntelliTable-${id}-show-column-customization-modal`, onClick: () => {
|
|
2777
2777
|
dispatch({
|
|
2778
|
-
type: ActionType$
|
|
2778
|
+
type: ActionType$4.ToggleColVisCusModalVisibility,
|
|
2779
2779
|
});
|
|
2780
2780
|
} },
|
|
2781
2781
|
"Show/Hide Cols",
|
|
@@ -2897,185 +2897,185 @@ const columns = [
|
|
|
2897
2897
|
{
|
|
2898
2898
|
title: 'First Name',
|
|
2899
2899
|
param: 'userFirstName',
|
|
2900
|
-
type: ParamType$
|
|
2900
|
+
type: ParamType$1.String,
|
|
2901
2901
|
},
|
|
2902
2902
|
{
|
|
2903
2903
|
title: 'Last Name',
|
|
2904
2904
|
param: 'userLastName',
|
|
2905
|
-
type: ParamType$
|
|
2905
|
+
type: ParamType$1.String,
|
|
2906
2906
|
},
|
|
2907
2907
|
{
|
|
2908
2908
|
title: 'Email',
|
|
2909
2909
|
param: 'userEmail',
|
|
2910
|
-
type: ParamType$
|
|
2910
|
+
type: ParamType$1.String,
|
|
2911
2911
|
},
|
|
2912
2912
|
{
|
|
2913
2913
|
title: 'Canvas Id',
|
|
2914
2914
|
param: 'userId',
|
|
2915
|
-
type: ParamType$
|
|
2915
|
+
type: ParamType$1.Int,
|
|
2916
2916
|
},
|
|
2917
2917
|
{
|
|
2918
2918
|
title: 'Student?',
|
|
2919
2919
|
param: 'isLearner',
|
|
2920
|
-
type: ParamType$
|
|
2920
|
+
type: ParamType$1.Boolean,
|
|
2921
2921
|
},
|
|
2922
2922
|
{
|
|
2923
2923
|
title: 'Teaching Staff?',
|
|
2924
2924
|
param: 'isTTM',
|
|
2925
|
-
type: ParamType$
|
|
2925
|
+
type: ParamType$1.Boolean,
|
|
2926
2926
|
startsHidden: true,
|
|
2927
2927
|
},
|
|
2928
2928
|
{
|
|
2929
2929
|
title: 'Admin?',
|
|
2930
2930
|
param: 'isAdmin',
|
|
2931
|
-
type: ParamType$
|
|
2931
|
+
type: ParamType$1.Boolean,
|
|
2932
2932
|
startsHidden: true,
|
|
2933
2933
|
},
|
|
2934
2934
|
{
|
|
2935
2935
|
title: 'Course Canvas Id',
|
|
2936
2936
|
param: 'courseId',
|
|
2937
|
-
type: ParamType$
|
|
2937
|
+
type: ParamType$1.Int,
|
|
2938
2938
|
startsHidden: true,
|
|
2939
2939
|
},
|
|
2940
2940
|
{
|
|
2941
2941
|
title: 'Course Name',
|
|
2942
2942
|
param: 'courseName',
|
|
2943
|
-
type: ParamType$
|
|
2943
|
+
type: ParamType$1.String,
|
|
2944
2944
|
},
|
|
2945
2945
|
{
|
|
2946
2946
|
title: 'Browser Name',
|
|
2947
2947
|
param: 'browser.name',
|
|
2948
|
-
type: ParamType$
|
|
2948
|
+
type: ParamType$1.String,
|
|
2949
2949
|
startsHidden: true,
|
|
2950
2950
|
},
|
|
2951
2951
|
{
|
|
2952
2952
|
title: 'Browser Version',
|
|
2953
2953
|
param: 'browser.version',
|
|
2954
|
-
type: ParamType$
|
|
2954
|
+
type: ParamType$1.String,
|
|
2955
2955
|
startsHidden: true,
|
|
2956
2956
|
},
|
|
2957
2957
|
{
|
|
2958
2958
|
title: 'OS',
|
|
2959
2959
|
param: 'device.os',
|
|
2960
|
-
type: ParamType$
|
|
2960
|
+
type: ParamType$1.String,
|
|
2961
2961
|
startsHidden: true,
|
|
2962
2962
|
},
|
|
2963
2963
|
{
|
|
2964
2964
|
title: 'Mobile?',
|
|
2965
2965
|
param: 'device.isMobile',
|
|
2966
|
-
type: ParamType$
|
|
2966
|
+
type: ParamType$1.Boolean,
|
|
2967
2967
|
startsHidden: true,
|
|
2968
2968
|
},
|
|
2969
2969
|
{
|
|
2970
2970
|
title: 'Year',
|
|
2971
2971
|
param: 'year',
|
|
2972
|
-
type: ParamType$
|
|
2972
|
+
type: ParamType$1.Int,
|
|
2973
2973
|
},
|
|
2974
2974
|
{
|
|
2975
2975
|
title: 'Month',
|
|
2976
2976
|
param: 'month',
|
|
2977
|
-
type: ParamType$
|
|
2977
|
+
type: ParamType$1.Int,
|
|
2978
2978
|
},
|
|
2979
2979
|
{
|
|
2980
2980
|
title: 'Day',
|
|
2981
2981
|
param: 'day',
|
|
2982
|
-
type: ParamType$
|
|
2982
|
+
type: ParamType$1.Int,
|
|
2983
2983
|
},
|
|
2984
2984
|
{
|
|
2985
2985
|
title: 'Hour',
|
|
2986
2986
|
param: 'hour',
|
|
2987
|
-
type: ParamType$
|
|
2987
|
+
type: ParamType$1.Int,
|
|
2988
2988
|
},
|
|
2989
2989
|
{
|
|
2990
2990
|
title: 'Minute',
|
|
2991
2991
|
param: 'minute',
|
|
2992
|
-
type: ParamType$
|
|
2992
|
+
type: ParamType$1.Int,
|
|
2993
2993
|
startsHidden: true,
|
|
2994
2994
|
},
|
|
2995
2995
|
{
|
|
2996
2996
|
title: 'Timestamp',
|
|
2997
2997
|
param: 'timestamp',
|
|
2998
|
-
type: ParamType$
|
|
2998
|
+
type: ParamType$1.Int,
|
|
2999
2999
|
startsHidden: true,
|
|
3000
3000
|
},
|
|
3001
3001
|
{
|
|
3002
3002
|
title: 'Context',
|
|
3003
3003
|
param: 'context',
|
|
3004
|
-
type: ParamType$
|
|
3004
|
+
type: ParamType$1.String,
|
|
3005
3005
|
},
|
|
3006
3006
|
{
|
|
3007
3007
|
title: 'Subcontext',
|
|
3008
3008
|
param: 'subcontext',
|
|
3009
|
-
type: ParamType$
|
|
3009
|
+
type: ParamType$1.String,
|
|
3010
3010
|
},
|
|
3011
3011
|
{
|
|
3012
3012
|
title: 'Tags',
|
|
3013
3013
|
param: 'tags',
|
|
3014
|
-
type: ParamType$
|
|
3014
|
+
type: ParamType$1.JSON,
|
|
3015
3015
|
startsHidden: true,
|
|
3016
3016
|
},
|
|
3017
3017
|
{
|
|
3018
3018
|
title: 'Log Level',
|
|
3019
3019
|
param: 'level',
|
|
3020
|
-
type: ParamType$
|
|
3020
|
+
type: ParamType$1.String,
|
|
3021
3021
|
startsHidden: true,
|
|
3022
3022
|
},
|
|
3023
3023
|
{
|
|
3024
3024
|
title: 'Metadata',
|
|
3025
3025
|
param: 'metadata',
|
|
3026
|
-
type: ParamType$
|
|
3026
|
+
type: ParamType$1.JSON,
|
|
3027
3027
|
startsHidden: true,
|
|
3028
3028
|
},
|
|
3029
3029
|
{
|
|
3030
3030
|
title: 'Source',
|
|
3031
3031
|
param: 'source',
|
|
3032
|
-
type: ParamType$
|
|
3032
|
+
type: ParamType$1.String,
|
|
3033
3033
|
},
|
|
3034
3034
|
{
|
|
3035
3035
|
title: 'Server Route Path',
|
|
3036
3036
|
param: 'routePath',
|
|
3037
|
-
type: ParamType$
|
|
3037
|
+
type: ParamType$1.String,
|
|
3038
3038
|
startsHidden: true,
|
|
3039
3039
|
},
|
|
3040
3040
|
{
|
|
3041
3041
|
title: 'Server Route Template',
|
|
3042
3042
|
param: 'routeTemplate',
|
|
3043
|
-
type: ParamType$
|
|
3043
|
+
type: ParamType$1.String,
|
|
3044
3044
|
startsHidden: true,
|
|
3045
3045
|
},
|
|
3046
3046
|
{
|
|
3047
3047
|
title: 'Type',
|
|
3048
3048
|
param: 'type',
|
|
3049
|
-
type: ParamType$
|
|
3049
|
+
type: ParamType$1.String,
|
|
3050
3050
|
},
|
|
3051
3051
|
{
|
|
3052
3052
|
title: 'Error Message',
|
|
3053
3053
|
param: 'errorMessage',
|
|
3054
|
-
type: ParamType$
|
|
3054
|
+
type: ParamType$1.String,
|
|
3055
3055
|
startsHidden: true,
|
|
3056
3056
|
},
|
|
3057
3057
|
{
|
|
3058
3058
|
title: 'Error Code',
|
|
3059
3059
|
param: 'errorCode',
|
|
3060
|
-
type: ParamType$
|
|
3060
|
+
type: ParamType$1.String,
|
|
3061
3061
|
startsHidden: true,
|
|
3062
3062
|
},
|
|
3063
3063
|
{
|
|
3064
3064
|
title: 'Error Stack',
|
|
3065
3065
|
param: 'errorStack',
|
|
3066
|
-
type: ParamType$
|
|
3066
|
+
type: ParamType$1.String,
|
|
3067
3067
|
startsHidden: true,
|
|
3068
3068
|
},
|
|
3069
3069
|
{
|
|
3070
3070
|
title: 'Action Target',
|
|
3071
3071
|
param: 'target',
|
|
3072
|
-
type: ParamType$
|
|
3072
|
+
type: ParamType$1.String,
|
|
3073
3073
|
startsHidden: true,
|
|
3074
3074
|
},
|
|
3075
3075
|
{
|
|
3076
3076
|
title: 'Action Type',
|
|
3077
3077
|
param: 'action',
|
|
3078
|
-
type: ParamType$
|
|
3078
|
+
type: ParamType$1.String,
|
|
3079
3079
|
startsHidden: true,
|
|
3080
3080
|
},
|
|
3081
3081
|
];
|
|
@@ -3141,7 +3141,7 @@ const genHumanReadableName = (machineReadableName) => {
|
|
|
3141
3141
|
};
|
|
3142
3142
|
/* ------------- Actions ------------ */
|
|
3143
3143
|
// Types of actions
|
|
3144
|
-
var ActionType$
|
|
3144
|
+
var ActionType$3;
|
|
3145
3145
|
(function (ActionType) {
|
|
3146
3146
|
// Show the loading bar
|
|
3147
3147
|
ActionType["StartLoading"] = "start-loading";
|
|
@@ -3163,7 +3163,7 @@ var ActionType$5;
|
|
|
3163
3163
|
ActionType["UpdateActionErrorFilterState"] = "update-action-error-filter-state";
|
|
3164
3164
|
// Update the advanced filter state
|
|
3165
3165
|
ActionType["UpdateAdvancedFilterState"] = "update-advanced-filter-state";
|
|
3166
|
-
})(ActionType$
|
|
3166
|
+
})(ActionType$3 || (ActionType$3 = {}));
|
|
3167
3167
|
/**
|
|
3168
3168
|
* Reducer that executes actions
|
|
3169
3169
|
* @author Gabe Abrams
|
|
@@ -3172,36 +3172,36 @@ var ActionType$5;
|
|
|
3172
3172
|
*/
|
|
3173
3173
|
const reducer$3 = (state, action) => {
|
|
3174
3174
|
switch (action.type) {
|
|
3175
|
-
case ActionType$
|
|
3175
|
+
case ActionType$3.StartLoading: {
|
|
3176
3176
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
3177
3177
|
}
|
|
3178
|
-
case ActionType$
|
|
3178
|
+
case ActionType$3.FinishLoading: {
|
|
3179
3179
|
return Object.assign(Object.assign({}, state), { loading: false, logMap: action.logMap });
|
|
3180
3180
|
}
|
|
3181
|
-
case ActionType$
|
|
3181
|
+
case ActionType$3.ToggleFilterDrawer: {
|
|
3182
3182
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
|
|
3183
3183
|
? undefined // hide
|
|
3184
3184
|
: action.filterDrawer) });
|
|
3185
3185
|
}
|
|
3186
|
-
case ActionType$
|
|
3186
|
+
case ActionType$3.HideFilterDrawer: {
|
|
3187
3187
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
|
|
3188
3188
|
}
|
|
3189
|
-
case ActionType$
|
|
3189
|
+
case ActionType$3.ResetFilters: {
|
|
3190
3190
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.initDateFilterState, contextFilterState: action.initContextFilterState, tagFilterState: action.initTagFilterState, actionErrorFilterState: action.initActionErrorFilterState, advancedFilterState: action.initAdvancedFilterState });
|
|
3191
3191
|
}
|
|
3192
|
-
case ActionType$
|
|
3192
|
+
case ActionType$3.UpdateDateFilterState: {
|
|
3193
3193
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.dateFilterState });
|
|
3194
3194
|
}
|
|
3195
|
-
case ActionType$
|
|
3195
|
+
case ActionType$3.UpdateContextFilterState: {
|
|
3196
3196
|
return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
|
|
3197
3197
|
}
|
|
3198
|
-
case ActionType$
|
|
3198
|
+
case ActionType$3.UpdateTagFilterState: {
|
|
3199
3199
|
return Object.assign(Object.assign({}, state), { tagFilterState: action.tagFilterState });
|
|
3200
3200
|
}
|
|
3201
|
-
case ActionType$
|
|
3201
|
+
case ActionType$3.UpdateActionErrorFilterState: {
|
|
3202
3202
|
return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
|
|
3203
3203
|
}
|
|
3204
|
-
case ActionType$
|
|
3204
|
+
case ActionType$3.UpdateAdvancedFilterState: {
|
|
3205
3205
|
return Object.assign(Object.assign({}, state), { advancedFilterState: action.advancedFilterState });
|
|
3206
3206
|
}
|
|
3207
3207
|
default: {
|
|
@@ -3378,10 +3378,10 @@ const LogReviewer = (props) => {
|
|
|
3378
3378
|
* @author Gabe Abrams
|
|
3379
3379
|
* @param newDateFilterState the new date filter state
|
|
3380
3380
|
*/
|
|
3381
|
-
const handleDateRangeUpdated = (newDateFilterState) => __awaiter
|
|
3381
|
+
const handleDateRangeUpdated = (newDateFilterState) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3382
3382
|
// Update state
|
|
3383
3383
|
dispatch({
|
|
3384
|
-
type: ActionType$
|
|
3384
|
+
type: ActionType$3.UpdateDateFilterState,
|
|
3385
3385
|
dateFilterState: newDateFilterState,
|
|
3386
3386
|
});
|
|
3387
3387
|
// Check which year/month combos we need to load
|
|
@@ -3392,7 +3392,7 @@ const LogReviewer = (props) => {
|
|
|
3392
3392
|
}
|
|
3393
3393
|
// Start loading
|
|
3394
3394
|
dispatch({
|
|
3395
|
-
type: ActionType$
|
|
3395
|
+
type: ActionType$3.StartLoading,
|
|
3396
3396
|
});
|
|
3397
3397
|
// Load required months
|
|
3398
3398
|
try {
|
|
@@ -3416,7 +3416,7 @@ const LogReviewer = (props) => {
|
|
|
3416
3416
|
}
|
|
3417
3417
|
// Finish loading
|
|
3418
3418
|
dispatch({
|
|
3419
|
-
type: ActionType$
|
|
3419
|
+
type: ActionType$3.FinishLoading,
|
|
3420
3420
|
logMap,
|
|
3421
3421
|
});
|
|
3422
3422
|
});
|
|
@@ -3455,7 +3455,7 @@ const LogReviewer = (props) => {
|
|
|
3455
3455
|
React__default["default"].createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
|
|
3456
3456
|
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: () => {
|
|
3457
3457
|
dispatch({
|
|
3458
|
-
type: ActionType$
|
|
3458
|
+
type: ActionType$3.ToggleFilterDrawer,
|
|
3459
3459
|
filterDrawer: FilterDrawer.Date,
|
|
3460
3460
|
});
|
|
3461
3461
|
} },
|
|
@@ -3463,7 +3463,7 @@ const LogReviewer = (props) => {
|
|
|
3463
3463
|
"Date"),
|
|
3464
3464
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-context-filter-drawer", className: `btn btn-${FilterDrawer.Context === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle context filter drawer", onClick: () => {
|
|
3465
3465
|
dispatch({
|
|
3466
|
-
type: ActionType$
|
|
3466
|
+
type: ActionType$3.ToggleFilterDrawer,
|
|
3467
3467
|
filterDrawer: FilterDrawer.Context,
|
|
3468
3468
|
});
|
|
3469
3469
|
} },
|
|
@@ -3471,7 +3471,7 @@ const LogReviewer = (props) => {
|
|
|
3471
3471
|
"Context"),
|
|
3472
3472
|
(LogMetadata.Tag && Object.keys(LogMetadata.Tag).length > 0) && (React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-tag-filter-drawer", className: `btn btn-${FilterDrawer.Tag === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle tag filter drawer", onClick: () => {
|
|
3473
3473
|
dispatch({
|
|
3474
|
-
type: ActionType$
|
|
3474
|
+
type: ActionType$3.ToggleFilterDrawer,
|
|
3475
3475
|
filterDrawer: FilterDrawer.Tag,
|
|
3476
3476
|
});
|
|
3477
3477
|
} },
|
|
@@ -3479,7 +3479,7 @@ const LogReviewer = (props) => {
|
|
|
3479
3479
|
"Tag")),
|
|
3480
3480
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-action-filter-drawer", className: `btn btn-${FilterDrawer.Action === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle action and error filter drawer", onClick: () => {
|
|
3481
3481
|
dispatch({
|
|
3482
|
-
type: ActionType$
|
|
3482
|
+
type: ActionType$3.ToggleFilterDrawer,
|
|
3483
3483
|
filterDrawer: FilterDrawer.Action,
|
|
3484
3484
|
});
|
|
3485
3485
|
} },
|
|
@@ -3487,7 +3487,7 @@ const LogReviewer = (props) => {
|
|
|
3487
3487
|
"Action"),
|
|
3488
3488
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-advanced-filter-drawer", className: `btn btn-${FilterDrawer.Advanced === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle advanced filter drawer", onClick: () => {
|
|
3489
3489
|
dispatch({
|
|
3490
|
-
type: ActionType$
|
|
3490
|
+
type: ActionType$3.ToggleFilterDrawer,
|
|
3491
3491
|
filterDrawer: FilterDrawer.Advanced,
|
|
3492
3492
|
});
|
|
3493
3493
|
} },
|
|
@@ -3495,7 +3495,7 @@ const LogReviewer = (props) => {
|
|
|
3495
3495
|
"Advanced"),
|
|
3496
3496
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
|
|
3497
3497
|
dispatch({
|
|
3498
|
-
type: ActionType$
|
|
3498
|
+
type: ActionType$3.ResetFilters,
|
|
3499
3499
|
initActionErrorFilterState,
|
|
3500
3500
|
initAdvancedFilterState,
|
|
3501
3501
|
initContextFilterState,
|
|
@@ -3617,7 +3617,7 @@ const LogReviewer = (props) => {
|
|
|
3617
3617
|
}
|
|
3618
3618
|
});
|
|
3619
3619
|
dispatch({
|
|
3620
|
-
type: ActionType$
|
|
3620
|
+
type: ActionType$3.UpdateContextFilterState,
|
|
3621
3621
|
contextFilterState,
|
|
3622
3622
|
});
|
|
3623
3623
|
} }));
|
|
@@ -3632,7 +3632,7 @@ const LogReviewer = (props) => {
|
|
|
3632
3632
|
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: tagFilterState[tag], onChanged: (checked) => {
|
|
3633
3633
|
tagFilterState[tag] = checked;
|
|
3634
3634
|
dispatch({
|
|
3635
|
-
type: ActionType$
|
|
3635
|
+
type: ActionType$3.UpdateTagFilterState,
|
|
3636
3636
|
tagFilterState,
|
|
3637
3637
|
});
|
|
3638
3638
|
} }));
|
|
@@ -3645,21 +3645,21 @@ const LogReviewer = (props) => {
|
|
|
3645
3645
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
|
|
3646
3646
|
actionErrorFilterState.type = undefined;
|
|
3647
3647
|
dispatch({
|
|
3648
|
-
type: ActionType$
|
|
3648
|
+
type: ActionType$3.UpdateActionErrorFilterState,
|
|
3649
3649
|
actionErrorFilterState,
|
|
3650
3650
|
});
|
|
3651
3651
|
}, ariaLabel: "show logs of all types", selected: actionErrorFilterState.type === undefined }),
|
|
3652
3652
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
|
|
3653
3653
|
actionErrorFilterState.type = LogType$1.Action;
|
|
3654
3654
|
dispatch({
|
|
3655
|
-
type: ActionType$
|
|
3655
|
+
type: ActionType$3.UpdateActionErrorFilterState,
|
|
3656
3656
|
actionErrorFilterState,
|
|
3657
3657
|
});
|
|
3658
3658
|
}, ariaLabel: "only show action logs", selected: actionErrorFilterState.type === LogType$1.Action }),
|
|
3659
3659
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
|
|
3660
3660
|
actionErrorFilterState.type = LogType$1.Error;
|
|
3661
3661
|
dispatch({
|
|
3662
|
-
type: ActionType$
|
|
3662
|
+
type: ActionType$3.UpdateActionErrorFilterState,
|
|
3663
3663
|
actionErrorFilterState,
|
|
3664
3664
|
});
|
|
3665
3665
|
}, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
|
|
@@ -3671,7 +3671,7 @@ const LogReviewer = (props) => {
|
|
|
3671
3671
|
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: actionErrorFilterState.action[action], onChanged: (checked) => {
|
|
3672
3672
|
actionErrorFilterState.action[action] = checked;
|
|
3673
3673
|
dispatch({
|
|
3674
|
-
type: ActionType$
|
|
3674
|
+
type: ActionType$3.UpdateActionErrorFilterState,
|
|
3675
3675
|
actionErrorFilterState,
|
|
3676
3676
|
});
|
|
3677
3677
|
} }));
|
|
@@ -3682,7 +3682,7 @@ const LogReviewer = (props) => {
|
|
|
3682
3682
|
return (React__default["default"].createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: actionErrorFilterState.target[target], noMarginOnRight: true, onChanged: (checked) => {
|
|
3683
3683
|
actionErrorFilterState.target[target] = checked;
|
|
3684
3684
|
dispatch({
|
|
3685
|
-
type: ActionType$
|
|
3685
|
+
type: ActionType$3.UpdateActionErrorFilterState,
|
|
3686
3686
|
actionErrorFilterState,
|
|
3687
3687
|
});
|
|
3688
3688
|
} }));
|
|
@@ -3694,7 +3694,7 @@ const LogReviewer = (props) => {
|
|
|
3694
3694
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error message", value: actionErrorFilterState.errorMessage, placeholder: "e.g. undefined is not a function", onChange: (e) => {
|
|
3695
3695
|
actionErrorFilterState.errorMessage = e.target.value;
|
|
3696
3696
|
dispatch({
|
|
3697
|
-
type: ActionType$
|
|
3697
|
+
type: ActionType$3.UpdateActionErrorFilterState,
|
|
3698
3698
|
actionErrorFilterState,
|
|
3699
3699
|
});
|
|
3700
3700
|
} })),
|
|
@@ -3705,7 +3705,7 @@ const LogReviewer = (props) => {
|
|
|
3705
3705
|
.trim()
|
|
3706
3706
|
.toUpperCase());
|
|
3707
3707
|
dispatch({
|
|
3708
|
-
type: ActionType$
|
|
3708
|
+
type: ActionType$3.UpdateActionErrorFilterState,
|
|
3709
3709
|
actionErrorFilterState,
|
|
3710
3710
|
});
|
|
3711
3711
|
} }))))));
|
|
@@ -3719,7 +3719,7 @@ const LogReviewer = (props) => {
|
|
|
3719
3719
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user first name", value: advancedFilterState.userFirstName, placeholder: "e.g. Divardo", onChange: (e) => {
|
|
3720
3720
|
advancedFilterState.userFirstName = e.target.value;
|
|
3721
3721
|
dispatch({
|
|
3722
|
-
type: ActionType$
|
|
3722
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3723
3723
|
advancedFilterState,
|
|
3724
3724
|
});
|
|
3725
3725
|
} })),
|
|
@@ -3728,7 +3728,7 @@ const LogReviewer = (props) => {
|
|
|
3728
3728
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user last name", value: advancedFilterState.userLastName, placeholder: "e.g. Calicci", onChange: (e) => {
|
|
3729
3729
|
advancedFilterState.userLastName = e.target.value;
|
|
3730
3730
|
dispatch({
|
|
3731
|
-
type: ActionType$
|
|
3731
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3732
3732
|
advancedFilterState,
|
|
3733
3733
|
});
|
|
3734
3734
|
} })),
|
|
@@ -3738,7 +3738,7 @@ const LogReviewer = (props) => {
|
|
|
3738
3738
|
advancedFilterState.userEmail = ((e.target.value)
|
|
3739
3739
|
.trim());
|
|
3740
3740
|
dispatch({
|
|
3741
|
-
type: ActionType$
|
|
3741
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3742
3742
|
advancedFilterState,
|
|
3743
3743
|
});
|
|
3744
3744
|
} })),
|
|
@@ -3752,7 +3752,7 @@ const LogReviewer = (props) => {
|
|
|
3752
3752
|
.trim());
|
|
3753
3753
|
}
|
|
3754
3754
|
dispatch({
|
|
3755
|
-
type: ActionType$
|
|
3755
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3756
3756
|
advancedFilterState,
|
|
3757
3757
|
});
|
|
3758
3758
|
} })),
|
|
@@ -3760,21 +3760,21 @@ const LogReviewer = (props) => {
|
|
|
3760
3760
|
React__default["default"].createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
|
|
3761
3761
|
advancedFilterState.includeLearners = checked;
|
|
3762
3762
|
dispatch({
|
|
3763
|
-
type: ActionType$
|
|
3763
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3764
3764
|
advancedFilterState,
|
|
3765
3765
|
});
|
|
3766
3766
|
}, checked: advancedFilterState.includeLearners, ariaLabel: "show logs from students" }),
|
|
3767
3767
|
React__default["default"].createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
|
|
3768
3768
|
advancedFilterState.includeTTMs = checked;
|
|
3769
3769
|
dispatch({
|
|
3770
|
-
type: ActionType$
|
|
3770
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3771
3771
|
advancedFilterState,
|
|
3772
3772
|
});
|
|
3773
3773
|
}, checked: advancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members" }),
|
|
3774
3774
|
React__default["default"].createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
|
|
3775
3775
|
advancedFilterState.includeAdmins = checked;
|
|
3776
3776
|
dispatch({
|
|
3777
|
-
type: ActionType$
|
|
3777
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3778
3778
|
advancedFilterState,
|
|
3779
3779
|
});
|
|
3780
3780
|
}, checked: advancedFilterState.includeAdmins, ariaLabel: "show logs from admins" }))),
|
|
@@ -3784,7 +3784,7 @@ const LogReviewer = (props) => {
|
|
|
3784
3784
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for course name", value: advancedFilterState.courseName, placeholder: "e.g. GLC 200", onChange: (e) => {
|
|
3785
3785
|
advancedFilterState.courseName = e.target.value;
|
|
3786
3786
|
dispatch({
|
|
3787
|
-
type: ActionType$
|
|
3787
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3788
3788
|
advancedFilterState,
|
|
3789
3789
|
});
|
|
3790
3790
|
} })),
|
|
@@ -3798,7 +3798,7 @@ const LogReviewer = (props) => {
|
|
|
3798
3798
|
.trim());
|
|
3799
3799
|
}
|
|
3800
3800
|
dispatch({
|
|
3801
|
-
type: ActionType$
|
|
3801
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3802
3802
|
advancedFilterState,
|
|
3803
3803
|
});
|
|
3804
3804
|
} }))),
|
|
@@ -3807,21 +3807,21 @@ const LogReviewer = (props) => {
|
|
|
3807
3807
|
React__default["default"].createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
|
|
3808
3808
|
advancedFilterState.isMobile = undefined;
|
|
3809
3809
|
dispatch({
|
|
3810
|
-
type: ActionType$
|
|
3810
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3811
3811
|
advancedFilterState,
|
|
3812
3812
|
});
|
|
3813
3813
|
} }),
|
|
3814
3814
|
React__default["default"].createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
|
|
3815
3815
|
advancedFilterState.isMobile = true;
|
|
3816
3816
|
dispatch({
|
|
3817
|
-
type: ActionType$
|
|
3817
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3818
3818
|
advancedFilterState,
|
|
3819
3819
|
});
|
|
3820
3820
|
} }),
|
|
3821
3821
|
React__default["default"].createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
|
|
3822
3822
|
advancedFilterState.isMobile = false;
|
|
3823
3823
|
dispatch({
|
|
3824
|
-
type: ActionType$
|
|
3824
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3825
3825
|
advancedFilterState,
|
|
3826
3826
|
});
|
|
3827
3827
|
}, noMarginOnRight: true }))),
|
|
@@ -3830,21 +3830,21 @@ const LogReviewer = (props) => {
|
|
|
3830
3830
|
React__default["default"].createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
|
|
3831
3831
|
advancedFilterState.source = undefined;
|
|
3832
3832
|
dispatch({
|
|
3833
|
-
type: ActionType$
|
|
3833
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3834
3834
|
advancedFilterState,
|
|
3835
3835
|
});
|
|
3836
3836
|
} }),
|
|
3837
3837
|
React__default["default"].createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
|
|
3838
3838
|
advancedFilterState.source = LogSource$1.Client;
|
|
3839
3839
|
dispatch({
|
|
3840
|
-
type: ActionType$
|
|
3840
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3841
3841
|
advancedFilterState,
|
|
3842
3842
|
});
|
|
3843
3843
|
} }),
|
|
3844
3844
|
React__default["default"].createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
|
|
3845
3845
|
advancedFilterState.source = LogSource$1.Server;
|
|
3846
3846
|
dispatch({
|
|
3847
|
-
type: ActionType$
|
|
3847
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3848
3848
|
advancedFilterState,
|
|
3849
3849
|
});
|
|
3850
3850
|
}, noMarginOnRight: true })),
|
|
@@ -3855,7 +3855,7 @@ const LogReviewer = (props) => {
|
|
|
3855
3855
|
advancedFilterState.courseName = ((e.target.value)
|
|
3856
3856
|
.trim());
|
|
3857
3857
|
dispatch({
|
|
3858
|
-
type: ActionType$
|
|
3858
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3859
3859
|
advancedFilterState,
|
|
3860
3860
|
});
|
|
3861
3861
|
} })),
|
|
@@ -3865,7 +3865,7 @@ const LogReviewer = (props) => {
|
|
|
3865
3865
|
advancedFilterState.courseName = ((e.target.value)
|
|
3866
3866
|
.trim());
|
|
3867
3867
|
dispatch({
|
|
3868
|
-
type: ActionType$
|
|
3868
|
+
type: ActionType$3.UpdateAdvancedFilterState,
|
|
3869
3869
|
advancedFilterState,
|
|
3870
3870
|
});
|
|
3871
3871
|
} })))))));
|
|
@@ -39465,11 +39465,11 @@ var CreatableSelect$1 = CreatableSelect;
|
|
|
39465
39465
|
// Import React
|
|
39466
39466
|
/* ------------- Actions ------------ */
|
|
39467
39467
|
// Types of actions
|
|
39468
|
-
var ActionType$
|
|
39468
|
+
var ActionType$2;
|
|
39469
39469
|
(function (ActionType) {
|
|
39470
39470
|
// Update the input value
|
|
39471
39471
|
ActionType["SetInputValue"] = "SetInputValue";
|
|
39472
|
-
})(ActionType$
|
|
39472
|
+
})(ActionType$2 || (ActionType$2 = {}));
|
|
39473
39473
|
/**
|
|
39474
39474
|
* Reducer that executes actions
|
|
39475
39475
|
* @author Yuen Ler Chow
|
|
@@ -39478,7 +39478,7 @@ var ActionType$4;
|
|
|
39478
39478
|
*/
|
|
39479
39479
|
const reducer$2 = (state, action) => {
|
|
39480
39480
|
switch (action.type) {
|
|
39481
|
-
case ActionType$
|
|
39481
|
+
case ActionType$2.SetInputValue: {
|
|
39482
39482
|
return Object.assign(Object.assign({}, state), { inputValue: action.value });
|
|
39483
39483
|
}
|
|
39484
39484
|
default: {
|
|
@@ -39569,7 +39569,7 @@ const CreatableMultiselect = (props) => {
|
|
|
39569
39569
|
}
|
|
39570
39570
|
// resets text field to empty because the values have been added
|
|
39571
39571
|
dispatch({
|
|
39572
|
-
type: ActionType$
|
|
39572
|
+
type: ActionType$2.SetInputValue,
|
|
39573
39573
|
value: '',
|
|
39574
39574
|
});
|
|
39575
39575
|
};
|
|
@@ -39608,7 +39608,7 @@ const CreatableMultiselect = (props) => {
|
|
|
39608
39608
|
else {
|
|
39609
39609
|
// simply update the input value to the new input value
|
|
39610
39610
|
dispatch({
|
|
39611
|
-
type: ActionType$
|
|
39611
|
+
type: ActionType$2.SetInputValue,
|
|
39612
39612
|
value: newValue,
|
|
39613
39613
|
});
|
|
39614
39614
|
}
|
|
@@ -39659,13 +39659,13 @@ const style = `
|
|
|
39659
39659
|
`;
|
|
39660
39660
|
/* ------------- Actions ------------ */
|
|
39661
39661
|
// Types of actions
|
|
39662
|
-
var ActionType$
|
|
39662
|
+
var ActionType$1;
|
|
39663
39663
|
(function (ActionType) {
|
|
39664
39664
|
// Update the DBEntry
|
|
39665
39665
|
ActionType["UpdateDBEntry"] = "UpdateDBEntry";
|
|
39666
39666
|
// Start the save spinner
|
|
39667
39667
|
ActionType["StartSave"] = "StartSave";
|
|
39668
|
-
})(ActionType$
|
|
39668
|
+
})(ActionType$1 || (ActionType$1 = {}));
|
|
39669
39669
|
/**
|
|
39670
39670
|
* Reducer that executes actions
|
|
39671
39671
|
* @author Yuen Ler Chow
|
|
@@ -39674,10 +39674,10 @@ var ActionType$3;
|
|
|
39674
39674
|
*/
|
|
39675
39675
|
const reducer$1 = (state, action) => {
|
|
39676
39676
|
switch (action.type) {
|
|
39677
|
-
case ActionType$
|
|
39677
|
+
case ActionType$1.UpdateDBEntry: {
|
|
39678
39678
|
return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
|
|
39679
39679
|
}
|
|
39680
|
-
case ActionType$
|
|
39680
|
+
case ActionType$1.StartSave: {
|
|
39681
39681
|
return Object.assign(Object.assign({}, state), { saving: true });
|
|
39682
39682
|
}
|
|
39683
39683
|
default: {
|
|
@@ -39712,9 +39712,9 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39712
39712
|
* Save changes to the DBEntry and then finish
|
|
39713
39713
|
* @author Yuen Ler Chow
|
|
39714
39714
|
*/
|
|
39715
|
-
const save = () => __awaiter
|
|
39715
|
+
const save = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39716
39716
|
// Start the save loading indicator
|
|
39717
|
-
dispatch({ type: ActionType$
|
|
39717
|
+
dispatch({ type: ActionType$1.StartSave });
|
|
39718
39718
|
// add all default values to the entry
|
|
39719
39719
|
entryFields.forEach((field) => {
|
|
39720
39720
|
if (field.defaultValue && !entry[field.objectKey]) {
|
|
@@ -39875,7 +39875,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39875
39875
|
return (React__default["default"].createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
|
|
39876
39876
|
entry[field.objectKey] = choice.value;
|
|
39877
39877
|
dispatch({
|
|
39878
|
-
type: ActionType$
|
|
39878
|
+
type: ActionType$1.UpdateDBEntry,
|
|
39879
39879
|
dbEntry: entry,
|
|
39880
39880
|
});
|
|
39881
39881
|
}, ariaLabel: choice.title }));
|
|
@@ -39887,7 +39887,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39887
39887
|
React__default["default"].createElement("input", { disabled: disabled, type: "text", className: "form-control", placeholder: field.placeholder, "aria-describedby": "AddOrEditDBEntry-form-name-label", value: entry[field.objectKey] || '', onChange: (e) => {
|
|
39888
39888
|
entry[field.objectKey] = (e.target.value);
|
|
39889
39889
|
dispatch({
|
|
39890
|
-
type: ActionType$
|
|
39890
|
+
type: ActionType$1.UpdateDBEntry,
|
|
39891
39891
|
dbEntry: entry,
|
|
39892
39892
|
});
|
|
39893
39893
|
} }))));
|
|
@@ -39900,7 +39900,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39900
39900
|
entry[field.objectKey] = (e.target.value
|
|
39901
39901
|
.replace(/[^0-9]/g, ''));
|
|
39902
39902
|
dispatch({
|
|
39903
|
-
type: ActionType$
|
|
39903
|
+
type: ActionType$1.UpdateDBEntry,
|
|
39904
39904
|
dbEntry: entry,
|
|
39905
39905
|
});
|
|
39906
39906
|
} }))));
|
|
@@ -39930,7 +39930,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39930
39930
|
}
|
|
39931
39931
|
// Save
|
|
39932
39932
|
dispatch({
|
|
39933
|
-
type: ActionType$
|
|
39933
|
+
type: ActionType$1.UpdateDBEntry,
|
|
39934
39934
|
dbEntry: entry,
|
|
39935
39935
|
});
|
|
39936
39936
|
}, ariaLabel: choice.title }));
|
|
@@ -39945,7 +39945,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39945
39945
|
// Update entry and save
|
|
39946
39946
|
entry[field.objectKey] = values;
|
|
39947
39947
|
dispatch({
|
|
39948
|
-
type: ActionType$
|
|
39948
|
+
type: ActionType$1.UpdateDBEntry,
|
|
39949
39949
|
dbEntry: entry,
|
|
39950
39950
|
});
|
|
39951
39951
|
} })))));
|
|
@@ -39958,7 +39958,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39958
39958
|
React__default["default"].createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
|
|
39959
39959
|
entry[field.objectKey] = values;
|
|
39960
39960
|
dispatch({
|
|
39961
|
-
type: ActionType$
|
|
39961
|
+
type: ActionType$1.UpdateDBEntry,
|
|
39962
39962
|
dbEntry: entry,
|
|
39963
39963
|
});
|
|
39964
39964
|
} })))));
|
|
@@ -39982,7 +39982,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39982
39982
|
return renderEntryField(field, disabled);
|
|
39983
39983
|
}),
|
|
39984
39984
|
React__default["default"].createElement("div", { className: "text-center mt-2" },
|
|
39985
|
-
React__default["default"].createElement("button", { type: "button", id: "AddOrEditDBEntry-save-changes-button", className: "btn btn-primary btn-lg me-1", "aria-label": "Save changes", onClick: () => __awaiter
|
|
39985
|
+
React__default["default"].createElement("button", { type: "button", id: "AddOrEditDBEntry-save-changes-button", className: "btn btn-primary btn-lg me-1", "aria-label": "Save changes", onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39986
39986
|
if (validationError) {
|
|
39987
39987
|
return alert$1('Please fix the following error', validationError);
|
|
39988
39988
|
}
|
|
@@ -40028,7 +40028,7 @@ const generateEndpointPath = (collectionName, adminsOnly) => {
|
|
|
40028
40028
|
*/
|
|
40029
40029
|
/* ------------- Actions ------------ */
|
|
40030
40030
|
// Types of actions
|
|
40031
|
-
var ActionType
|
|
40031
|
+
var ActionType;
|
|
40032
40032
|
(function (ActionType) {
|
|
40033
40033
|
// Show adder
|
|
40034
40034
|
ActionType["ShowAdder"] = "ShowAdder";
|
|
@@ -40042,7 +40042,7 @@ var ActionType$2;
|
|
|
40042
40042
|
ActionType["StartDelete"] = "StartDelete";
|
|
40043
40043
|
// Finish deletion process
|
|
40044
40044
|
ActionType["FinishDelete"] = "FinishDelete";
|
|
40045
|
-
})(ActionType
|
|
40045
|
+
})(ActionType || (ActionType = {}));
|
|
40046
40046
|
/**
|
|
40047
40047
|
* Reducer that executes actions
|
|
40048
40048
|
* @author Yuen Ler Chow
|
|
@@ -40051,16 +40051,16 @@ var ActionType$2;
|
|
|
40051
40051
|
*/
|
|
40052
40052
|
const reducer = (state, action) => {
|
|
40053
40053
|
switch (action.type) {
|
|
40054
|
-
case ActionType
|
|
40054
|
+
case ActionType.FinishLoading: {
|
|
40055
40055
|
return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
|
|
40056
40056
|
}
|
|
40057
|
-
case ActionType
|
|
40057
|
+
case ActionType.ShowAdder: {
|
|
40058
40058
|
return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
|
|
40059
40059
|
}
|
|
40060
|
-
case ActionType
|
|
40060
|
+
case ActionType.ShowEditor: {
|
|
40061
40061
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
|
|
40062
40062
|
}
|
|
40063
|
-
case ActionType
|
|
40063
|
+
case ActionType.FinishAdd: {
|
|
40064
40064
|
// Handle cancel
|
|
40065
40065
|
const finishedEntry = action.dbEntry;
|
|
40066
40066
|
if (!finishedEntry) {
|
|
@@ -40084,10 +40084,10 @@ const reducer = (state, action) => {
|
|
|
40084
40084
|
// Update the state
|
|
40085
40085
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
|
|
40086
40086
|
}
|
|
40087
|
-
case ActionType
|
|
40087
|
+
case ActionType.StartDelete: {
|
|
40088
40088
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
40089
40089
|
}
|
|
40090
|
-
case ActionType
|
|
40090
|
+
case ActionType.FinishDelete: {
|
|
40091
40091
|
return Object.assign(Object.assign({}, state), { loading: false,
|
|
40092
40092
|
// Remove the deleted entry from the list
|
|
40093
40093
|
dbEntries: state.dbEntries.filter((entry) => {
|
|
@@ -40126,7 +40126,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40126
40126
|
* @author Yuen Ler Chow
|
|
40127
40127
|
* @param entry the database entry to delete
|
|
40128
40128
|
*/
|
|
40129
|
-
const deleteEntry = (entry) => __awaiter
|
|
40129
|
+
const deleteEntry = (entry) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40130
40130
|
// Confirm
|
|
40131
40131
|
const confirmed = yield confirm('Remove?', `Are you sure you want to remove this ${itemName}?`, {
|
|
40132
40132
|
confirmButtonText: 'Remove Item',
|
|
@@ -40139,7 +40139,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40139
40139
|
try {
|
|
40140
40140
|
// Start loader
|
|
40141
40141
|
dispatch({
|
|
40142
|
-
type: ActionType
|
|
40142
|
+
type: ActionType.StartDelete,
|
|
40143
40143
|
});
|
|
40144
40144
|
// Perform deletion
|
|
40145
40145
|
yield visitServerEndpoint({
|
|
@@ -40148,7 +40148,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40148
40148
|
});
|
|
40149
40149
|
// Finish loader
|
|
40150
40150
|
dispatch({
|
|
40151
|
-
type: ActionType
|
|
40151
|
+
type: ActionType.FinishDelete,
|
|
40152
40152
|
dbEntry: entry,
|
|
40153
40153
|
idPropName,
|
|
40154
40154
|
});
|
|
@@ -40165,7 +40165,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40165
40165
|
* @author Yuen Ler Chow
|
|
40166
40166
|
*/
|
|
40167
40167
|
React.useEffect(() => {
|
|
40168
|
-
(() => __awaiter
|
|
40168
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
40169
40169
|
// Load list of database entries
|
|
40170
40170
|
try {
|
|
40171
40171
|
const data = yield visitServerEndpoint({
|
|
@@ -40177,7 +40177,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40177
40177
|
});
|
|
40178
40178
|
// Save loaded data
|
|
40179
40179
|
dispatch({
|
|
40180
|
-
type: ActionType
|
|
40180
|
+
type: ActionType.FinishLoading,
|
|
40181
40181
|
dbEntries: data,
|
|
40182
40182
|
});
|
|
40183
40183
|
}
|
|
@@ -40220,7 +40220,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40220
40220
|
React__default["default"].createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
|
|
40221
40221
|
!disableEdit && (React__default["default"].createElement("button", { type: "button", id: `DBEntryManagerPanel-edit-with-id-${entry[idPropName]}`, className: "btn btn-primary", "aria-label": `edit db entry: ${entry[titlePropName]}`, onClick: () => {
|
|
40222
40222
|
dispatch({
|
|
40223
|
-
type: ActionType
|
|
40223
|
+
type: ActionType.ShowEditor,
|
|
40224
40224
|
dbEntry: entry,
|
|
40225
40225
|
});
|
|
40226
40226
|
} },
|
|
@@ -40230,7 +40230,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40230
40230
|
React__default["default"].createElement("div", { className: "d-grid" },
|
|
40231
40231
|
React__default["default"].createElement("button", { type: "button", id: "DBEntryManagerPanel-add-entry", className: "btn btn-lg btn-primary", "aria-label": `add a new ${itemName} entry to the list of entries`, onClick: () => {
|
|
40232
40232
|
dispatch({
|
|
40233
|
-
type: ActionType
|
|
40233
|
+
type: ActionType.ShowAdder,
|
|
40234
40234
|
});
|
|
40235
40235
|
} },
|
|
40236
40236
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faPlus, className: "me-2" }),
|
|
@@ -40242,7 +40242,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40242
40242
|
if (!loading && (adding || dbEntryToEdit)) {
|
|
40243
40243
|
body = (React__default["default"].createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, onFinished: (entry) => {
|
|
40244
40244
|
dispatch({
|
|
40245
|
-
type: ActionType
|
|
40245
|
+
type: ActionType.FinishAdd,
|
|
40246
40246
|
dbEntry: entry,
|
|
40247
40247
|
idPropName,
|
|
40248
40248
|
});
|
|
@@ -40465,7 +40465,7 @@ const padZerosLeft = (num, numDigits) => {
|
|
|
40465
40465
|
const LOG_REVIEW_STATUS_ROUTE = `${ROUTE_PATH_PREFIX}/logs/access_allowed`;
|
|
40466
40466
|
|
|
40467
40467
|
// Stored copy of caccl functions
|
|
40468
|
-
let _cacclGetLaunchInfo
|
|
40468
|
+
let _cacclGetLaunchInfo;
|
|
40469
40469
|
// Stored copy of dce-mango log collection
|
|
40470
40470
|
let _logCollection;
|
|
40471
40471
|
/*------------------------------------------------------------------------*/
|
|
@@ -40477,11 +40477,11 @@ let _logCollection;
|
|
|
40477
40477
|
* @param req express request object
|
|
40478
40478
|
* @returns object { launched, launchInfo }
|
|
40479
40479
|
*/
|
|
40480
|
-
const cacclGetLaunchInfo
|
|
40481
|
-
if (!_cacclGetLaunchInfo
|
|
40482
|
-
throw new ErrorWithCode
|
|
40480
|
+
const cacclGetLaunchInfo = (req) => {
|
|
40481
|
+
if (!_cacclGetLaunchInfo) {
|
|
40482
|
+
throw new ErrorWithCode('Could not get launch info because server was not initialized with dce-reactkit\'s initServer function', ReactKitErrorCode$1.NoCACCLGetLaunchInfoFunction);
|
|
40483
40483
|
}
|
|
40484
|
-
return _cacclGetLaunchInfo
|
|
40484
|
+
return _cacclGetLaunchInfo(req);
|
|
40485
40485
|
};
|
|
40486
40486
|
/**
|
|
40487
40487
|
* Get log collection
|
|
@@ -40513,7 +40513,7 @@ const internalGetLogCollection = () => {
|
|
|
40513
40513
|
* to review logs
|
|
40514
40514
|
*/
|
|
40515
40515
|
const initServer = (opts) => {
|
|
40516
|
-
_cacclGetLaunchInfo
|
|
40516
|
+
_cacclGetLaunchInfo = opts.getLaunchInfo;
|
|
40517
40517
|
_logCollection = opts.logCollection;
|
|
40518
40518
|
/*----------------------------------------*/
|
|
40519
40519
|
/* Logging */
|
|
@@ -40537,18 +40537,18 @@ const initServer = (opts) => {
|
|
|
40537
40537
|
* @param {LogAction} [action] the type of action performed on the target
|
|
40538
40538
|
* @returns {Log}
|
|
40539
40539
|
*/
|
|
40540
|
-
opts.app.post(LOG_ROUTE_PATH, genRouteHandler
|
|
40540
|
+
opts.app.post(LOG_ROUTE_PATH, genRouteHandler({
|
|
40541
40541
|
paramTypes: {
|
|
40542
|
-
context: ParamType$
|
|
40543
|
-
subcontext: ParamType$
|
|
40544
|
-
tags: ParamType$
|
|
40545
|
-
level: ParamType$
|
|
40546
|
-
metadata: ParamType$
|
|
40547
|
-
errorMessage: ParamType$
|
|
40548
|
-
errorCode: ParamType$
|
|
40549
|
-
errorStack: ParamType$
|
|
40550
|
-
target: ParamType$
|
|
40551
|
-
action: ParamType$
|
|
40542
|
+
context: ParamType$1.String,
|
|
40543
|
+
subcontext: ParamType$1.String,
|
|
40544
|
+
tags: ParamType$1.JSON,
|
|
40545
|
+
level: ParamType$1.String,
|
|
40546
|
+
metadata: ParamType$1.JSON,
|
|
40547
|
+
errorMessage: ParamType$1.StringOptional,
|
|
40548
|
+
errorCode: ParamType$1.StringOptional,
|
|
40549
|
+
errorStack: ParamType$1.StringOptional,
|
|
40550
|
+
target: ParamType$1.StringOptional,
|
|
40551
|
+
action: ParamType$1.StringOptional,
|
|
40552
40552
|
},
|
|
40553
40553
|
handler: ({ params, logServerEvent }) => {
|
|
40554
40554
|
// Create log info
|
|
@@ -40594,7 +40594,7 @@ const initServer = (opts) => {
|
|
|
40594
40594
|
* @param isAdmin if true, the user is an admin
|
|
40595
40595
|
* @returns true if the user can review logs
|
|
40596
40596
|
*/
|
|
40597
|
-
const canReviewLogs = (userId, isAdmin) => __awaiter
|
|
40597
|
+
const canReviewLogs = (userId, isAdmin) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40598
40598
|
// Immediately deny access if user is not an admin
|
|
40599
40599
|
if (!isAdmin) {
|
|
40600
40600
|
return false;
|
|
@@ -40626,8 +40626,8 @@ const initServer = (opts) => {
|
|
|
40626
40626
|
* @author Gabe Abrams
|
|
40627
40627
|
* @returns {boolean} true if user has access
|
|
40628
40628
|
*/
|
|
40629
|
-
opts.app.get(LOG_REVIEW_STATUS_ROUTE, genRouteHandler
|
|
40630
|
-
handler: ({ params }) => __awaiter
|
|
40629
|
+
opts.app.get(LOG_REVIEW_STATUS_ROUTE, genRouteHandler({
|
|
40630
|
+
handler: ({ params }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40631
40631
|
const { userId, isAdmin } = params;
|
|
40632
40632
|
const canReview = yield canReviewLogs(userId, isAdmin);
|
|
40633
40633
|
return canReview;
|
|
@@ -40640,18 +40640,18 @@ const initServer = (opts) => {
|
|
|
40640
40640
|
* @param {number} month the month to query (e.g. 1 = January)
|
|
40641
40641
|
* @returns {Log[]} list of logs from the given month
|
|
40642
40642
|
*/
|
|
40643
|
-
opts.app.get(`${LOG_REVIEW_ROUTE_PATH_PREFIX}/years/:year/months/:month`, genRouteHandler
|
|
40643
|
+
opts.app.get(`${LOG_REVIEW_ROUTE_PATH_PREFIX}/years/:year/months/:month`, genRouteHandler({
|
|
40644
40644
|
paramTypes: {
|
|
40645
|
-
year: ParamType$
|
|
40646
|
-
month: ParamType$
|
|
40645
|
+
year: ParamType$1.Int,
|
|
40646
|
+
month: ParamType$1.Int,
|
|
40647
40647
|
},
|
|
40648
|
-
handler: ({ params }) => __awaiter
|
|
40648
|
+
handler: ({ params }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40649
40649
|
// Get user info
|
|
40650
40650
|
const { year, month, userId, isAdmin, } = params;
|
|
40651
40651
|
// Validate user
|
|
40652
40652
|
const canReview = yield canReviewLogs(userId, isAdmin);
|
|
40653
40653
|
if (!canReview) {
|
|
40654
|
-
throw new ErrorWithCode
|
|
40654
|
+
throw new ErrorWithCode('You cannot access this resource because you do not have the appropriate permissions.', ReactKitErrorCode$1.NotAllowedToReviewLogs);
|
|
40655
40655
|
}
|
|
40656
40656
|
// Query for logs
|
|
40657
40657
|
const logs = yield _logCollection.find({
|
|
@@ -40677,7 +40677,7 @@ const initServer = (opts) => {
|
|
|
40677
40677
|
* @param [opts.status=500] the https status code to use
|
|
40678
40678
|
* defined)
|
|
40679
40679
|
*/
|
|
40680
|
-
const handleError
|
|
40680
|
+
const handleError = (res, error) => {
|
|
40681
40681
|
// Get the error message
|
|
40682
40682
|
let message;
|
|
40683
40683
|
if (error && error.message) {
|
|
@@ -40692,7 +40692,7 @@ const handleError$1 = (res, error) => {
|
|
|
40692
40692
|
message = 'An unknown error occurred.';
|
|
40693
40693
|
}
|
|
40694
40694
|
// Get the error code
|
|
40695
|
-
const code = (error.code || ReactKitErrorCode$
|
|
40695
|
+
const code = (error.code || ReactKitErrorCode$1.NoCode);
|
|
40696
40696
|
// Get the status code
|
|
40697
40697
|
const status = (error.status || 500);
|
|
40698
40698
|
// Respond to user
|
|
@@ -40717,7 +40717,7 @@ const handleError$1 = (res, error) => {
|
|
|
40717
40717
|
* @param res express response
|
|
40718
40718
|
* @param body the body of the response to send to the client
|
|
40719
40719
|
*/
|
|
40720
|
-
const handleSuccess
|
|
40720
|
+
const handleSuccess = (res, body) => {
|
|
40721
40721
|
// Send a http 200 json response
|
|
40722
40722
|
res.json({
|
|
40723
40723
|
// Include the body as a parameter
|
|
@@ -40746,7 +40746,7 @@ const genErrorPage = (opts = {}) => {
|
|
|
40746
40746
|
const title = ((_a = opts.title) !== null && _a !== void 0 ? _a : 'An Error Occurred');
|
|
40747
40747
|
const pageTitle = ((_b = opts.pageTitle) !== null && _b !== void 0 ? _b : title);
|
|
40748
40748
|
const description = ((_c = opts.description) !== null && _c !== void 0 ? _c : 'An unknown server error occurred. Please contact support.');
|
|
40749
|
-
const code = ((_d = opts.code) !== null && _d !== void 0 ? _d : ReactKitErrorCode$
|
|
40749
|
+
const code = ((_d = opts.code) !== null && _d !== void 0 ? _d : ReactKitErrorCode$1.NoCode);
|
|
40750
40750
|
return `
|
|
40751
40751
|
<head>
|
|
40752
40752
|
<!-- Metadata -->
|
|
@@ -40983,9 +40983,9 @@ const parseUserAgent = (userAgent) => {
|
|
|
40983
40983
|
* userLastName, isLearner, isTTM, isAdmin, and any other variables that
|
|
40984
40984
|
* are directly added to the session, if the user does have a session.
|
|
40985
40985
|
*/
|
|
40986
|
-
const genRouteHandler
|
|
40986
|
+
const genRouteHandler = (opts) => {
|
|
40987
40987
|
// Return a route handler
|
|
40988
|
-
return (req, res, next) => __awaiter
|
|
40988
|
+
return (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40989
40989
|
var _a, _b;
|
|
40990
40990
|
// Output params
|
|
40991
40991
|
const output = {};
|
|
@@ -41001,17 +41001,17 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41001
41001
|
|| req.query[name]
|
|
41002
41002
|
|| req.body[name]);
|
|
41003
41003
|
// Parse
|
|
41004
|
-
if (type === ParamType$
|
|
41004
|
+
if (type === ParamType$1.Boolean || type === ParamType$1.BooleanOptional) {
|
|
41005
41005
|
// Boolean
|
|
41006
41006
|
// Handle case where value doesn't exist
|
|
41007
41007
|
if (value === undefined) {
|
|
41008
|
-
if (type === ParamType$
|
|
41008
|
+
if (type === ParamType$1.BooleanOptional) {
|
|
41009
41009
|
output[name] = undefined;
|
|
41010
41010
|
}
|
|
41011
41011
|
else {
|
|
41012
|
-
return handleError
|
|
41012
|
+
return handleError(res, {
|
|
41013
41013
|
message: `Parameter ${name} is required, but it was not included.`,
|
|
41014
|
-
code: ReactKitErrorCode$
|
|
41014
|
+
code: ReactKitErrorCode$1.MissingParameter,
|
|
41015
41015
|
status: 422,
|
|
41016
41016
|
});
|
|
41017
41017
|
}
|
|
@@ -41032,17 +41032,17 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41032
41032
|
].indexOf(simpleVal) >= 0);
|
|
41033
41033
|
}
|
|
41034
41034
|
}
|
|
41035
|
-
else if (type === ParamType$
|
|
41035
|
+
else if (type === ParamType$1.Float || type === ParamType$1.FloatOptional) {
|
|
41036
41036
|
// Float
|
|
41037
41037
|
// Handle case where value doesn't exist
|
|
41038
41038
|
if (value === undefined) {
|
|
41039
|
-
if (type === ParamType$
|
|
41039
|
+
if (type === ParamType$1.FloatOptional) {
|
|
41040
41040
|
output[name] = undefined;
|
|
41041
41041
|
}
|
|
41042
41042
|
else {
|
|
41043
|
-
return handleError
|
|
41043
|
+
return handleError(res, {
|
|
41044
41044
|
message: `Parameter ${name} is required, but it was not included.`,
|
|
41045
|
-
code: ReactKitErrorCode$
|
|
41045
|
+
code: ReactKitErrorCode$1.MissingParameter,
|
|
41046
41046
|
status: 422,
|
|
41047
41047
|
});
|
|
41048
41048
|
}
|
|
@@ -41053,24 +41053,24 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41053
41053
|
}
|
|
41054
41054
|
else {
|
|
41055
41055
|
// Issue!
|
|
41056
|
-
return handleError
|
|
41056
|
+
return handleError(res, {
|
|
41057
41057
|
message: `Request data was malformed: ${name} was not a valid float.`,
|
|
41058
|
-
code: ReactKitErrorCode$
|
|
41058
|
+
code: ReactKitErrorCode$1.InvalidParameter,
|
|
41059
41059
|
status: 422,
|
|
41060
41060
|
});
|
|
41061
41061
|
}
|
|
41062
41062
|
}
|
|
41063
|
-
else if (type === ParamType$
|
|
41063
|
+
else if (type === ParamType$1.Int || type === ParamType$1.IntOptional) {
|
|
41064
41064
|
// Int
|
|
41065
41065
|
// Handle case where value doesn't exist
|
|
41066
41066
|
if (value === undefined) {
|
|
41067
|
-
if (type === ParamType$
|
|
41067
|
+
if (type === ParamType$1.IntOptional) {
|
|
41068
41068
|
output[name] = undefined;
|
|
41069
41069
|
}
|
|
41070
41070
|
else {
|
|
41071
|
-
return handleError
|
|
41071
|
+
return handleError(res, {
|
|
41072
41072
|
message: `Parameter ${name} is required, but it was not included.`,
|
|
41073
|
-
code: ReactKitErrorCode$
|
|
41073
|
+
code: ReactKitErrorCode$1.MissingParameter,
|
|
41074
41074
|
status: 422,
|
|
41075
41075
|
});
|
|
41076
41076
|
}
|
|
@@ -41081,24 +41081,24 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41081
41081
|
}
|
|
41082
41082
|
else {
|
|
41083
41083
|
// Issue!
|
|
41084
|
-
return handleError
|
|
41084
|
+
return handleError(res, {
|
|
41085
41085
|
message: `Request data was malformed: ${name} was not a valid int.`,
|
|
41086
|
-
code: ReactKitErrorCode$
|
|
41086
|
+
code: ReactKitErrorCode$1.InvalidParameter,
|
|
41087
41087
|
status: 422,
|
|
41088
41088
|
});
|
|
41089
41089
|
}
|
|
41090
41090
|
}
|
|
41091
|
-
else if (type === ParamType$
|
|
41091
|
+
else if (type === ParamType$1.JSON || type === ParamType$1.JSONOptional) {
|
|
41092
41092
|
// Stringified JSON
|
|
41093
41093
|
// Handle case where value doesn't exist
|
|
41094
41094
|
if (value === undefined) {
|
|
41095
|
-
if (type === ParamType$
|
|
41095
|
+
if (type === ParamType$1.JSONOptional) {
|
|
41096
41096
|
output[name] = undefined;
|
|
41097
41097
|
}
|
|
41098
41098
|
else {
|
|
41099
|
-
return handleError
|
|
41099
|
+
return handleError(res, {
|
|
41100
41100
|
message: `Parameter ${name} is required, but it was not included.`,
|
|
41101
|
-
code: ReactKitErrorCode$
|
|
41101
|
+
code: ReactKitErrorCode$1.MissingParameter,
|
|
41102
41102
|
status: 422,
|
|
41103
41103
|
});
|
|
41104
41104
|
}
|
|
@@ -41110,25 +41110,25 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41110
41110
|
output[name] = JSON.parse(String(value));
|
|
41111
41111
|
}
|
|
41112
41112
|
catch (err) {
|
|
41113
|
-
return handleError
|
|
41113
|
+
return handleError(res, {
|
|
41114
41114
|
message: `Request data was malformed: ${name} was not a valid JSON payload.`,
|
|
41115
|
-
code: ReactKitErrorCode$
|
|
41115
|
+
code: ReactKitErrorCode$1.InvalidParameter,
|
|
41116
41116
|
status: 422,
|
|
41117
41117
|
});
|
|
41118
41118
|
}
|
|
41119
41119
|
}
|
|
41120
41120
|
}
|
|
41121
|
-
else if (type === ParamType$
|
|
41121
|
+
else if (type === ParamType$1.String || type === ParamType$1.StringOptional) {
|
|
41122
41122
|
// String
|
|
41123
41123
|
// Handle case where value doesn't exist
|
|
41124
41124
|
if (value === undefined) {
|
|
41125
|
-
if (type === ParamType$
|
|
41125
|
+
if (type === ParamType$1.StringOptional) {
|
|
41126
41126
|
output[name] = undefined;
|
|
41127
41127
|
}
|
|
41128
41128
|
else {
|
|
41129
|
-
return handleError
|
|
41129
|
+
return handleError(res, {
|
|
41130
41130
|
message: `Parameter ${name} is required, but it was not included.`,
|
|
41131
|
-
code: ReactKitErrorCode$
|
|
41131
|
+
code: ReactKitErrorCode$1.MissingParameter,
|
|
41132
41132
|
status: 422,
|
|
41133
41133
|
});
|
|
41134
41134
|
}
|
|
@@ -41141,9 +41141,9 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41141
41141
|
}
|
|
41142
41142
|
else {
|
|
41143
41143
|
// No valid data type
|
|
41144
|
-
return handleError
|
|
41144
|
+
return handleError(res, {
|
|
41145
41145
|
message: `An internal error occurred: we could not determine the type of ${name}.`,
|
|
41146
|
-
code: ReactKitErrorCode$
|
|
41146
|
+
code: ReactKitErrorCode$1.InvalidParameter,
|
|
41147
41147
|
status: 422,
|
|
41148
41148
|
});
|
|
41149
41149
|
}
|
|
@@ -41152,15 +41152,15 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41152
41152
|
/* Launch Info */
|
|
41153
41153
|
/*----------------------------------------*/
|
|
41154
41154
|
// Get launch info
|
|
41155
|
-
const { launched, launchInfo } = cacclGetLaunchInfo
|
|
41155
|
+
const { launched, launchInfo } = cacclGetLaunchInfo(req);
|
|
41156
41156
|
if (
|
|
41157
41157
|
// Not launched
|
|
41158
41158
|
(!launched || !launchInfo)
|
|
41159
41159
|
// Not skipping the session check
|
|
41160
41160
|
&& !opts.skipSessionCheck) {
|
|
41161
|
-
return handleError
|
|
41161
|
+
return handleError(res, {
|
|
41162
41162
|
message: 'Your session has expired. Please refresh the page and try again.',
|
|
41163
|
-
code: ReactKitErrorCode$
|
|
41163
|
+
code: ReactKitErrorCode$1.SessionExpired,
|
|
41164
41164
|
status: 401,
|
|
41165
41165
|
});
|
|
41166
41166
|
}
|
|
@@ -41178,9 +41178,9 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41178
41178
|
&& !launchInfo.isAdmin))
|
|
41179
41179
|
// Not skipping the session check
|
|
41180
41180
|
&& !opts.skipSessionCheck) {
|
|
41181
|
-
return handleError
|
|
41181
|
+
return handleError(res, {
|
|
41182
41182
|
message: 'Your session was invalid. Please refresh the page and try again.',
|
|
41183
|
-
code: ReactKitErrorCode$
|
|
41183
|
+
code: ReactKitErrorCode$1.SessionExpired,
|
|
41184
41184
|
status: 401,
|
|
41185
41185
|
});
|
|
41186
41186
|
}
|
|
@@ -41237,9 +41237,9 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41237
41237
|
&& !output.isTTM
|
|
41238
41238
|
&& !output.isAdmin) {
|
|
41239
41239
|
// Course of interest is not the launch course
|
|
41240
|
-
return handleError
|
|
41240
|
+
return handleError(res, {
|
|
41241
41241
|
message: 'You switched sessions by opening this app in another tab. Please refresh the page and try again.',
|
|
41242
|
-
code: ReactKitErrorCode$
|
|
41242
|
+
code: ReactKitErrorCode$1.WrongCourse,
|
|
41243
41243
|
status: 401,
|
|
41244
41244
|
});
|
|
41245
41245
|
}
|
|
@@ -41257,9 +41257,9 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41257
41257
|
// User is not an admin
|
|
41258
41258
|
&& !output.isAdmin)) {
|
|
41259
41259
|
// User does not have access
|
|
41260
|
-
return handleError
|
|
41260
|
+
return handleError(res, {
|
|
41261
41261
|
message: 'This action is only allowed if you are a teaching team member for the course. Please go back to Canvas, log in as a teaching team member, and try again.',
|
|
41262
|
-
code: ReactKitErrorCode$
|
|
41262
|
+
code: ReactKitErrorCode$1.NotTTM,
|
|
41263
41263
|
status: 401,
|
|
41264
41264
|
});
|
|
41265
41265
|
}
|
|
@@ -41270,9 +41270,9 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41270
41270
|
// User is not an admin
|
|
41271
41271
|
&& !output.isAdmin) {
|
|
41272
41272
|
// User does not have access
|
|
41273
|
-
return handleError
|
|
41273
|
+
return handleError(res, {
|
|
41274
41274
|
message: 'This action is only allowed if you are a Canvas admin. Please go back to Canvas, log in as an admin, and try again.',
|
|
41275
|
-
code: ReactKitErrorCode$
|
|
41275
|
+
code: ReactKitErrorCode$1.NotAdmin,
|
|
41276
41276
|
status: 401,
|
|
41277
41277
|
});
|
|
41278
41278
|
}
|
|
@@ -41284,7 +41284,7 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41284
41284
|
* Log an event on the server
|
|
41285
41285
|
* @author Gabe Abrams
|
|
41286
41286
|
*/
|
|
41287
|
-
const logServerEvent = (opts) => __awaiter
|
|
41287
|
+
const logServerEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41288
41288
|
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
41289
41289
|
// NOTE: internally, we slip through an opts.overrideAsClientEvent boolean
|
|
41290
41290
|
// that indicates that this is actually a client event, but we don't
|
|
@@ -41328,7 +41328,7 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41328
41328
|
? {
|
|
41329
41329
|
type: LogType$1.Error,
|
|
41330
41330
|
errorMessage: (_j = opts.error.message) !== null && _j !== void 0 ? _j : 'Unknown message',
|
|
41331
|
-
errorCode: (_k = opts.error.code) !== null && _k !== void 0 ? _k : ReactKitErrorCode$
|
|
41331
|
+
errorCode: (_k = opts.error.code) !== null && _k !== void 0 ? _k : ReactKitErrorCode$1.NoCode,
|
|
41332
41332
|
errorStack: (_l = opts.error.stack) !== null && _l !== void 0 ? _l : 'No stack',
|
|
41333
41333
|
}
|
|
41334
41334
|
: {
|
|
@@ -41488,13 +41488,13 @@ const genRouteHandler$1 = (opts) => {
|
|
|
41488
41488
|
});
|
|
41489
41489
|
// Send results to client (only if next wasn't called)
|
|
41490
41490
|
if (!responseSent) {
|
|
41491
|
-
return handleSuccess
|
|
41491
|
+
return handleSuccess(res, results !== null && results !== void 0 ? results : undefined);
|
|
41492
41492
|
}
|
|
41493
41493
|
}
|
|
41494
41494
|
catch (err) {
|
|
41495
41495
|
// Send error to client (only if next wasn't called)
|
|
41496
41496
|
if (!responseSent) {
|
|
41497
|
-
handleError
|
|
41497
|
+
handleError(res, err);
|
|
41498
41498
|
// Log server-side error
|
|
41499
41499
|
logServerEvent({
|
|
41500
41500
|
context: LogBuiltInMetadata.Context.ServerEndpointError,
|
|
@@ -41533,7 +41533,7 @@ const startMinWait = (minWaitMs) => {
|
|
|
41533
41533
|
* Finish the remaining time to wait
|
|
41534
41534
|
* @author Gabe Abrams
|
|
41535
41535
|
*/
|
|
41536
|
-
return () => __awaiter
|
|
41536
|
+
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41537
41537
|
const endTimestamp = Date.now();
|
|
41538
41538
|
// Calculate remaining time to wait
|
|
41539
41539
|
const elapsedTimeMs = (endTimestamp - startTimestamp);
|
|
@@ -41620,7 +41620,7 @@ const onlyKeepLetters = (str) => {
|
|
|
41620
41620
|
* once
|
|
41621
41621
|
* @returns array of resolved values in the same order as the task functions
|
|
41622
41622
|
*/
|
|
41623
|
-
const parallelLimit = (taskFunctions, limit) => __awaiter
|
|
41623
|
+
const parallelLimit = (taskFunctions, limit) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41624
41624
|
const results = [];
|
|
41625
41625
|
// Wait until finished with all tasks
|
|
41626
41626
|
yield new Promise((resolve) => {
|
|
@@ -41631,7 +41631,7 @@ const parallelLimit = (taskFunctions, limit) => __awaiter$1(void 0, void 0, void
|
|
|
41631
41631
|
* Start the next task
|
|
41632
41632
|
* @author Gabe Abrams
|
|
41633
41633
|
*/
|
|
41634
|
-
const startTask = () => __awaiter
|
|
41634
|
+
const startTask = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41635
41635
|
const taskIndex = nextTaskIndex++;
|
|
41636
41636
|
// Get the task
|
|
41637
41637
|
const taskFunction = taskFunctions[taskIndex];
|
|
@@ -41684,7 +41684,7 @@ let canReview = undefined;
|
|
|
41684
41684
|
* @author Gabe Abrams
|
|
41685
41685
|
* @returns true if current user can review logs
|
|
41686
41686
|
*/
|
|
41687
|
-
const canReviewLogs = () => __awaiter
|
|
41687
|
+
const canReviewLogs = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41688
41688
|
// If cached, use that value
|
|
41689
41689
|
if (canReview !== undefined) {
|
|
41690
41690
|
return canReview;
|
|
@@ -41798,649 +41798,6 @@ const getLocalTimeInfo = (dateOrTimestamp) => {
|
|
|
41798
41798
|
};
|
|
41799
41799
|
};
|
|
41800
41800
|
|
|
41801
|
-
/******************************************************************************
|
|
41802
|
-
Copyright (c) Microsoft Corporation.
|
|
41803
|
-
|
|
41804
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
41805
|
-
purpose with or without fee is hereby granted.
|
|
41806
|
-
|
|
41807
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
41808
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
41809
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
41810
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
41811
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
41812
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
41813
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
41814
|
-
***************************************************************************** */
|
|
41815
|
-
|
|
41816
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
41817
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
41818
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41819
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
41820
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41821
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41822
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
41823
|
-
});
|
|
41824
|
-
}
|
|
41825
|
-
|
|
41826
|
-
// Highest error code = DRK10
|
|
41827
|
-
/**
|
|
41828
|
-
* List of error codes built into the react kit
|
|
41829
|
-
* @author Gabe Abrams
|
|
41830
|
-
*/
|
|
41831
|
-
var ReactKitErrorCode;
|
|
41832
|
-
(function (ReactKitErrorCode) {
|
|
41833
|
-
ReactKitErrorCode["NoResponse"] = "DRK1";
|
|
41834
|
-
ReactKitErrorCode["NoCode"] = "DRK2";
|
|
41835
|
-
ReactKitErrorCode["SessionExpired"] = "DRK3";
|
|
41836
|
-
ReactKitErrorCode["MissingParameter"] = "DRK4";
|
|
41837
|
-
ReactKitErrorCode["InvalidParameter"] = "DRK5";
|
|
41838
|
-
ReactKitErrorCode["WrongCourse"] = "DRK6";
|
|
41839
|
-
ReactKitErrorCode["NoCACCLSendRequestFunction"] = "DRK7";
|
|
41840
|
-
ReactKitErrorCode["NoCACCLGetLaunchInfoFunction"] = "DRK8";
|
|
41841
|
-
ReactKitErrorCode["NotTTM"] = "DRK9";
|
|
41842
|
-
ReactKitErrorCode["NotAdmin"] = "DRK10";
|
|
41843
|
-
})(ReactKitErrorCode || (ReactKitErrorCode = {}));
|
|
41844
|
-
var ReactKitErrorCode$1 = ReactKitErrorCode;
|
|
41845
|
-
|
|
41846
|
-
/**
|
|
41847
|
-
* Types of buttons in the modal
|
|
41848
|
-
* @author Gabe Abrams
|
|
41849
|
-
*/
|
|
41850
|
-
var ModalButtonType;
|
|
41851
|
-
(function (ModalButtonType) {
|
|
41852
|
-
ModalButtonType["Okay"] = "okay";
|
|
41853
|
-
ModalButtonType["Cancel"] = "cancel";
|
|
41854
|
-
ModalButtonType["Yes"] = "yes";
|
|
41855
|
-
ModalButtonType["No"] = "no";
|
|
41856
|
-
ModalButtonType["Abandon"] = "abandon";
|
|
41857
|
-
ModalButtonType["GoBack"] = "goBack";
|
|
41858
|
-
ModalButtonType["Continue"] = "continue";
|
|
41859
|
-
ModalButtonType["ImSure"] = "imSure";
|
|
41860
|
-
ModalButtonType["Delete"] = "delete";
|
|
41861
|
-
ModalButtonType["Confirm"] = "confirm";
|
|
41862
|
-
})(ModalButtonType || (ModalButtonType = {}));
|
|
41863
|
-
var ModalButtonType$1 = ModalButtonType;
|
|
41864
|
-
|
|
41865
|
-
/**
|
|
41866
|
-
* Types of modals
|
|
41867
|
-
* @author Gabe Abrams
|
|
41868
|
-
*/
|
|
41869
|
-
var ModalType;
|
|
41870
|
-
(function (ModalType) {
|
|
41871
|
-
ModalType["Okay"] = "okay";
|
|
41872
|
-
ModalType["OkayCancel"] = "okay-cancel";
|
|
41873
|
-
ModalType["YesNo"] = "yes-no";
|
|
41874
|
-
ModalType["YesNoCancel"] = "yes-no-cancel";
|
|
41875
|
-
ModalType["AbandonGoBack"] = "abandon-goBack";
|
|
41876
|
-
ModalType["ImSureCancel"] = "imSure-cancel";
|
|
41877
|
-
ModalType["DeleteCancel"] = "delete-cancel";
|
|
41878
|
-
ModalType["ConfirmCancel"] = "confirm-cancel";
|
|
41879
|
-
ModalType["NoButtons"] = "-";
|
|
41880
|
-
})(ModalType || (ModalType = {}));
|
|
41881
|
-
var ModalType$1 = ModalType;
|
|
41882
|
-
|
|
41883
|
-
/**
|
|
41884
|
-
* Bootstrap variants
|
|
41885
|
-
* @author Gabe Abrams
|
|
41886
|
-
*/
|
|
41887
|
-
var Variant;
|
|
41888
|
-
(function (Variant) {
|
|
41889
|
-
Variant["Primary"] = "primary";
|
|
41890
|
-
Variant["Secondary"] = "secondary";
|
|
41891
|
-
Variant["Success"] = "success";
|
|
41892
|
-
Variant["Warning"] = "warning";
|
|
41893
|
-
Variant["Info"] = "info";
|
|
41894
|
-
Variant["Danger"] = "danger";
|
|
41895
|
-
Variant["Light"] = "light";
|
|
41896
|
-
Variant["Dark"] = "dark";
|
|
41897
|
-
})(Variant || (Variant = {}));
|
|
41898
|
-
var Variant$1 = Variant;
|
|
41899
|
-
|
|
41900
|
-
/**
|
|
41901
|
-
* Modal sizes
|
|
41902
|
-
* @author Gabe Abrams
|
|
41903
|
-
*/
|
|
41904
|
-
var ModalSize;
|
|
41905
|
-
(function (ModalSize) {
|
|
41906
|
-
ModalSize["Small"] = "sm";
|
|
41907
|
-
ModalSize["Medium"] = "md";
|
|
41908
|
-
ModalSize["Large"] = "lg";
|
|
41909
|
-
ModalSize["ExtraLarge"] = "xl";
|
|
41910
|
-
})(ModalSize || (ModalSize = {}));
|
|
41911
|
-
// Modal type to list of buttons
|
|
41912
|
-
({
|
|
41913
|
-
[ModalType$1.Okay]: [
|
|
41914
|
-
ModalButtonType$1.Okay,
|
|
41915
|
-
],
|
|
41916
|
-
[ModalType$1.OkayCancel]: [
|
|
41917
|
-
ModalButtonType$1.Okay,
|
|
41918
|
-
ModalButtonType$1.Cancel,
|
|
41919
|
-
],
|
|
41920
|
-
[ModalType$1.YesNo]: [
|
|
41921
|
-
ModalButtonType$1.Yes,
|
|
41922
|
-
ModalButtonType$1.No,
|
|
41923
|
-
],
|
|
41924
|
-
[ModalType$1.YesNoCancel]: [
|
|
41925
|
-
ModalButtonType$1.Yes,
|
|
41926
|
-
ModalButtonType$1.No,
|
|
41927
|
-
ModalButtonType$1.Cancel,
|
|
41928
|
-
],
|
|
41929
|
-
[ModalType$1.AbandonGoBack]: [
|
|
41930
|
-
ModalButtonType$1.Abandon,
|
|
41931
|
-
ModalButtonType$1.GoBack,
|
|
41932
|
-
],
|
|
41933
|
-
[ModalType$1.ImSureCancel]: [
|
|
41934
|
-
ModalButtonType$1.ImSure,
|
|
41935
|
-
ModalButtonType$1.Cancel,
|
|
41936
|
-
],
|
|
41937
|
-
[ModalType$1.DeleteCancel]: [
|
|
41938
|
-
ModalButtonType$1.Delete,
|
|
41939
|
-
ModalButtonType$1.Cancel,
|
|
41940
|
-
],
|
|
41941
|
-
[ModalType$1.ConfirmCancel]: [
|
|
41942
|
-
ModalButtonType$1.Confirm,
|
|
41943
|
-
ModalButtonType$1.Cancel,
|
|
41944
|
-
],
|
|
41945
|
-
});
|
|
41946
|
-
// Button type styling and labels
|
|
41947
|
-
({
|
|
41948
|
-
[ModalButtonType$1.Okay]: {
|
|
41949
|
-
label: 'Okay',
|
|
41950
|
-
variant: Variant$1.Dark,
|
|
41951
|
-
},
|
|
41952
|
-
[ModalButtonType$1.Cancel]: {
|
|
41953
|
-
label: 'Cancel',
|
|
41954
|
-
variant: Variant$1.Secondary,
|
|
41955
|
-
},
|
|
41956
|
-
[ModalButtonType$1.Yes]: {
|
|
41957
|
-
label: 'Yes',
|
|
41958
|
-
variant: Variant$1.Dark,
|
|
41959
|
-
},
|
|
41960
|
-
[ModalButtonType$1.No]: {
|
|
41961
|
-
label: 'No',
|
|
41962
|
-
variant: Variant$1.Secondary,
|
|
41963
|
-
},
|
|
41964
|
-
[ModalButtonType$1.Abandon]: {
|
|
41965
|
-
label: 'Abandon Changes',
|
|
41966
|
-
variant: Variant$1.Warning,
|
|
41967
|
-
},
|
|
41968
|
-
[ModalButtonType$1.GoBack]: {
|
|
41969
|
-
label: 'Go Back',
|
|
41970
|
-
variant: Variant$1.Secondary,
|
|
41971
|
-
},
|
|
41972
|
-
[ModalButtonType$1.Continue]: {
|
|
41973
|
-
label: 'Continue',
|
|
41974
|
-
variant: Variant$1.Dark,
|
|
41975
|
-
},
|
|
41976
|
-
[ModalButtonType$1.ImSure]: {
|
|
41977
|
-
label: 'I am sure',
|
|
41978
|
-
variant: Variant$1.Warning,
|
|
41979
|
-
},
|
|
41980
|
-
[ModalButtonType$1.Delete]: {
|
|
41981
|
-
label: 'Yes, Delete',
|
|
41982
|
-
variant: Variant$1.Danger,
|
|
41983
|
-
},
|
|
41984
|
-
[ModalButtonType$1.Confirm]: {
|
|
41985
|
-
label: 'Confirm',
|
|
41986
|
-
variant: Variant$1.Dark,
|
|
41987
|
-
},
|
|
41988
|
-
});
|
|
41989
|
-
|
|
41990
|
-
/**
|
|
41991
|
-
* An error with a code
|
|
41992
|
-
* @author Gabe Abrams
|
|
41993
|
-
*/
|
|
41994
|
-
class ErrorWithCode extends Error {
|
|
41995
|
-
constructor(message, code) {
|
|
41996
|
-
super(message);
|
|
41997
|
-
this.name = 'ErrorWithCode';
|
|
41998
|
-
this.code = code;
|
|
41999
|
-
}
|
|
42000
|
-
}
|
|
42001
|
-
|
|
42002
|
-
/**
|
|
42003
|
-
* Copiable text box
|
|
42004
|
-
* @author Gabe Abrams
|
|
42005
|
-
*/
|
|
42006
|
-
/* ------------- Actions ------------ */
|
|
42007
|
-
// Types of actions
|
|
42008
|
-
var ActionType$1;
|
|
42009
|
-
(function (ActionType) {
|
|
42010
|
-
// Indicate that the text was recently copied
|
|
42011
|
-
ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
|
|
42012
|
-
// Clear the status
|
|
42013
|
-
ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
|
|
42014
|
-
})(ActionType$1 || (ActionType$1 = {}));
|
|
42015
|
-
|
|
42016
|
-
/**
|
|
42017
|
-
* Reusable nested item picker
|
|
42018
|
-
* @author Yuen Ler Chow
|
|
42019
|
-
*/
|
|
42020
|
-
/* ------------- Actions ------------ */
|
|
42021
|
-
// Types of actions
|
|
42022
|
-
var ActionType;
|
|
42023
|
-
(function (ActionType) {
|
|
42024
|
-
// Toggle whether the children are being shown
|
|
42025
|
-
ActionType["ToggleItems"] = "toggle-items";
|
|
42026
|
-
})(ActionType || (ActionType = {}));
|
|
42027
|
-
|
|
42028
|
-
// Import custom error
|
|
42029
|
-
// Stored copy of caccl functions
|
|
42030
|
-
let _cacclGetLaunchInfo;
|
|
42031
|
-
/*------------------------------------------------------------------------*/
|
|
42032
|
-
/* Helpers */
|
|
42033
|
-
/*------------------------------------------------------------------------*/
|
|
42034
|
-
/**
|
|
42035
|
-
* Get launch info via CACCL
|
|
42036
|
-
* @author Gabe Abrams
|
|
42037
|
-
* @param req express request object
|
|
42038
|
-
* @returns object { launched, launchInfo }
|
|
42039
|
-
*/
|
|
42040
|
-
const cacclGetLaunchInfo = (req) => {
|
|
42041
|
-
{
|
|
42042
|
-
throw new ErrorWithCode('Could not get launch info because server was not initialized with dce-reactkit\'s initServer function', ReactKitErrorCode$1.NoCACCLGetLaunchInfoFunction);
|
|
42043
|
-
}
|
|
42044
|
-
};
|
|
42045
|
-
|
|
42046
|
-
/**
|
|
42047
|
-
* Server-side API param types
|
|
42048
|
-
* @author Gabe Abrams
|
|
42049
|
-
*/
|
|
42050
|
-
var ParamType;
|
|
42051
|
-
(function (ParamType) {
|
|
42052
|
-
ParamType["Boolean"] = "boolean";
|
|
42053
|
-
ParamType["BooleanOptional"] = "boolean-optional";
|
|
42054
|
-
ParamType["Float"] = "float";
|
|
42055
|
-
ParamType["FloatOptional"] = "float-optional";
|
|
42056
|
-
ParamType["Int"] = "int";
|
|
42057
|
-
ParamType["IntOptional"] = "int-optional";
|
|
42058
|
-
ParamType["JSON"] = "json";
|
|
42059
|
-
ParamType["JSONOptional"] = "json-optional";
|
|
42060
|
-
ParamType["String"] = "string";
|
|
42061
|
-
ParamType["StringOptional"] = "string-optional";
|
|
42062
|
-
})(ParamType || (ParamType = {}));
|
|
42063
|
-
var ParamType$1 = ParamType;
|
|
42064
|
-
|
|
42065
|
-
// Import shared types
|
|
42066
|
-
/**
|
|
42067
|
-
* Handle an error and respond to the client
|
|
42068
|
-
* @author Gabe Abrams
|
|
42069
|
-
* @param res express response
|
|
42070
|
-
* @param error error info
|
|
42071
|
-
* @param opts.err the error to send to the client
|
|
42072
|
-
* or the error message
|
|
42073
|
-
* @param [opts.code] an error code (only used if err.code is not
|
|
42074
|
-
* included)
|
|
42075
|
-
* @param [opts.status=500] the https status code to use
|
|
42076
|
-
* defined)
|
|
42077
|
-
*/
|
|
42078
|
-
const handleError = (res, error) => {
|
|
42079
|
-
// Get the error message
|
|
42080
|
-
let message;
|
|
42081
|
-
if (error && error.message) {
|
|
42082
|
-
message = (error.message || 'An unknown error occurred.');
|
|
42083
|
-
}
|
|
42084
|
-
else if (typeof error === 'string') {
|
|
42085
|
-
message = (error.trim().length > 0
|
|
42086
|
-
? error
|
|
42087
|
-
: 'An unknown error occurred.');
|
|
42088
|
-
}
|
|
42089
|
-
else {
|
|
42090
|
-
message = 'An unknown error occurred.';
|
|
42091
|
-
}
|
|
42092
|
-
// Get the error code
|
|
42093
|
-
const code = (error.code || ReactKitErrorCode$1.NoCode);
|
|
42094
|
-
// Get the status code
|
|
42095
|
-
const status = (error.status || 500);
|
|
42096
|
-
// Respond to user
|
|
42097
|
-
res
|
|
42098
|
-
// Set the http status code
|
|
42099
|
-
.status(status)
|
|
42100
|
-
// Send a JSON response
|
|
42101
|
-
.json({
|
|
42102
|
-
// Error message
|
|
42103
|
-
message,
|
|
42104
|
-
// Error code
|
|
42105
|
-
code,
|
|
42106
|
-
// Success = false flag so client can detect server-side errors
|
|
42107
|
-
success: false,
|
|
42108
|
-
});
|
|
42109
|
-
return undefined;
|
|
42110
|
-
};
|
|
42111
|
-
|
|
42112
|
-
/**
|
|
42113
|
-
* Send successful API response
|
|
42114
|
-
* @author Gabe Abrams
|
|
42115
|
-
* @param res express response
|
|
42116
|
-
* @param body the body of the response to send to the client
|
|
42117
|
-
*/
|
|
42118
|
-
const handleSuccess = (res, body) => {
|
|
42119
|
-
// Send a http 200 json response
|
|
42120
|
-
res.json({
|
|
42121
|
-
// Include the body as a parameter
|
|
42122
|
-
body,
|
|
42123
|
-
// Success = true flag so client can detect successful responses
|
|
42124
|
-
success: true,
|
|
42125
|
-
});
|
|
42126
|
-
return undefined;
|
|
42127
|
-
};
|
|
42128
|
-
|
|
42129
|
-
/**
|
|
42130
|
-
* Generate an express API route handler
|
|
42131
|
-
* @author Gabe Abrams
|
|
42132
|
-
* @param opts object containing all arguments
|
|
42133
|
-
* @param opts.paramTypes map containing the types for each parameter that is
|
|
42134
|
-
* included in the request (map: param name => type)
|
|
42135
|
-
* @param opts.handler function that processes the request
|
|
42136
|
-
* @returns express route handler that takes the following arguments:
|
|
42137
|
-
* params (map: param name => value), handleSuccess (function for handling
|
|
42138
|
-
* successful requests), handleError (function for handling failed requests),
|
|
42139
|
-
* req (express request object), res (express response object),
|
|
42140
|
-
* next (express next function). Params also has userId, userFirstName,
|
|
42141
|
-
* userLastName, isLearner, isTTM, isAdmin, and any other variables that
|
|
42142
|
-
* are directly added to the session
|
|
42143
|
-
*/
|
|
42144
|
-
const genRouteHandler = (opts) => {
|
|
42145
|
-
// Return a route handler
|
|
42146
|
-
return (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42147
|
-
var _a, _b;
|
|
42148
|
-
// Output params
|
|
42149
|
-
const output = {};
|
|
42150
|
-
/*----------------------------------------*/
|
|
42151
|
-
/* Parse Params */
|
|
42152
|
-
/*----------------------------------------*/
|
|
42153
|
-
// Process items one by one
|
|
42154
|
-
const paramList = Object.entries((_a = opts.paramTypes) !== null && _a !== void 0 ? _a : {});
|
|
42155
|
-
for (let i = 0; i < paramList.length; i++) {
|
|
42156
|
-
const [name, type] = paramList[i];
|
|
42157
|
-
// Find the value as a string
|
|
42158
|
-
const value = (req.params[name]
|
|
42159
|
-
|| req.query[name]
|
|
42160
|
-
|| req.body[name]);
|
|
42161
|
-
// Parse
|
|
42162
|
-
if (type === ParamType$1.Boolean || type === ParamType$1.BooleanOptional) {
|
|
42163
|
-
// Boolean
|
|
42164
|
-
// Handle case where value doesn't exist
|
|
42165
|
-
if (value === undefined) {
|
|
42166
|
-
if (type === ParamType$1.BooleanOptional) {
|
|
42167
|
-
output[name] = undefined;
|
|
42168
|
-
}
|
|
42169
|
-
else {
|
|
42170
|
-
return handleError(res, {
|
|
42171
|
-
message: `Parameter ${name} is required, but it was not included.`,
|
|
42172
|
-
code: ReactKitErrorCode$1.MissingParameter,
|
|
42173
|
-
status: 422,
|
|
42174
|
-
});
|
|
42175
|
-
}
|
|
42176
|
-
}
|
|
42177
|
-
else {
|
|
42178
|
-
// Value exists
|
|
42179
|
-
// Simplify value
|
|
42180
|
-
const simpleVal = (String(value)
|
|
42181
|
-
.trim()
|
|
42182
|
-
.toLowerCase());
|
|
42183
|
-
// Parse
|
|
42184
|
-
output[name] = ([
|
|
42185
|
-
'true',
|
|
42186
|
-
'yes',
|
|
42187
|
-
'y',
|
|
42188
|
-
'1',
|
|
42189
|
-
't',
|
|
42190
|
-
].indexOf(simpleVal) >= 0);
|
|
42191
|
-
}
|
|
42192
|
-
}
|
|
42193
|
-
else if (type === ParamType$1.Float || type === ParamType$1.FloatOptional) {
|
|
42194
|
-
// Float
|
|
42195
|
-
// Handle case where value doesn't exist
|
|
42196
|
-
if (value === undefined) {
|
|
42197
|
-
if (type === ParamType$1.FloatOptional) {
|
|
42198
|
-
output[name] = undefined;
|
|
42199
|
-
}
|
|
42200
|
-
else {
|
|
42201
|
-
return handleError(res, {
|
|
42202
|
-
message: `Parameter ${name} is required, but it was not included.`,
|
|
42203
|
-
code: ReactKitErrorCode$1.MissingParameter,
|
|
42204
|
-
status: 422,
|
|
42205
|
-
});
|
|
42206
|
-
}
|
|
42207
|
-
}
|
|
42208
|
-
else if (!Number.isNaN(Number.parseFloat(String(value)))) {
|
|
42209
|
-
// Value is a number
|
|
42210
|
-
output[name] = Number.parseFloat(String(value));
|
|
42211
|
-
}
|
|
42212
|
-
else {
|
|
42213
|
-
// Issue!
|
|
42214
|
-
return handleError(res, {
|
|
42215
|
-
message: `Request data was malformed: ${name} was not a valid float.`,
|
|
42216
|
-
code: ReactKitErrorCode$1.InvalidParameter,
|
|
42217
|
-
status: 422,
|
|
42218
|
-
});
|
|
42219
|
-
}
|
|
42220
|
-
}
|
|
42221
|
-
else if (type === ParamType$1.Int || type === ParamType$1.IntOptional) {
|
|
42222
|
-
// Int
|
|
42223
|
-
// Handle case where value doesn't exist
|
|
42224
|
-
if (value === undefined) {
|
|
42225
|
-
if (type === ParamType$1.IntOptional) {
|
|
42226
|
-
output[name] = undefined;
|
|
42227
|
-
}
|
|
42228
|
-
else {
|
|
42229
|
-
return handleError(res, {
|
|
42230
|
-
message: `Parameter ${name} is required, but it was not included.`,
|
|
42231
|
-
code: ReactKitErrorCode$1.MissingParameter,
|
|
42232
|
-
status: 422,
|
|
42233
|
-
});
|
|
42234
|
-
}
|
|
42235
|
-
}
|
|
42236
|
-
else if (!Number.isNaN(Number.parseInt(String(value), 10))) {
|
|
42237
|
-
// Value is a number
|
|
42238
|
-
output[name] = Number.parseInt(String(value), 10);
|
|
42239
|
-
}
|
|
42240
|
-
else {
|
|
42241
|
-
// Issue!
|
|
42242
|
-
return handleError(res, {
|
|
42243
|
-
message: `Request data was malformed: ${name} was not a valid int.`,
|
|
42244
|
-
code: ReactKitErrorCode$1.InvalidParameter,
|
|
42245
|
-
status: 422,
|
|
42246
|
-
});
|
|
42247
|
-
}
|
|
42248
|
-
}
|
|
42249
|
-
else if (type === ParamType$1.JSON || type === ParamType$1.JSONOptional) {
|
|
42250
|
-
// Stringified JSON
|
|
42251
|
-
// Handle case where value doesn't exist
|
|
42252
|
-
if (value === undefined) {
|
|
42253
|
-
if (type === ParamType$1.JSONOptional) {
|
|
42254
|
-
output[name] = undefined;
|
|
42255
|
-
}
|
|
42256
|
-
else {
|
|
42257
|
-
return handleError(res, {
|
|
42258
|
-
message: `Parameter ${name} is required, but it was not included.`,
|
|
42259
|
-
code: ReactKitErrorCode$1.MissingParameter,
|
|
42260
|
-
status: 422,
|
|
42261
|
-
});
|
|
42262
|
-
}
|
|
42263
|
-
}
|
|
42264
|
-
else {
|
|
42265
|
-
// Value exists
|
|
42266
|
-
// Parse
|
|
42267
|
-
try {
|
|
42268
|
-
output[name] = JSON.parse(String(value));
|
|
42269
|
-
}
|
|
42270
|
-
catch (err) {
|
|
42271
|
-
return handleError(res, {
|
|
42272
|
-
message: `Request data was malformed: ${name} was not a valid JSON payload.`,
|
|
42273
|
-
code: ReactKitErrorCode$1.InvalidParameter,
|
|
42274
|
-
status: 422,
|
|
42275
|
-
});
|
|
42276
|
-
}
|
|
42277
|
-
}
|
|
42278
|
-
}
|
|
42279
|
-
else if (type === ParamType$1.String || type === ParamType$1.StringOptional) {
|
|
42280
|
-
// String
|
|
42281
|
-
// Handle case where value doesn't exist
|
|
42282
|
-
if (value === undefined) {
|
|
42283
|
-
if (type === ParamType$1.StringOptional) {
|
|
42284
|
-
output[name] = undefined;
|
|
42285
|
-
}
|
|
42286
|
-
else {
|
|
42287
|
-
return handleError(res, {
|
|
42288
|
-
message: `Parameter ${name} is required, but it was not included.`,
|
|
42289
|
-
code: ReactKitErrorCode$1.MissingParameter,
|
|
42290
|
-
status: 422,
|
|
42291
|
-
});
|
|
42292
|
-
}
|
|
42293
|
-
}
|
|
42294
|
-
else {
|
|
42295
|
-
// Value exists
|
|
42296
|
-
// Leave as is
|
|
42297
|
-
output[name] = value;
|
|
42298
|
-
}
|
|
42299
|
-
}
|
|
42300
|
-
else {
|
|
42301
|
-
// No valid data type
|
|
42302
|
-
return handleError(res, {
|
|
42303
|
-
message: `An internal error occurred: we could not determine the type of ${name}.`,
|
|
42304
|
-
code: ReactKitErrorCode$1.InvalidParameter,
|
|
42305
|
-
status: 422,
|
|
42306
|
-
});
|
|
42307
|
-
}
|
|
42308
|
-
}
|
|
42309
|
-
/*----------------------------------------*/
|
|
42310
|
-
/* Launch Info */
|
|
42311
|
-
/*----------------------------------------*/
|
|
42312
|
-
// Get launch info
|
|
42313
|
-
const { launched, launchInfo } = cacclGetLaunchInfo(req);
|
|
42314
|
-
if (!launched || !launchInfo) {
|
|
42315
|
-
return handleError(res, {
|
|
42316
|
-
message: 'Your session has expired. Please refresh the page and try again.',
|
|
42317
|
-
code: ReactKitErrorCode$1.SessionExpired,
|
|
42318
|
-
status: 440,
|
|
42319
|
-
});
|
|
42320
|
-
}
|
|
42321
|
-
// Error if user info cannot be found
|
|
42322
|
-
if (!launchInfo.userId
|
|
42323
|
-
|| !launchInfo.userFirstName
|
|
42324
|
-
|| !launchInfo.userLastName
|
|
42325
|
-
|| (launchInfo.notInCourse
|
|
42326
|
-
&& !launchInfo.isAdmin)
|
|
42327
|
-
|| (!launchInfo.isTTM
|
|
42328
|
-
&& !launchInfo.isLearner
|
|
42329
|
-
&& !launchInfo.isAdmin)) {
|
|
42330
|
-
return handleError(res, {
|
|
42331
|
-
message: 'Your session was invalid. Please refresh the page and try again.',
|
|
42332
|
-
code: ReactKitErrorCode$1.SessionExpired,
|
|
42333
|
-
status: 440,
|
|
42334
|
-
});
|
|
42335
|
-
}
|
|
42336
|
-
// Add launch info to output
|
|
42337
|
-
output.userId = launchInfo.userId;
|
|
42338
|
-
output.userFirstName = launchInfo.userFirstName;
|
|
42339
|
-
output.userLastName = launchInfo.userLastName;
|
|
42340
|
-
output.userEmail = launchInfo.userEmail;
|
|
42341
|
-
output.isLearner = !!launchInfo.isLearner;
|
|
42342
|
-
output.isTTM = !!launchInfo.isTTM;
|
|
42343
|
-
output.isAdmin = !!launchInfo.isAdmin;
|
|
42344
|
-
output.courseId = ((_b = output.courseId) !== null && _b !== void 0 ? _b : launchInfo.courseId);
|
|
42345
|
-
output.courseName = launchInfo.contextLabel;
|
|
42346
|
-
// Add other session variables
|
|
42347
|
-
Object.keys(req.session).forEach((propName) => {
|
|
42348
|
-
// Skip if prop already in output
|
|
42349
|
-
if (output[propName] !== undefined) {
|
|
42350
|
-
return;
|
|
42351
|
-
}
|
|
42352
|
-
// Add to output
|
|
42353
|
-
const value = req.session[propName];
|
|
42354
|
-
if (typeof value === 'string'
|
|
42355
|
-
|| typeof value === 'boolean'
|
|
42356
|
-
|| typeof value === 'number') {
|
|
42357
|
-
output[propName] = value;
|
|
42358
|
-
}
|
|
42359
|
-
});
|
|
42360
|
-
/*----------------------------------------*/
|
|
42361
|
-
/* Require Course Consistency */
|
|
42362
|
-
/*----------------------------------------*/
|
|
42363
|
-
// Make sure the user actually launched from the appropriate course
|
|
42364
|
-
if (output.courseId
|
|
42365
|
-
&& launchInfo.courseId
|
|
42366
|
-
&& output.courseId !== launchInfo.courseId
|
|
42367
|
-
&& !output.isTTM
|
|
42368
|
-
&& !output.isAdmin) {
|
|
42369
|
-
// Course of interest is not the launch course
|
|
42370
|
-
return handleError(res, {
|
|
42371
|
-
message: 'You switched sessions by opening this app in another tab. Please refresh the page and try again.',
|
|
42372
|
-
code: ReactKitErrorCode$1.WrongCourse,
|
|
42373
|
-
status: 401,
|
|
42374
|
-
});
|
|
42375
|
-
}
|
|
42376
|
-
/*----------------------------------------*/
|
|
42377
|
-
/* Require Proper Permissions */
|
|
42378
|
-
/*----------------------------------------*/
|
|
42379
|
-
// Add TTM endpoint security
|
|
42380
|
-
if (
|
|
42381
|
-
// This is a TTM endpoint
|
|
42382
|
-
req.path.startsWith('/api/ttm')
|
|
42383
|
-
// User is not a TTM
|
|
42384
|
-
&& (
|
|
42385
|
-
// User is not a TTM
|
|
42386
|
-
!output.isTTM
|
|
42387
|
-
// User is not an admin
|
|
42388
|
-
&& !output.isAdmin)) {
|
|
42389
|
-
// User does not have access
|
|
42390
|
-
return handleError(res, {
|
|
42391
|
-
message: 'This action is only allowed if you are a teaching team member for the course. Please go back to Canvas, log in as a teaching team member, and try again.',
|
|
42392
|
-
code: ReactKitErrorCode$1.NotTTM,
|
|
42393
|
-
status: 401,
|
|
42394
|
-
});
|
|
42395
|
-
}
|
|
42396
|
-
// Add Admin endpoint security
|
|
42397
|
-
if (
|
|
42398
|
-
// This is an admin endpoint
|
|
42399
|
-
req.path.startsWith('/api/admin')
|
|
42400
|
-
// User is not an admin
|
|
42401
|
-
&& !output.isAdmin) {
|
|
42402
|
-
// User does not have access
|
|
42403
|
-
return handleError(res, {
|
|
42404
|
-
message: 'This action is only allowed if you are a Canvas admin. Please go back to Canvas, log in as an admin, and try again.',
|
|
42405
|
-
code: ReactKitErrorCode$1.NotAdmin,
|
|
42406
|
-
status: 401,
|
|
42407
|
-
});
|
|
42408
|
-
}
|
|
42409
|
-
/*------------------------------------------------------------------------*/
|
|
42410
|
-
/* Call handler */
|
|
42411
|
-
/*------------------------------------------------------------------------*/
|
|
42412
|
-
try {
|
|
42413
|
-
const results = yield opts.handler({
|
|
42414
|
-
params: output,
|
|
42415
|
-
req,
|
|
42416
|
-
res,
|
|
42417
|
-
next,
|
|
42418
|
-
});
|
|
42419
|
-
// Send results to client
|
|
42420
|
-
handleSuccess(res, results !== null && results !== void 0 ? results : undefined);
|
|
42421
|
-
}
|
|
42422
|
-
catch (err) {
|
|
42423
|
-
// Send error to client
|
|
42424
|
-
handleError(res, err);
|
|
42425
|
-
}
|
|
42426
|
-
});
|
|
42427
|
-
};
|
|
42428
|
-
|
|
42429
|
-
/**
|
|
42430
|
-
* Days of the week
|
|
42431
|
-
* @author Gabe Abrams
|
|
42432
|
-
*/
|
|
42433
|
-
var DayOfWeek$2;
|
|
42434
|
-
(function (DayOfWeek) {
|
|
42435
|
-
DayOfWeek["Monday"] = "m";
|
|
42436
|
-
DayOfWeek["Tuesday"] = "t";
|
|
42437
|
-
DayOfWeek["Wednesday"] = "w";
|
|
42438
|
-
DayOfWeek["Thursday"] = "r";
|
|
42439
|
-
DayOfWeek["Friday"] = "f";
|
|
42440
|
-
DayOfWeek["Saturday"] = "s";
|
|
42441
|
-
DayOfWeek["Sunday"] = "u";
|
|
42442
|
-
})(DayOfWeek$2 || (DayOfWeek$2 = {}));
|
|
42443
|
-
|
|
42444
41801
|
/**
|
|
42445
41802
|
* Add all routes for the DBEditor
|
|
42446
41803
|
* @author Yuen Ler Chow
|
|
@@ -42461,7 +41818,7 @@ const addDBEditorEndpoints = (opts) => {
|
|
|
42461
41818
|
paramTypes: {
|
|
42462
41819
|
filterQuery: ParamType$1.JSONOptional,
|
|
42463
41820
|
},
|
|
42464
|
-
handler: ({ params }) => __awaiter
|
|
41821
|
+
handler: ({ params }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42465
41822
|
var _a;
|
|
42466
41823
|
const filterQuery = (_a = params.filterQuery) !== null && _a !== void 0 ? _a : {};
|
|
42467
41824
|
const categories = yield collection.find(filterQuery);
|
|
@@ -42477,7 +41834,7 @@ const addDBEditorEndpoints = (opts) => {
|
|
|
42477
41834
|
paramTypes: {
|
|
42478
41835
|
item: ParamType$1.JSON,
|
|
42479
41836
|
},
|
|
42480
|
-
handler: ({ params, }) => __awaiter
|
|
41837
|
+
handler: ({ params, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42481
41838
|
// Destructure params
|
|
42482
41839
|
const { item, } = params;
|
|
42483
41840
|
yield collection.insert(item);
|
|
@@ -42491,7 +41848,7 @@ const addDBEditorEndpoints = (opts) => {
|
|
|
42491
41848
|
paramTypes: {
|
|
42492
41849
|
id: ParamType$1.String,
|
|
42493
41850
|
},
|
|
42494
|
-
handler: ({ params, }) => __awaiter
|
|
41851
|
+
handler: ({ params, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42495
41852
|
// Destructure params
|
|
42496
41853
|
const { id, } = params;
|
|
42497
41854
|
yield collection.delete({ id });
|
|
@@ -42527,7 +41884,7 @@ exports.DayOfWeek = DayOfWeek$1;
|
|
|
42527
41884
|
exports.Drawer = Drawer;
|
|
42528
41885
|
exports.DynamicWord = DynamicWord;
|
|
42529
41886
|
exports.ErrorBox = ErrorBox;
|
|
42530
|
-
exports.ErrorWithCode = ErrorWithCode
|
|
41887
|
+
exports.ErrorWithCode = ErrorWithCode;
|
|
42531
41888
|
exports.HOUR_IN_MS = HOUR_IN_MS;
|
|
42532
41889
|
exports.IntelliTable = IntelliTable;
|
|
42533
41890
|
exports.ItemPicker = ItemPicker;
|
|
@@ -42539,18 +41896,18 @@ exports.LogSource = LogSource$1;
|
|
|
42539
41896
|
exports.LogType = LogType$1;
|
|
42540
41897
|
exports.MINUTE_IN_MS = MINUTE_IN_MS;
|
|
42541
41898
|
exports.Modal = Modal;
|
|
42542
|
-
exports.ModalButtonType = ModalButtonType$
|
|
42543
|
-
exports.ModalSize = ModalSize$
|
|
42544
|
-
exports.ModalType = ModalType$
|
|
42545
|
-
exports.ParamType = ParamType$
|
|
41899
|
+
exports.ModalButtonType = ModalButtonType$1;
|
|
41900
|
+
exports.ModalSize = ModalSize$1;
|
|
41901
|
+
exports.ModalType = ModalType$1;
|
|
41902
|
+
exports.ParamType = ParamType$1;
|
|
42546
41903
|
exports.PopFailureMark = PopFailureMark;
|
|
42547
41904
|
exports.PopPendingMark = PopPendingMark;
|
|
42548
41905
|
exports.PopSuccessMark = PopSuccessMark;
|
|
42549
41906
|
exports.RadioButton = RadioButton;
|
|
42550
|
-
exports.ReactKitErrorCode = ReactKitErrorCode$
|
|
41907
|
+
exports.ReactKitErrorCode = ReactKitErrorCode$1;
|
|
42551
41908
|
exports.SimpleDateChooser = SimpleDateChooser;
|
|
42552
41909
|
exports.TabBox = TabBox;
|
|
42553
|
-
exports.Variant = Variant$
|
|
41910
|
+
exports.Variant = Variant$1;
|
|
42554
41911
|
exports.abbreviate = abbreviate;
|
|
42555
41912
|
exports.addDBEditorEndpoints = addDBEditorEndpoints;
|
|
42556
41913
|
exports.alert = alert$1;
|
|
@@ -42563,15 +41920,15 @@ exports.extractProp = extractProp;
|
|
|
42563
41920
|
exports.floorToNumDecimals = floorToNumDecimals;
|
|
42564
41921
|
exports.forceNumIntoBounds = forceNumIntoBounds;
|
|
42565
41922
|
exports.genCSV = genCSV;
|
|
42566
|
-
exports.genRouteHandler = genRouteHandler
|
|
41923
|
+
exports.genRouteHandler = genRouteHandler;
|
|
42567
41924
|
exports.getHumanReadableDate = getHumanReadableDate;
|
|
42568
41925
|
exports.getLocalTimeInfo = getLocalTimeInfo;
|
|
42569
41926
|
exports.getMonthName = getMonthName;
|
|
42570
41927
|
exports.getOrdinal = getOrdinal;
|
|
42571
41928
|
exports.getPartOfDay = getPartOfDay;
|
|
42572
41929
|
exports.getTimeInfoInET = getTimeInfoInET;
|
|
42573
|
-
exports.handleError = handleError
|
|
42574
|
-
exports.handleSuccess = handleSuccess
|
|
41930
|
+
exports.handleError = handleError;
|
|
41931
|
+
exports.handleSuccess = handleSuccess;
|
|
42575
41932
|
exports.initClient = initClient;
|
|
42576
41933
|
exports.initLogCollection = initLogCollection;
|
|
42577
41934
|
exports.initServer = initServer;
|