dce-reactkit 3.2.2-beta.15 → 3.2.2-beta.16
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 +51 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +51 -11
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LogReviewer.tsx +64 -10
package/dist/cjs/index.js
CHANGED
|
@@ -2753,7 +2753,19 @@ const reducer = (state, action) => {
|
|
|
2753
2753
|
return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
|
|
2754
2754
|
}
|
|
2755
2755
|
case ActionType.UpdateTagFilterState: {
|
|
2756
|
-
|
|
2756
|
+
const { tagFilterState } = action;
|
|
2757
|
+
// Select all if every tag is deselected
|
|
2758
|
+
const numTagsSelected = (Object.values(tagFilterState)
|
|
2759
|
+
.filter((isSelected) => {
|
|
2760
|
+
return isSelected;
|
|
2761
|
+
})
|
|
2762
|
+
.length);
|
|
2763
|
+
if (numTagsSelected === 0) {
|
|
2764
|
+
Object.keys(tagFilterState).forEach((tag) => {
|
|
2765
|
+
tagFilterState[tag] = true;
|
|
2766
|
+
});
|
|
2767
|
+
}
|
|
2768
|
+
return Object.assign(Object.assign({}, state), { tagFilterState });
|
|
2757
2769
|
}
|
|
2758
2770
|
case ActionType.UpdateActionErrorFilterState: {
|
|
2759
2771
|
return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
|
|
@@ -3028,14 +3040,22 @@ const LogReviewer = (props) => {
|
|
|
3028
3040
|
if (expandedFilterDrawer) {
|
|
3029
3041
|
if (expandedFilterDrawer === FilterDrawer.Date) {
|
|
3030
3042
|
filterDrawer = (React__default["default"].createElement(TabBox, { title: "Date" },
|
|
3031
|
-
React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter start date", name: "filter-start-date", year: dateFilterState.startDate.year, month: dateFilterState.startDate.month, day: dateFilterState.startDate.day, chooseFromPast: true, onChange: (month, day, year) => {
|
|
3043
|
+
React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter start date", name: "filter-start-date", year: dateFilterState.startDate.year, month: dateFilterState.startDate.month, day: dateFilterState.startDate.day, chooseFromPast: true, numMonthsToShow: 12, onChange: (month, day, year) => {
|
|
3032
3044
|
dateFilterState.startDate = { month, day, year };
|
|
3033
3045
|
handleDateRangeUpdated(dateFilterState);
|
|
3034
3046
|
} }),
|
|
3035
3047
|
' ',
|
|
3036
3048
|
"to",
|
|
3037
3049
|
' ',
|
|
3038
|
-
React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter end date", name: "filter-end-date", year: dateFilterState.endDate.year, month: dateFilterState.endDate.month, day: dateFilterState.endDate.day, chooseFromPast: true, onChange: (month, day, year) => {
|
|
3050
|
+
React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter end date", name: "filter-end-date", year: dateFilterState.endDate.year, month: dateFilterState.endDate.month, day: dateFilterState.endDate.day, chooseFromPast: true, numMonthsToShow: 12, onChange: (month, day, year) => {
|
|
3051
|
+
if (year < dateFilterState.startDate.year
|
|
3052
|
+
|| (year === dateFilterState.startDate.year
|
|
3053
|
+
&& month < dateFilterState.startDate.month)
|
|
3054
|
+
|| (year === dateFilterState.startDate.year
|
|
3055
|
+
&& month === dateFilterState.startDate.month
|
|
3056
|
+
&& day < dateFilterState.startDate.day)) {
|
|
3057
|
+
return alert$1('Invalid Start Date', 'The start date cannot be before the end date.');
|
|
3058
|
+
}
|
|
3039
3059
|
dateFilterState.endDate = { month, day, year };
|
|
3040
3060
|
handleDateRangeUpdated(dateFilterState);
|
|
3041
3061
|
} })));
|
|
@@ -3354,8 +3374,9 @@ const LogReviewer = (props) => {
|
|
|
3354
3374
|
Object.keys(logMap).forEach((year) => {
|
|
3355
3375
|
Object.keys(logMap[year]).forEach((month) => {
|
|
3356
3376
|
logMap[year][month].forEach((log) => {
|
|
3357
|
-
/* ----------- Date Filter ---------- */
|
|
3358
3377
|
var _a;
|
|
3378
|
+
/* ----------- Date Filter ---------- */
|
|
3379
|
+
console.log('Log:', log);
|
|
3359
3380
|
// Before start date
|
|
3360
3381
|
if (
|
|
3361
3382
|
// Previous year
|
|
@@ -3367,6 +3388,7 @@ const LogReviewer = (props) => {
|
|
|
3367
3388
|
|| ((log.year === dateFilterState.startDate.year)
|
|
3368
3389
|
&& (log.month === dateFilterState.startDate.month)
|
|
3369
3390
|
&& (log.day < dateFilterState.startDate.day))) {
|
|
3391
|
+
console.log('RULED OUT: START');
|
|
3370
3392
|
return;
|
|
3371
3393
|
}
|
|
3372
3394
|
// After end date
|
|
@@ -3380,6 +3402,7 @@ const LogReviewer = (props) => {
|
|
|
3380
3402
|
|| ((log.year === dateFilterState.endDate.year)
|
|
3381
3403
|
&& (log.month === dateFilterState.endDate.month)
|
|
3382
3404
|
&& (log.day > dateFilterState.endDate.day))) {
|
|
3405
|
+
console.log('RULED OUT: END');
|
|
3383
3406
|
return;
|
|
3384
3407
|
}
|
|
3385
3408
|
/* --------- Context Filter --------- */
|
|
@@ -3392,6 +3415,7 @@ const LogReviewer = (props) => {
|
|
|
3392
3415
|
.every((isSelected) => {
|
|
3393
3416
|
return !isSelected;
|
|
3394
3417
|
}))) {
|
|
3418
|
+
console.log('RULED OUT: CONTEXT');
|
|
3395
3419
|
return;
|
|
3396
3420
|
}
|
|
3397
3421
|
// Subcontext doesn't match
|
|
@@ -3404,17 +3428,15 @@ const LogReviewer = (props) => {
|
|
|
3404
3428
|
&& contextFilterState[log.context] !== true)
|
|
3405
3429
|
// Subcontext is not selected
|
|
3406
3430
|
&& !contextFilterState[log.context][log.subcontext]) {
|
|
3431
|
+
console.log('RULED OUT: SUBCONTEXT');
|
|
3407
3432
|
return;
|
|
3408
3433
|
}
|
|
3409
3434
|
/* -------------- Tags -------------- */
|
|
3410
3435
|
// No tags match
|
|
3411
|
-
if (
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
&& (log.tags.every((tag) => {
|
|
3416
|
-
return !tagFilterState[tag];
|
|
3417
|
-
}))) {
|
|
3436
|
+
if (log.tags.every((tag) => {
|
|
3437
|
+
return !tagFilterState[tag];
|
|
3438
|
+
})) {
|
|
3439
|
+
console.log('RULED OUT: TAGS');
|
|
3418
3440
|
return;
|
|
3419
3441
|
}
|
|
3420
3442
|
/* ------- Actions and Errors ------- */
|
|
@@ -3424,6 +3446,7 @@ const LogReviewer = (props) => {
|
|
|
3424
3446
|
actionErrorFilterState.type !== undefined
|
|
3425
3447
|
// Log type doesn't match
|
|
3426
3448
|
&& actionErrorFilterState.type !== log.type) {
|
|
3449
|
+
console.log('RULED OUT: TYPE');
|
|
3427
3450
|
return;
|
|
3428
3451
|
}
|
|
3429
3452
|
// Filter errors
|
|
@@ -3436,6 +3459,7 @@ const LogReviewer = (props) => {
|
|
|
3436
3459
|
&& actionErrorFilterState.errorMessage.trim().length > 0
|
|
3437
3460
|
// Message doesn't match
|
|
3438
3461
|
&& log.errorMessage.toLowerCase().includes(actionErrorFilterState.errorMessage.trim().toLowerCase())) {
|
|
3462
|
+
console.log('RULED OUT: ERROR MESSAGE');
|
|
3439
3463
|
return;
|
|
3440
3464
|
}
|
|
3441
3465
|
// Code doesn't match
|
|
@@ -3446,6 +3470,7 @@ const LogReviewer = (props) => {
|
|
|
3446
3470
|
&& actionErrorFilterState.errorCode.trim().length > 0
|
|
3447
3471
|
// Code doesn't match
|
|
3448
3472
|
&& log.errorCode.toUpperCase().includes(actionErrorFilterState.errorCode.trim().toUpperCase())) {
|
|
3473
|
+
console.log('RULED OUT: ERROR CODE');
|
|
3449
3474
|
return;
|
|
3450
3475
|
}
|
|
3451
3476
|
}
|
|
@@ -3457,6 +3482,7 @@ const LogReviewer = (props) => {
|
|
|
3457
3482
|
log.target
|
|
3458
3483
|
// Target isn't selected
|
|
3459
3484
|
&& !actionErrorFilterState.target[log.target]) {
|
|
3485
|
+
console.log('RULED OUT: TARGET');
|
|
3460
3486
|
return;
|
|
3461
3487
|
}
|
|
3462
3488
|
// Action
|
|
@@ -3465,6 +3491,7 @@ const LogReviewer = (props) => {
|
|
|
3465
3491
|
log.action
|
|
3466
3492
|
// Action isn't selected
|
|
3467
3493
|
&& !actionErrorFilterState.action[log.action]) {
|
|
3494
|
+
console.log('RULED OUT: ACTION');
|
|
3468
3495
|
return;
|
|
3469
3496
|
}
|
|
3470
3497
|
}
|
|
@@ -3475,6 +3502,7 @@ const LogReviewer = (props) => {
|
|
|
3475
3502
|
log.userFirstName
|
|
3476
3503
|
// First name query doesn't match
|
|
3477
3504
|
&& !log.userFirstName.toLowerCase().includes(advancedFilterState.userFirstName.toLowerCase().trim())) {
|
|
3505
|
+
console.log('RULED OUT: FIRST');
|
|
3478
3506
|
return;
|
|
3479
3507
|
}
|
|
3480
3508
|
// Last name doesn't match
|
|
@@ -3483,6 +3511,7 @@ const LogReviewer = (props) => {
|
|
|
3483
3511
|
log.userLastName
|
|
3484
3512
|
// Last name query doesn't match
|
|
3485
3513
|
&& !log.userLastName.toLowerCase().includes(advancedFilterState.userLastName.toLowerCase().trim())) {
|
|
3514
|
+
console.log('RULED OUT: LAST');
|
|
3486
3515
|
return;
|
|
3487
3516
|
}
|
|
3488
3517
|
// Email doesn't match
|
|
@@ -3491,6 +3520,7 @@ const LogReviewer = (props) => {
|
|
|
3491
3520
|
log.userEmail
|
|
3492
3521
|
// Email query doesn't match
|
|
3493
3522
|
&& !log.userEmail.toLowerCase().includes(advancedFilterState.userEmail.toLowerCase().trim())) {
|
|
3523
|
+
console.log('RULED OUT: EMAIL');
|
|
3494
3524
|
return;
|
|
3495
3525
|
}
|
|
3496
3526
|
// User id doesn't match
|
|
@@ -3499,6 +3529,7 @@ const LogReviewer = (props) => {
|
|
|
3499
3529
|
log.userId
|
|
3500
3530
|
// User id doesn't match
|
|
3501
3531
|
&& !String(log.userId).includes(advancedFilterState.userId.trim())) {
|
|
3532
|
+
console.log('RULED OUT: USER ID');
|
|
3502
3533
|
return;
|
|
3503
3534
|
}
|
|
3504
3535
|
// Learner not allowed
|
|
@@ -3507,6 +3538,7 @@ const LogReviewer = (props) => {
|
|
|
3507
3538
|
log.isLearner
|
|
3508
3539
|
// Learners aren't included
|
|
3509
3540
|
&& !advancedFilterState.includeLearners) {
|
|
3541
|
+
console.log('RULED OUT: LEARNER');
|
|
3510
3542
|
return;
|
|
3511
3543
|
}
|
|
3512
3544
|
// TTM not allowed
|
|
@@ -3515,6 +3547,7 @@ const LogReviewer = (props) => {
|
|
|
3515
3547
|
log.isTTM
|
|
3516
3548
|
// TTMs aren't included
|
|
3517
3549
|
&& !advancedFilterState.includeTTMs) {
|
|
3550
|
+
console.log('RULED OUT: TTM');
|
|
3518
3551
|
return;
|
|
3519
3552
|
}
|
|
3520
3553
|
// Admin not allowed
|
|
@@ -3523,6 +3556,7 @@ const LogReviewer = (props) => {
|
|
|
3523
3556
|
log.isAdmin
|
|
3524
3557
|
// Admins aren't included
|
|
3525
3558
|
&& !advancedFilterState.includeAdmins) {
|
|
3559
|
+
console.log('RULED OUT: ADMIN');
|
|
3526
3560
|
return;
|
|
3527
3561
|
}
|
|
3528
3562
|
// Course Id doesn't match
|
|
@@ -3531,6 +3565,7 @@ const LogReviewer = (props) => {
|
|
|
3531
3565
|
log.courseId
|
|
3532
3566
|
// Course Id doesn't match
|
|
3533
3567
|
&& !String(log.courseId).includes(advancedFilterState.courseId.trim())) {
|
|
3568
|
+
console.log('RULED OUT: COURSE ID');
|
|
3534
3569
|
return;
|
|
3535
3570
|
}
|
|
3536
3571
|
// Course name doesn't match
|
|
@@ -3539,6 +3574,7 @@ const LogReviewer = (props) => {
|
|
|
3539
3574
|
log.courseName
|
|
3540
3575
|
// Course name doesn't match
|
|
3541
3576
|
&& !String(log.courseName).includes(advancedFilterState.courseName.trim())) {
|
|
3577
|
+
console.log('RULED OUT: COURSE NAME');
|
|
3542
3578
|
return;
|
|
3543
3579
|
}
|
|
3544
3580
|
// Mobile filter doesn't match
|
|
@@ -3549,6 +3585,7 @@ const LogReviewer = (props) => {
|
|
|
3549
3585
|
&& log.device
|
|
3550
3586
|
// Mobile filter doesn't match
|
|
3551
3587
|
&& (advancedFilterState.isMobile === log.device.isMobile)) {
|
|
3588
|
+
console.log('RULED OUT: MOBILE');
|
|
3552
3589
|
return;
|
|
3553
3590
|
}
|
|
3554
3591
|
// Log source doesn't match
|
|
@@ -3559,6 +3596,7 @@ const LogReviewer = (props) => {
|
|
|
3559
3596
|
&& log.source
|
|
3560
3597
|
// Source filter doesn't match
|
|
3561
3598
|
&& (advancedFilterState.source !== log.source)) {
|
|
3599
|
+
console.log('RULED OUT: SOURCE');
|
|
3562
3600
|
return;
|
|
3563
3601
|
}
|
|
3564
3602
|
// Route path doesn't match (Only for server source)
|
|
@@ -3569,6 +3607,7 @@ const LogReviewer = (props) => {
|
|
|
3569
3607
|
&& (advancedFilterState.routePath.trim().length)
|
|
3570
3608
|
// Route path doesn't match
|
|
3571
3609
|
&& !(log.routePath.includes(advancedFilterState.routePath.trim()))) {
|
|
3610
|
+
console.log('RULED OUT: PATH');
|
|
3572
3611
|
return;
|
|
3573
3612
|
}
|
|
3574
3613
|
// Route template doesn't match (Only for server source)
|
|
@@ -3579,6 +3618,7 @@ const LogReviewer = (props) => {
|
|
|
3579
3618
|
&& (advancedFilterState.routeTemplate.trim().length)
|
|
3580
3619
|
// Route template doesn't match
|
|
3581
3620
|
&& !(log.routeTemplate.includes(advancedFilterState.routeTemplate.trim()))) {
|
|
3621
|
+
console.log('RULED OUT: TEMPLATE');
|
|
3582
3622
|
return;
|
|
3583
3623
|
}
|
|
3584
3624
|
/* -------------- Done -------------- */
|