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/cjs/index.js
CHANGED
|
@@ -1454,14 +1454,16 @@ const Drawer = (props) => {
|
|
|
1454
1454
|
/*------------------------------------------------------------------------*/
|
|
1455
1455
|
/* -------------- Props ------------- */
|
|
1456
1456
|
// Destructure all props
|
|
1457
|
-
const { children, } = props;
|
|
1457
|
+
const { customBackgroundColor, children, } = props;
|
|
1458
1458
|
/*------------------------------------------------------------------------*/
|
|
1459
1459
|
/* Render */
|
|
1460
1460
|
/*------------------------------------------------------------------------*/
|
|
1461
1461
|
/*----------------------------------------*/
|
|
1462
1462
|
/* Main UI */
|
|
1463
1463
|
/*----------------------------------------*/
|
|
1464
|
-
return (React__default["default"].createElement("div", { className: "Drawer-container"
|
|
1464
|
+
return (React__default["default"].createElement("div", { className: "Drawer-container", style: {
|
|
1465
|
+
backgroundColor: (customBackgroundColor !== null && customBackgroundColor !== void 0 ? customBackgroundColor : undefined),
|
|
1466
|
+
} },
|
|
1465
1467
|
React__default["default"].createElement("style", null, style$4),
|
|
1466
1468
|
children));
|
|
1467
1469
|
};
|
|
@@ -2363,7 +2365,11 @@ const IntelliTable = (props) => {
|
|
|
2363
2365
|
var _a;
|
|
2364
2366
|
/* -------------- Props ------------- */
|
|
2365
2367
|
// Destructure all props
|
|
2366
|
-
const { title, id,
|
|
2368
|
+
const { title, id, columns, } = props;
|
|
2369
|
+
// Get data, show empty row if none
|
|
2370
|
+
const data = ((props.data && props.data.length > 0)
|
|
2371
|
+
? props.data
|
|
2372
|
+
: [{ id: 'empty-row' }]);
|
|
2367
2373
|
/* -------------- State ------------- */
|
|
2368
2374
|
// Initial state
|
|
2369
2375
|
const initColumnVisibilityMap = {};
|
|
@@ -3301,7 +3307,7 @@ const LogReviewer = (props) => {
|
|
|
3301
3307
|
} })),
|
|
3302
3308
|
React__default["default"].createElement("div", { className: "input-group mb-2" },
|
|
3303
3309
|
React__default["default"].createElement("span", { className: "input-group-text" }, "Error Code"),
|
|
3304
|
-
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error code", value: actionErrorFilterState.
|
|
3310
|
+
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error code", value: actionErrorFilterState.errorCode, onChange: (e) => {
|
|
3305
3311
|
actionErrorFilterState.errorCode = ((e.target.value)
|
|
3306
3312
|
.trim()
|
|
3307
3313
|
.toUpperCase());
|
|
@@ -3482,9 +3488,8 @@ const LogReviewer = (props) => {
|
|
|
3482
3488
|
Object.keys(logMap).forEach((year) => {
|
|
3483
3489
|
Object.keys(logMap[year]).forEach((month) => {
|
|
3484
3490
|
logMap[year][month].forEach((log) => {
|
|
3485
|
-
var _a;
|
|
3486
3491
|
/* ----------- Date Filter ---------- */
|
|
3487
|
-
|
|
3492
|
+
var _a;
|
|
3488
3493
|
// Before start date
|
|
3489
3494
|
if (
|
|
3490
3495
|
// Previous year
|
|
@@ -3496,7 +3501,6 @@ const LogReviewer = (props) => {
|
|
|
3496
3501
|
|| ((log.year === dateFilterState.startDate.year)
|
|
3497
3502
|
&& (log.month === dateFilterState.startDate.month)
|
|
3498
3503
|
&& (log.day < dateFilterState.startDate.day))) {
|
|
3499
|
-
console.log('RULED OUT: START');
|
|
3500
3504
|
return;
|
|
3501
3505
|
}
|
|
3502
3506
|
// After end date
|
|
@@ -3510,7 +3514,6 @@ const LogReviewer = (props) => {
|
|
|
3510
3514
|
|| ((log.year === dateFilterState.endDate.year)
|
|
3511
3515
|
&& (log.month === dateFilterState.endDate.month)
|
|
3512
3516
|
&& (log.day > dateFilterState.endDate.day))) {
|
|
3513
|
-
console.log('RULED OUT: END');
|
|
3514
3517
|
return;
|
|
3515
3518
|
}
|
|
3516
3519
|
/* --------- Context Filter --------- */
|
|
@@ -3527,7 +3530,6 @@ const LogReviewer = (props) => {
|
|
|
3527
3530
|
.every((isSelected) => {
|
|
3528
3531
|
return !isSelected;
|
|
3529
3532
|
}))) {
|
|
3530
|
-
console.log('RULED OUT: CONTEXT');
|
|
3531
3533
|
console.log(log.context, contextFilterState);
|
|
3532
3534
|
return;
|
|
3533
3535
|
}
|
|
@@ -3543,7 +3545,6 @@ const LogReviewer = (props) => {
|
|
|
3543
3545
|
&& contextFilterState[log.context] !== true)
|
|
3544
3546
|
// Subcontext is not selected
|
|
3545
3547
|
&& !contextFilterState[log.context][log.subcontext]) {
|
|
3546
|
-
console.log('RULED OUT: SUBCONTEXT');
|
|
3547
3548
|
return;
|
|
3548
3549
|
}
|
|
3549
3550
|
/* -------------- Tags -------------- */
|
|
@@ -3559,7 +3560,6 @@ const LogReviewer = (props) => {
|
|
|
3559
3560
|
&& log.tags.every((tag) => {
|
|
3560
3561
|
return !tagFilterState[tag];
|
|
3561
3562
|
})) {
|
|
3562
|
-
console.log('RULED OUT: TAGS');
|
|
3563
3563
|
return;
|
|
3564
3564
|
}
|
|
3565
3565
|
/* ------- Actions and Errors ------- */
|
|
@@ -3569,7 +3569,6 @@ const LogReviewer = (props) => {
|
|
|
3569
3569
|
actionErrorFilterState.type !== undefined
|
|
3570
3570
|
// Log type doesn't match
|
|
3571
3571
|
&& actionErrorFilterState.type !== log.type) {
|
|
3572
|
-
console.log('RULED OUT: TYPE');
|
|
3573
3572
|
return;
|
|
3574
3573
|
}
|
|
3575
3574
|
// Filter errors
|
|
@@ -3582,7 +3581,6 @@ const LogReviewer = (props) => {
|
|
|
3582
3581
|
&& actionErrorFilterState.errorMessage.trim().length > 0
|
|
3583
3582
|
// Message doesn't match
|
|
3584
3583
|
&& log.errorMessage.toLowerCase().includes(actionErrorFilterState.errorMessage.trim().toLowerCase())) {
|
|
3585
|
-
console.log('RULED OUT: ERROR MESSAGE');
|
|
3586
3584
|
return;
|
|
3587
3585
|
}
|
|
3588
3586
|
// Code doesn't match
|
|
@@ -3593,7 +3591,6 @@ const LogReviewer = (props) => {
|
|
|
3593
3591
|
&& actionErrorFilterState.errorCode.trim().length > 0
|
|
3594
3592
|
// Code doesn't match
|
|
3595
3593
|
&& log.errorCode.toUpperCase().includes(actionErrorFilterState.errorCode.trim().toUpperCase())) {
|
|
3596
|
-
console.log('RULED OUT: ERROR CODE');
|
|
3597
3594
|
return;
|
|
3598
3595
|
}
|
|
3599
3596
|
}
|
|
@@ -3605,7 +3602,6 @@ const LogReviewer = (props) => {
|
|
|
3605
3602
|
log.target
|
|
3606
3603
|
// Target isn't selected
|
|
3607
3604
|
&& !actionErrorFilterState.target[log.target]) {
|
|
3608
|
-
console.log('RULED OUT: TARGET');
|
|
3609
3605
|
return;
|
|
3610
3606
|
}
|
|
3611
3607
|
// Action
|
|
@@ -3614,7 +3610,6 @@ const LogReviewer = (props) => {
|
|
|
3614
3610
|
log.action
|
|
3615
3611
|
// Action isn't selected
|
|
3616
3612
|
&& !actionErrorFilterState.action[log.action]) {
|
|
3617
|
-
console.log('RULED OUT: ACTION');
|
|
3618
3613
|
return;
|
|
3619
3614
|
}
|
|
3620
3615
|
}
|
|
@@ -3625,7 +3620,6 @@ const LogReviewer = (props) => {
|
|
|
3625
3620
|
log.userFirstName
|
|
3626
3621
|
// First name query doesn't match
|
|
3627
3622
|
&& !log.userFirstName.toLowerCase().includes(advancedFilterState.userFirstName.toLowerCase().trim())) {
|
|
3628
|
-
console.log('RULED OUT: FIRST');
|
|
3629
3623
|
return;
|
|
3630
3624
|
}
|
|
3631
3625
|
// Last name doesn't match
|
|
@@ -3634,7 +3628,6 @@ const LogReviewer = (props) => {
|
|
|
3634
3628
|
log.userLastName
|
|
3635
3629
|
// Last name query doesn't match
|
|
3636
3630
|
&& !log.userLastName.toLowerCase().includes(advancedFilterState.userLastName.toLowerCase().trim())) {
|
|
3637
|
-
console.log('RULED OUT: LAST');
|
|
3638
3631
|
return;
|
|
3639
3632
|
}
|
|
3640
3633
|
// Email doesn't match
|
|
@@ -3643,7 +3636,6 @@ const LogReviewer = (props) => {
|
|
|
3643
3636
|
log.userEmail
|
|
3644
3637
|
// Email query doesn't match
|
|
3645
3638
|
&& !log.userEmail.toLowerCase().includes(advancedFilterState.userEmail.toLowerCase().trim())) {
|
|
3646
|
-
console.log('RULED OUT: EMAIL');
|
|
3647
3639
|
return;
|
|
3648
3640
|
}
|
|
3649
3641
|
// User id doesn't match
|
|
@@ -3652,7 +3644,6 @@ const LogReviewer = (props) => {
|
|
|
3652
3644
|
log.userId
|
|
3653
3645
|
// User id doesn't match
|
|
3654
3646
|
&& !String(log.userId).includes(advancedFilterState.userId.trim())) {
|
|
3655
|
-
console.log('RULED OUT: USER ID');
|
|
3656
3647
|
return;
|
|
3657
3648
|
}
|
|
3658
3649
|
// Learner not allowed
|
|
@@ -3661,7 +3652,6 @@ const LogReviewer = (props) => {
|
|
|
3661
3652
|
log.isLearner
|
|
3662
3653
|
// Learners aren't included
|
|
3663
3654
|
&& !advancedFilterState.includeLearners) {
|
|
3664
|
-
console.log('RULED OUT: LEARNER');
|
|
3665
3655
|
return;
|
|
3666
3656
|
}
|
|
3667
3657
|
// TTM not allowed
|
|
@@ -3670,7 +3660,6 @@ const LogReviewer = (props) => {
|
|
|
3670
3660
|
log.isTTM
|
|
3671
3661
|
// TTMs aren't included
|
|
3672
3662
|
&& !advancedFilterState.includeTTMs) {
|
|
3673
|
-
console.log('RULED OUT: TTM');
|
|
3674
3663
|
return;
|
|
3675
3664
|
}
|
|
3676
3665
|
// Admin not allowed
|
|
@@ -3679,7 +3668,6 @@ const LogReviewer = (props) => {
|
|
|
3679
3668
|
log.isAdmin
|
|
3680
3669
|
// Admins aren't included
|
|
3681
3670
|
&& !advancedFilterState.includeAdmins) {
|
|
3682
|
-
console.log('RULED OUT: ADMIN');
|
|
3683
3671
|
return;
|
|
3684
3672
|
}
|
|
3685
3673
|
// Course Id doesn't match
|
|
@@ -3688,7 +3676,6 @@ const LogReviewer = (props) => {
|
|
|
3688
3676
|
log.courseId
|
|
3689
3677
|
// Course Id doesn't match
|
|
3690
3678
|
&& !String(log.courseId).includes(advancedFilterState.courseId.trim())) {
|
|
3691
|
-
console.log('RULED OUT: COURSE ID');
|
|
3692
3679
|
return;
|
|
3693
3680
|
}
|
|
3694
3681
|
// Course name doesn't match
|
|
@@ -3697,7 +3684,6 @@ const LogReviewer = (props) => {
|
|
|
3697
3684
|
log.courseName
|
|
3698
3685
|
// Course name doesn't match
|
|
3699
3686
|
&& !String(log.courseName).includes(advancedFilterState.courseName.trim())) {
|
|
3700
|
-
console.log('RULED OUT: COURSE NAME');
|
|
3701
3687
|
return;
|
|
3702
3688
|
}
|
|
3703
3689
|
// Mobile filter doesn't match
|
|
@@ -3707,8 +3693,7 @@ const LogReviewer = (props) => {
|
|
|
3707
3693
|
// Device info exists
|
|
3708
3694
|
&& log.device
|
|
3709
3695
|
// Mobile filter doesn't match
|
|
3710
|
-
&& (advancedFilterState.isMobile
|
|
3711
|
-
console.log('RULED OUT: MOBILE');
|
|
3696
|
+
&& (advancedFilterState.isMobile !== log.device.isMobile)) {
|
|
3712
3697
|
return;
|
|
3713
3698
|
}
|
|
3714
3699
|
// Log source doesn't match
|
|
@@ -3719,7 +3704,6 @@ const LogReviewer = (props) => {
|
|
|
3719
3704
|
&& log.source
|
|
3720
3705
|
// Source filter doesn't match
|
|
3721
3706
|
&& (advancedFilterState.source !== log.source)) {
|
|
3722
|
-
console.log('RULED OUT: SOURCE');
|
|
3723
3707
|
return;
|
|
3724
3708
|
}
|
|
3725
3709
|
// Route path doesn't match (Only for server source)
|
|
@@ -3730,7 +3714,6 @@ const LogReviewer = (props) => {
|
|
|
3730
3714
|
&& (advancedFilterState.routePath.trim().length)
|
|
3731
3715
|
// Route path doesn't match
|
|
3732
3716
|
&& !(log.routePath.includes(advancedFilterState.routePath.trim()))) {
|
|
3733
|
-
console.log('RULED OUT: PATH');
|
|
3734
3717
|
return;
|
|
3735
3718
|
}
|
|
3736
3719
|
// Route template doesn't match (Only for server source)
|
|
@@ -3741,7 +3724,6 @@ const LogReviewer = (props) => {
|
|
|
3741
3724
|
&& (advancedFilterState.routeTemplate.trim().length)
|
|
3742
3725
|
// Route template doesn't match
|
|
3743
3726
|
&& !(log.routeTemplate.includes(advancedFilterState.routeTemplate.trim()))) {
|
|
3744
|
-
console.log('RULED OUT: TEMPLATE');
|
|
3745
3727
|
return;
|
|
3746
3728
|
}
|
|
3747
3729
|
/* -------------- Done -------------- */
|
|
@@ -3940,18 +3922,20 @@ const LogReviewer = (props) => {
|
|
|
3940
3922
|
startsHidden: true,
|
|
3941
3923
|
},
|
|
3942
3924
|
];
|
|
3925
|
+
// Nothing to show notice
|
|
3926
|
+
const noLogsNotice = (logs.length === 0
|
|
3927
|
+
? (React__default["default"].createElement("div", { className: "alert alert-warning text-center mt-2" },
|
|
3928
|
+
React__default["default"].createElement("h4", { className: "m-1" }, "No Logs to Show"),
|
|
3929
|
+
React__default["default"].createElement("div", null, "Either your filters are too strict or no matching logs have been created yet.")))
|
|
3930
|
+
: undefined);
|
|
3943
3931
|
// Create intelliTable
|
|
3944
|
-
const dataTable = (
|
|
3945
|
-
? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
3946
|
-
React__default["default"].createElement("h3", { className: "m-0" }, "Matching Logs:"),
|
|
3947
|
-
React__default["default"].createElement("div", { className: "alert alert-warning text-center" },
|
|
3948
|
-
React__default["default"].createElement("h4", { className: "m-1" }, "No Logs to Show"),
|
|
3949
|
-
React__default["default"].createElement("div", null, "Either your filters are too strict or no matching logs have been created yet."))))
|
|
3950
|
-
: (React__default["default"].createElement(IntelliTable, { title: "Matching Logs:", id: "logs", data: logs, columns: columns })));
|
|
3932
|
+
const dataTable = (React__default["default"].createElement(IntelliTable, { title: "Matching Logs:", id: "logs", data: logs, columns: columns }));
|
|
3951
3933
|
// Main body
|
|
3952
3934
|
body = (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
3953
3935
|
filters,
|
|
3954
|
-
React__default["default"].createElement("div", { className: "mt-2" },
|
|
3936
|
+
React__default["default"].createElement("div", { className: "mt-2" },
|
|
3937
|
+
dataTable,
|
|
3938
|
+
noLogsNotice)));
|
|
3955
3939
|
}
|
|
3956
3940
|
/* ---------- Wrap in Modal --------- */
|
|
3957
3941
|
return (React__default["default"].createElement("div", { className: "LogReviewer-outer-container" },
|