dce-reactkit 3.2.2-beta.39 → 3.2.2-beta.40
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 +22 -38
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Drawer.d.ts +1 -0
- package/dist/esm/index.js +22 -38
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Drawer.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Drawer.tsx +9 -1
- package/src/components/IntelliTable.tsx +7 -1
- package/src/components/LogReviewer.tsx +24 -49
package/dist/esm/index.js
CHANGED
|
@@ -1446,14 +1446,16 @@ const Drawer = (props) => {
|
|
|
1446
1446
|
/*------------------------------------------------------------------------*/
|
|
1447
1447
|
/* -------------- Props ------------- */
|
|
1448
1448
|
// Destructure all props
|
|
1449
|
-
const { children, } = props;
|
|
1449
|
+
const { customBackgroundColor, children, } = props;
|
|
1450
1450
|
/*------------------------------------------------------------------------*/
|
|
1451
1451
|
/* Render */
|
|
1452
1452
|
/*------------------------------------------------------------------------*/
|
|
1453
1453
|
/*----------------------------------------*/
|
|
1454
1454
|
/* Main UI */
|
|
1455
1455
|
/*----------------------------------------*/
|
|
1456
|
-
return (React.createElement("div", { className: "Drawer-container"
|
|
1456
|
+
return (React.createElement("div", { className: "Drawer-container", style: {
|
|
1457
|
+
backgroundColor: (customBackgroundColor !== null && customBackgroundColor !== void 0 ? customBackgroundColor : undefined),
|
|
1458
|
+
} },
|
|
1457
1459
|
React.createElement("style", null, style$4),
|
|
1458
1460
|
children));
|
|
1459
1461
|
};
|
|
@@ -2355,7 +2357,11 @@ const IntelliTable = (props) => {
|
|
|
2355
2357
|
var _a;
|
|
2356
2358
|
/* -------------- Props ------------- */
|
|
2357
2359
|
// Destructure all props
|
|
2358
|
-
const { title, id,
|
|
2360
|
+
const { title, id, columns, } = props;
|
|
2361
|
+
// Get data, show empty row if none
|
|
2362
|
+
const data = ((props.data && props.data.length > 0)
|
|
2363
|
+
? props.data
|
|
2364
|
+
: [{ id: 'empty-row' }]);
|
|
2359
2365
|
/* -------------- State ------------- */
|
|
2360
2366
|
// Initial state
|
|
2361
2367
|
const initColumnVisibilityMap = {};
|
|
@@ -3293,7 +3299,7 @@ const LogReviewer = (props) => {
|
|
|
3293
3299
|
} })),
|
|
3294
3300
|
React.createElement("div", { className: "input-group mb-2" },
|
|
3295
3301
|
React.createElement("span", { className: "input-group-text" }, "Error Code"),
|
|
3296
|
-
React.createElement("input", { type: "text", className: "form-control", "aria-label": "query for error code", value: actionErrorFilterState.
|
|
3302
|
+
React.createElement("input", { type: "text", className: "form-control", "aria-label": "query for error code", value: actionErrorFilterState.errorCode, onChange: (e) => {
|
|
3297
3303
|
actionErrorFilterState.errorCode = ((e.target.value)
|
|
3298
3304
|
.trim()
|
|
3299
3305
|
.toUpperCase());
|
|
@@ -3474,9 +3480,8 @@ const LogReviewer = (props) => {
|
|
|
3474
3480
|
Object.keys(logMap).forEach((year) => {
|
|
3475
3481
|
Object.keys(logMap[year]).forEach((month) => {
|
|
3476
3482
|
logMap[year][month].forEach((log) => {
|
|
3477
|
-
var _a;
|
|
3478
3483
|
/* ----------- Date Filter ---------- */
|
|
3479
|
-
|
|
3484
|
+
var _a;
|
|
3480
3485
|
// Before start date
|
|
3481
3486
|
if (
|
|
3482
3487
|
// Previous year
|
|
@@ -3488,7 +3493,6 @@ const LogReviewer = (props) => {
|
|
|
3488
3493
|
|| ((log.year === dateFilterState.startDate.year)
|
|
3489
3494
|
&& (log.month === dateFilterState.startDate.month)
|
|
3490
3495
|
&& (log.day < dateFilterState.startDate.day))) {
|
|
3491
|
-
console.log('RULED OUT: START');
|
|
3492
3496
|
return;
|
|
3493
3497
|
}
|
|
3494
3498
|
// After end date
|
|
@@ -3502,7 +3506,6 @@ const LogReviewer = (props) => {
|
|
|
3502
3506
|
|| ((log.year === dateFilterState.endDate.year)
|
|
3503
3507
|
&& (log.month === dateFilterState.endDate.month)
|
|
3504
3508
|
&& (log.day > dateFilterState.endDate.day))) {
|
|
3505
|
-
console.log('RULED OUT: END');
|
|
3506
3509
|
return;
|
|
3507
3510
|
}
|
|
3508
3511
|
/* --------- Context Filter --------- */
|
|
@@ -3519,7 +3522,6 @@ const LogReviewer = (props) => {
|
|
|
3519
3522
|
.every((isSelected) => {
|
|
3520
3523
|
return !isSelected;
|
|
3521
3524
|
}))) {
|
|
3522
|
-
console.log('RULED OUT: CONTEXT');
|
|
3523
3525
|
console.log(log.context, contextFilterState);
|
|
3524
3526
|
return;
|
|
3525
3527
|
}
|
|
@@ -3535,7 +3537,6 @@ const LogReviewer = (props) => {
|
|
|
3535
3537
|
&& contextFilterState[log.context] !== true)
|
|
3536
3538
|
// Subcontext is not selected
|
|
3537
3539
|
&& !contextFilterState[log.context][log.subcontext]) {
|
|
3538
|
-
console.log('RULED OUT: SUBCONTEXT');
|
|
3539
3540
|
return;
|
|
3540
3541
|
}
|
|
3541
3542
|
/* -------------- Tags -------------- */
|
|
@@ -3551,7 +3552,6 @@ const LogReviewer = (props) => {
|
|
|
3551
3552
|
&& log.tags.every((tag) => {
|
|
3552
3553
|
return !tagFilterState[tag];
|
|
3553
3554
|
})) {
|
|
3554
|
-
console.log('RULED OUT: TAGS');
|
|
3555
3555
|
return;
|
|
3556
3556
|
}
|
|
3557
3557
|
/* ------- Actions and Errors ------- */
|
|
@@ -3561,7 +3561,6 @@ const LogReviewer = (props) => {
|
|
|
3561
3561
|
actionErrorFilterState.type !== undefined
|
|
3562
3562
|
// Log type doesn't match
|
|
3563
3563
|
&& actionErrorFilterState.type !== log.type) {
|
|
3564
|
-
console.log('RULED OUT: TYPE');
|
|
3565
3564
|
return;
|
|
3566
3565
|
}
|
|
3567
3566
|
// Filter errors
|
|
@@ -3574,7 +3573,6 @@ const LogReviewer = (props) => {
|
|
|
3574
3573
|
&& actionErrorFilterState.errorMessage.trim().length > 0
|
|
3575
3574
|
// Message doesn't match
|
|
3576
3575
|
&& log.errorMessage.toLowerCase().includes(actionErrorFilterState.errorMessage.trim().toLowerCase())) {
|
|
3577
|
-
console.log('RULED OUT: ERROR MESSAGE');
|
|
3578
3576
|
return;
|
|
3579
3577
|
}
|
|
3580
3578
|
// Code doesn't match
|
|
@@ -3585,7 +3583,6 @@ const LogReviewer = (props) => {
|
|
|
3585
3583
|
&& actionErrorFilterState.errorCode.trim().length > 0
|
|
3586
3584
|
// Code doesn't match
|
|
3587
3585
|
&& log.errorCode.toUpperCase().includes(actionErrorFilterState.errorCode.trim().toUpperCase())) {
|
|
3588
|
-
console.log('RULED OUT: ERROR CODE');
|
|
3589
3586
|
return;
|
|
3590
3587
|
}
|
|
3591
3588
|
}
|
|
@@ -3597,7 +3594,6 @@ const LogReviewer = (props) => {
|
|
|
3597
3594
|
log.target
|
|
3598
3595
|
// Target isn't selected
|
|
3599
3596
|
&& !actionErrorFilterState.target[log.target]) {
|
|
3600
|
-
console.log('RULED OUT: TARGET');
|
|
3601
3597
|
return;
|
|
3602
3598
|
}
|
|
3603
3599
|
// Action
|
|
@@ -3606,7 +3602,6 @@ const LogReviewer = (props) => {
|
|
|
3606
3602
|
log.action
|
|
3607
3603
|
// Action isn't selected
|
|
3608
3604
|
&& !actionErrorFilterState.action[log.action]) {
|
|
3609
|
-
console.log('RULED OUT: ACTION');
|
|
3610
3605
|
return;
|
|
3611
3606
|
}
|
|
3612
3607
|
}
|
|
@@ -3617,7 +3612,6 @@ const LogReviewer = (props) => {
|
|
|
3617
3612
|
log.userFirstName
|
|
3618
3613
|
// First name query doesn't match
|
|
3619
3614
|
&& !log.userFirstName.toLowerCase().includes(advancedFilterState.userFirstName.toLowerCase().trim())) {
|
|
3620
|
-
console.log('RULED OUT: FIRST');
|
|
3621
3615
|
return;
|
|
3622
3616
|
}
|
|
3623
3617
|
// Last name doesn't match
|
|
@@ -3626,7 +3620,6 @@ const LogReviewer = (props) => {
|
|
|
3626
3620
|
log.userLastName
|
|
3627
3621
|
// Last name query doesn't match
|
|
3628
3622
|
&& !log.userLastName.toLowerCase().includes(advancedFilterState.userLastName.toLowerCase().trim())) {
|
|
3629
|
-
console.log('RULED OUT: LAST');
|
|
3630
3623
|
return;
|
|
3631
3624
|
}
|
|
3632
3625
|
// Email doesn't match
|
|
@@ -3635,7 +3628,6 @@ const LogReviewer = (props) => {
|
|
|
3635
3628
|
log.userEmail
|
|
3636
3629
|
// Email query doesn't match
|
|
3637
3630
|
&& !log.userEmail.toLowerCase().includes(advancedFilterState.userEmail.toLowerCase().trim())) {
|
|
3638
|
-
console.log('RULED OUT: EMAIL');
|
|
3639
3631
|
return;
|
|
3640
3632
|
}
|
|
3641
3633
|
// User id doesn't match
|
|
@@ -3644,7 +3636,6 @@ const LogReviewer = (props) => {
|
|
|
3644
3636
|
log.userId
|
|
3645
3637
|
// User id doesn't match
|
|
3646
3638
|
&& !String(log.userId).includes(advancedFilterState.userId.trim())) {
|
|
3647
|
-
console.log('RULED OUT: USER ID');
|
|
3648
3639
|
return;
|
|
3649
3640
|
}
|
|
3650
3641
|
// Learner not allowed
|
|
@@ -3653,7 +3644,6 @@ const LogReviewer = (props) => {
|
|
|
3653
3644
|
log.isLearner
|
|
3654
3645
|
// Learners aren't included
|
|
3655
3646
|
&& !advancedFilterState.includeLearners) {
|
|
3656
|
-
console.log('RULED OUT: LEARNER');
|
|
3657
3647
|
return;
|
|
3658
3648
|
}
|
|
3659
3649
|
// TTM not allowed
|
|
@@ -3662,7 +3652,6 @@ const LogReviewer = (props) => {
|
|
|
3662
3652
|
log.isTTM
|
|
3663
3653
|
// TTMs aren't included
|
|
3664
3654
|
&& !advancedFilterState.includeTTMs) {
|
|
3665
|
-
console.log('RULED OUT: TTM');
|
|
3666
3655
|
return;
|
|
3667
3656
|
}
|
|
3668
3657
|
// Admin not allowed
|
|
@@ -3671,7 +3660,6 @@ const LogReviewer = (props) => {
|
|
|
3671
3660
|
log.isAdmin
|
|
3672
3661
|
// Admins aren't included
|
|
3673
3662
|
&& !advancedFilterState.includeAdmins) {
|
|
3674
|
-
console.log('RULED OUT: ADMIN');
|
|
3675
3663
|
return;
|
|
3676
3664
|
}
|
|
3677
3665
|
// Course Id doesn't match
|
|
@@ -3680,7 +3668,6 @@ const LogReviewer = (props) => {
|
|
|
3680
3668
|
log.courseId
|
|
3681
3669
|
// Course Id doesn't match
|
|
3682
3670
|
&& !String(log.courseId).includes(advancedFilterState.courseId.trim())) {
|
|
3683
|
-
console.log('RULED OUT: COURSE ID');
|
|
3684
3671
|
return;
|
|
3685
3672
|
}
|
|
3686
3673
|
// Course name doesn't match
|
|
@@ -3689,7 +3676,6 @@ const LogReviewer = (props) => {
|
|
|
3689
3676
|
log.courseName
|
|
3690
3677
|
// Course name doesn't match
|
|
3691
3678
|
&& !String(log.courseName).includes(advancedFilterState.courseName.trim())) {
|
|
3692
|
-
console.log('RULED OUT: COURSE NAME');
|
|
3693
3679
|
return;
|
|
3694
3680
|
}
|
|
3695
3681
|
// Mobile filter doesn't match
|
|
@@ -3699,8 +3685,7 @@ const LogReviewer = (props) => {
|
|
|
3699
3685
|
// Device info exists
|
|
3700
3686
|
&& log.device
|
|
3701
3687
|
// Mobile filter doesn't match
|
|
3702
|
-
&& (advancedFilterState.isMobile
|
|
3703
|
-
console.log('RULED OUT: MOBILE');
|
|
3688
|
+
&& (advancedFilterState.isMobile !== log.device.isMobile)) {
|
|
3704
3689
|
return;
|
|
3705
3690
|
}
|
|
3706
3691
|
// Log source doesn't match
|
|
@@ -3711,7 +3696,6 @@ const LogReviewer = (props) => {
|
|
|
3711
3696
|
&& log.source
|
|
3712
3697
|
// Source filter doesn't match
|
|
3713
3698
|
&& (advancedFilterState.source !== log.source)) {
|
|
3714
|
-
console.log('RULED OUT: SOURCE');
|
|
3715
3699
|
return;
|
|
3716
3700
|
}
|
|
3717
3701
|
// Route path doesn't match (Only for server source)
|
|
@@ -3722,7 +3706,6 @@ const LogReviewer = (props) => {
|
|
|
3722
3706
|
&& (advancedFilterState.routePath.trim().length)
|
|
3723
3707
|
// Route path doesn't match
|
|
3724
3708
|
&& !(log.routePath.includes(advancedFilterState.routePath.trim()))) {
|
|
3725
|
-
console.log('RULED OUT: PATH');
|
|
3726
3709
|
return;
|
|
3727
3710
|
}
|
|
3728
3711
|
// Route template doesn't match (Only for server source)
|
|
@@ -3733,7 +3716,6 @@ const LogReviewer = (props) => {
|
|
|
3733
3716
|
&& (advancedFilterState.routeTemplate.trim().length)
|
|
3734
3717
|
// Route template doesn't match
|
|
3735
3718
|
&& !(log.routeTemplate.includes(advancedFilterState.routeTemplate.trim()))) {
|
|
3736
|
-
console.log('RULED OUT: TEMPLATE');
|
|
3737
3719
|
return;
|
|
3738
3720
|
}
|
|
3739
3721
|
/* -------------- Done -------------- */
|
|
@@ -3932,18 +3914,20 @@ const LogReviewer = (props) => {
|
|
|
3932
3914
|
startsHidden: true,
|
|
3933
3915
|
},
|
|
3934
3916
|
];
|
|
3917
|
+
// Nothing to show notice
|
|
3918
|
+
const noLogsNotice = (logs.length === 0
|
|
3919
|
+
? (React.createElement("div", { className: "alert alert-warning text-center mt-2" },
|
|
3920
|
+
React.createElement("h4", { className: "m-1" }, "No Logs to Show"),
|
|
3921
|
+
React.createElement("div", null, "Either your filters are too strict or no matching logs have been created yet.")))
|
|
3922
|
+
: undefined);
|
|
3935
3923
|
// Create intelliTable
|
|
3936
|
-
const dataTable = (
|
|
3937
|
-
? (React.createElement(React.Fragment, null,
|
|
3938
|
-
React.createElement("h3", { className: "m-0" }, "Matching Logs:"),
|
|
3939
|
-
React.createElement("div", { className: "alert alert-warning text-center" },
|
|
3940
|
-
React.createElement("h4", { className: "m-1" }, "No Logs to Show"),
|
|
3941
|
-
React.createElement("div", null, "Either your filters are too strict or no matching logs have been created yet."))))
|
|
3942
|
-
: (React.createElement(IntelliTable, { title: "Matching Logs:", id: "logs", data: logs, columns: columns })));
|
|
3924
|
+
const dataTable = (React.createElement(IntelliTable, { title: "Matching Logs:", id: "logs", data: logs, columns: columns }));
|
|
3943
3925
|
// Main body
|
|
3944
3926
|
body = (React.createElement(React.Fragment, null,
|
|
3945
3927
|
filters,
|
|
3946
|
-
React.createElement("div", { className: "mt-2" },
|
|
3928
|
+
React.createElement("div", { className: "mt-2" },
|
|
3929
|
+
dataTable,
|
|
3930
|
+
noLogsNotice)));
|
|
3947
3931
|
}
|
|
3948
3932
|
/* ---------- Wrap in Modal --------- */
|
|
3949
3933
|
return (React.createElement("div", { className: "LogReviewer-outer-container" },
|