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/esm/index.js
CHANGED
|
@@ -2745,7 +2745,19 @@ const reducer = (state, action) => {
|
|
|
2745
2745
|
return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
|
|
2746
2746
|
}
|
|
2747
2747
|
case ActionType.UpdateTagFilterState: {
|
|
2748
|
-
|
|
2748
|
+
const { tagFilterState } = action;
|
|
2749
|
+
// Select all if every tag is deselected
|
|
2750
|
+
const numTagsSelected = (Object.values(tagFilterState)
|
|
2751
|
+
.filter((isSelected) => {
|
|
2752
|
+
return isSelected;
|
|
2753
|
+
})
|
|
2754
|
+
.length);
|
|
2755
|
+
if (numTagsSelected === 0) {
|
|
2756
|
+
Object.keys(tagFilterState).forEach((tag) => {
|
|
2757
|
+
tagFilterState[tag] = true;
|
|
2758
|
+
});
|
|
2759
|
+
}
|
|
2760
|
+
return Object.assign(Object.assign({}, state), { tagFilterState });
|
|
2749
2761
|
}
|
|
2750
2762
|
case ActionType.UpdateActionErrorFilterState: {
|
|
2751
2763
|
return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
|
|
@@ -3020,14 +3032,22 @@ const LogReviewer = (props) => {
|
|
|
3020
3032
|
if (expandedFilterDrawer) {
|
|
3021
3033
|
if (expandedFilterDrawer === FilterDrawer.Date) {
|
|
3022
3034
|
filterDrawer = (React.createElement(TabBox, { title: "Date" },
|
|
3023
|
-
React.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) => {
|
|
3035
|
+
React.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) => {
|
|
3024
3036
|
dateFilterState.startDate = { month, day, year };
|
|
3025
3037
|
handleDateRangeUpdated(dateFilterState);
|
|
3026
3038
|
} }),
|
|
3027
3039
|
' ',
|
|
3028
3040
|
"to",
|
|
3029
3041
|
' ',
|
|
3030
|
-
React.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) => {
|
|
3042
|
+
React.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) => {
|
|
3043
|
+
if (year < dateFilterState.startDate.year
|
|
3044
|
+
|| (year === dateFilterState.startDate.year
|
|
3045
|
+
&& month < dateFilterState.startDate.month)
|
|
3046
|
+
|| (year === dateFilterState.startDate.year
|
|
3047
|
+
&& month === dateFilterState.startDate.month
|
|
3048
|
+
&& day < dateFilterState.startDate.day)) {
|
|
3049
|
+
return alert$1('Invalid Start Date', 'The start date cannot be before the end date.');
|
|
3050
|
+
}
|
|
3031
3051
|
dateFilterState.endDate = { month, day, year };
|
|
3032
3052
|
handleDateRangeUpdated(dateFilterState);
|
|
3033
3053
|
} })));
|
|
@@ -3346,8 +3366,9 @@ const LogReviewer = (props) => {
|
|
|
3346
3366
|
Object.keys(logMap).forEach((year) => {
|
|
3347
3367
|
Object.keys(logMap[year]).forEach((month) => {
|
|
3348
3368
|
logMap[year][month].forEach((log) => {
|
|
3349
|
-
/* ----------- Date Filter ---------- */
|
|
3350
3369
|
var _a;
|
|
3370
|
+
/* ----------- Date Filter ---------- */
|
|
3371
|
+
console.log('Log:', log);
|
|
3351
3372
|
// Before start date
|
|
3352
3373
|
if (
|
|
3353
3374
|
// Previous year
|
|
@@ -3359,6 +3380,7 @@ const LogReviewer = (props) => {
|
|
|
3359
3380
|
|| ((log.year === dateFilterState.startDate.year)
|
|
3360
3381
|
&& (log.month === dateFilterState.startDate.month)
|
|
3361
3382
|
&& (log.day < dateFilterState.startDate.day))) {
|
|
3383
|
+
console.log('RULED OUT: START');
|
|
3362
3384
|
return;
|
|
3363
3385
|
}
|
|
3364
3386
|
// After end date
|
|
@@ -3372,6 +3394,7 @@ const LogReviewer = (props) => {
|
|
|
3372
3394
|
|| ((log.year === dateFilterState.endDate.year)
|
|
3373
3395
|
&& (log.month === dateFilterState.endDate.month)
|
|
3374
3396
|
&& (log.day > dateFilterState.endDate.day))) {
|
|
3397
|
+
console.log('RULED OUT: END');
|
|
3375
3398
|
return;
|
|
3376
3399
|
}
|
|
3377
3400
|
/* --------- Context Filter --------- */
|
|
@@ -3384,6 +3407,7 @@ const LogReviewer = (props) => {
|
|
|
3384
3407
|
.every((isSelected) => {
|
|
3385
3408
|
return !isSelected;
|
|
3386
3409
|
}))) {
|
|
3410
|
+
console.log('RULED OUT: CONTEXT');
|
|
3387
3411
|
return;
|
|
3388
3412
|
}
|
|
3389
3413
|
// Subcontext doesn't match
|
|
@@ -3396,17 +3420,15 @@ const LogReviewer = (props) => {
|
|
|
3396
3420
|
&& contextFilterState[log.context] !== true)
|
|
3397
3421
|
// Subcontext is not selected
|
|
3398
3422
|
&& !contextFilterState[log.context][log.subcontext]) {
|
|
3423
|
+
console.log('RULED OUT: SUBCONTEXT');
|
|
3399
3424
|
return;
|
|
3400
3425
|
}
|
|
3401
3426
|
/* -------------- Tags -------------- */
|
|
3402
3427
|
// No tags match
|
|
3403
|
-
if (
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
&& (log.tags.every((tag) => {
|
|
3408
|
-
return !tagFilterState[tag];
|
|
3409
|
-
}))) {
|
|
3428
|
+
if (log.tags.every((tag) => {
|
|
3429
|
+
return !tagFilterState[tag];
|
|
3430
|
+
})) {
|
|
3431
|
+
console.log('RULED OUT: TAGS');
|
|
3410
3432
|
return;
|
|
3411
3433
|
}
|
|
3412
3434
|
/* ------- Actions and Errors ------- */
|
|
@@ -3416,6 +3438,7 @@ const LogReviewer = (props) => {
|
|
|
3416
3438
|
actionErrorFilterState.type !== undefined
|
|
3417
3439
|
// Log type doesn't match
|
|
3418
3440
|
&& actionErrorFilterState.type !== log.type) {
|
|
3441
|
+
console.log('RULED OUT: TYPE');
|
|
3419
3442
|
return;
|
|
3420
3443
|
}
|
|
3421
3444
|
// Filter errors
|
|
@@ -3428,6 +3451,7 @@ const LogReviewer = (props) => {
|
|
|
3428
3451
|
&& actionErrorFilterState.errorMessage.trim().length > 0
|
|
3429
3452
|
// Message doesn't match
|
|
3430
3453
|
&& log.errorMessage.toLowerCase().includes(actionErrorFilterState.errorMessage.trim().toLowerCase())) {
|
|
3454
|
+
console.log('RULED OUT: ERROR MESSAGE');
|
|
3431
3455
|
return;
|
|
3432
3456
|
}
|
|
3433
3457
|
// Code doesn't match
|
|
@@ -3438,6 +3462,7 @@ const LogReviewer = (props) => {
|
|
|
3438
3462
|
&& actionErrorFilterState.errorCode.trim().length > 0
|
|
3439
3463
|
// Code doesn't match
|
|
3440
3464
|
&& log.errorCode.toUpperCase().includes(actionErrorFilterState.errorCode.trim().toUpperCase())) {
|
|
3465
|
+
console.log('RULED OUT: ERROR CODE');
|
|
3441
3466
|
return;
|
|
3442
3467
|
}
|
|
3443
3468
|
}
|
|
@@ -3449,6 +3474,7 @@ const LogReviewer = (props) => {
|
|
|
3449
3474
|
log.target
|
|
3450
3475
|
// Target isn't selected
|
|
3451
3476
|
&& !actionErrorFilterState.target[log.target]) {
|
|
3477
|
+
console.log('RULED OUT: TARGET');
|
|
3452
3478
|
return;
|
|
3453
3479
|
}
|
|
3454
3480
|
// Action
|
|
@@ -3457,6 +3483,7 @@ const LogReviewer = (props) => {
|
|
|
3457
3483
|
log.action
|
|
3458
3484
|
// Action isn't selected
|
|
3459
3485
|
&& !actionErrorFilterState.action[log.action]) {
|
|
3486
|
+
console.log('RULED OUT: ACTION');
|
|
3460
3487
|
return;
|
|
3461
3488
|
}
|
|
3462
3489
|
}
|
|
@@ -3467,6 +3494,7 @@ const LogReviewer = (props) => {
|
|
|
3467
3494
|
log.userFirstName
|
|
3468
3495
|
// First name query doesn't match
|
|
3469
3496
|
&& !log.userFirstName.toLowerCase().includes(advancedFilterState.userFirstName.toLowerCase().trim())) {
|
|
3497
|
+
console.log('RULED OUT: FIRST');
|
|
3470
3498
|
return;
|
|
3471
3499
|
}
|
|
3472
3500
|
// Last name doesn't match
|
|
@@ -3475,6 +3503,7 @@ const LogReviewer = (props) => {
|
|
|
3475
3503
|
log.userLastName
|
|
3476
3504
|
// Last name query doesn't match
|
|
3477
3505
|
&& !log.userLastName.toLowerCase().includes(advancedFilterState.userLastName.toLowerCase().trim())) {
|
|
3506
|
+
console.log('RULED OUT: LAST');
|
|
3478
3507
|
return;
|
|
3479
3508
|
}
|
|
3480
3509
|
// Email doesn't match
|
|
@@ -3483,6 +3512,7 @@ const LogReviewer = (props) => {
|
|
|
3483
3512
|
log.userEmail
|
|
3484
3513
|
// Email query doesn't match
|
|
3485
3514
|
&& !log.userEmail.toLowerCase().includes(advancedFilterState.userEmail.toLowerCase().trim())) {
|
|
3515
|
+
console.log('RULED OUT: EMAIL');
|
|
3486
3516
|
return;
|
|
3487
3517
|
}
|
|
3488
3518
|
// User id doesn't match
|
|
@@ -3491,6 +3521,7 @@ const LogReviewer = (props) => {
|
|
|
3491
3521
|
log.userId
|
|
3492
3522
|
// User id doesn't match
|
|
3493
3523
|
&& !String(log.userId).includes(advancedFilterState.userId.trim())) {
|
|
3524
|
+
console.log('RULED OUT: USER ID');
|
|
3494
3525
|
return;
|
|
3495
3526
|
}
|
|
3496
3527
|
// Learner not allowed
|
|
@@ -3499,6 +3530,7 @@ const LogReviewer = (props) => {
|
|
|
3499
3530
|
log.isLearner
|
|
3500
3531
|
// Learners aren't included
|
|
3501
3532
|
&& !advancedFilterState.includeLearners) {
|
|
3533
|
+
console.log('RULED OUT: LEARNER');
|
|
3502
3534
|
return;
|
|
3503
3535
|
}
|
|
3504
3536
|
// TTM not allowed
|
|
@@ -3507,6 +3539,7 @@ const LogReviewer = (props) => {
|
|
|
3507
3539
|
log.isTTM
|
|
3508
3540
|
// TTMs aren't included
|
|
3509
3541
|
&& !advancedFilterState.includeTTMs) {
|
|
3542
|
+
console.log('RULED OUT: TTM');
|
|
3510
3543
|
return;
|
|
3511
3544
|
}
|
|
3512
3545
|
// Admin not allowed
|
|
@@ -3515,6 +3548,7 @@ const LogReviewer = (props) => {
|
|
|
3515
3548
|
log.isAdmin
|
|
3516
3549
|
// Admins aren't included
|
|
3517
3550
|
&& !advancedFilterState.includeAdmins) {
|
|
3551
|
+
console.log('RULED OUT: ADMIN');
|
|
3518
3552
|
return;
|
|
3519
3553
|
}
|
|
3520
3554
|
// Course Id doesn't match
|
|
@@ -3523,6 +3557,7 @@ const LogReviewer = (props) => {
|
|
|
3523
3557
|
log.courseId
|
|
3524
3558
|
// Course Id doesn't match
|
|
3525
3559
|
&& !String(log.courseId).includes(advancedFilterState.courseId.trim())) {
|
|
3560
|
+
console.log('RULED OUT: COURSE ID');
|
|
3526
3561
|
return;
|
|
3527
3562
|
}
|
|
3528
3563
|
// Course name doesn't match
|
|
@@ -3531,6 +3566,7 @@ const LogReviewer = (props) => {
|
|
|
3531
3566
|
log.courseName
|
|
3532
3567
|
// Course name doesn't match
|
|
3533
3568
|
&& !String(log.courseName).includes(advancedFilterState.courseName.trim())) {
|
|
3569
|
+
console.log('RULED OUT: COURSE NAME');
|
|
3534
3570
|
return;
|
|
3535
3571
|
}
|
|
3536
3572
|
// Mobile filter doesn't match
|
|
@@ -3541,6 +3577,7 @@ const LogReviewer = (props) => {
|
|
|
3541
3577
|
&& log.device
|
|
3542
3578
|
// Mobile filter doesn't match
|
|
3543
3579
|
&& (advancedFilterState.isMobile === log.device.isMobile)) {
|
|
3580
|
+
console.log('RULED OUT: MOBILE');
|
|
3544
3581
|
return;
|
|
3545
3582
|
}
|
|
3546
3583
|
// Log source doesn't match
|
|
@@ -3551,6 +3588,7 @@ const LogReviewer = (props) => {
|
|
|
3551
3588
|
&& log.source
|
|
3552
3589
|
// Source filter doesn't match
|
|
3553
3590
|
&& (advancedFilterState.source !== log.source)) {
|
|
3591
|
+
console.log('RULED OUT: SOURCE');
|
|
3554
3592
|
return;
|
|
3555
3593
|
}
|
|
3556
3594
|
// Route path doesn't match (Only for server source)
|
|
@@ -3561,6 +3599,7 @@ const LogReviewer = (props) => {
|
|
|
3561
3599
|
&& (advancedFilterState.routePath.trim().length)
|
|
3562
3600
|
// Route path doesn't match
|
|
3563
3601
|
&& !(log.routePath.includes(advancedFilterState.routePath.trim()))) {
|
|
3602
|
+
console.log('RULED OUT: PATH');
|
|
3564
3603
|
return;
|
|
3565
3604
|
}
|
|
3566
3605
|
// Route template doesn't match (Only for server source)
|
|
@@ -3571,6 +3610,7 @@ const LogReviewer = (props) => {
|
|
|
3571
3610
|
&& (advancedFilterState.routeTemplate.trim().length)
|
|
3572
3611
|
// Route template doesn't match
|
|
3573
3612
|
&& !(log.routeTemplate.includes(advancedFilterState.routeTemplate.trim()))) {
|
|
3613
|
+
console.log('RULED OUT: TEMPLATE');
|
|
3574
3614
|
return;
|
|
3575
3615
|
}
|
|
3576
3616
|
/* -------------- Done -------------- */
|