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/package.json
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
// Import shared helpers
|
|
22
22
|
import visitServerEndpoint from '../helpers/visitServerEndpoint';
|
|
23
23
|
import getTimeInfoInET from '../helpers/getTimeInfoInET';
|
|
24
|
-
import { showFatalError } from './AppWrapper';
|
|
24
|
+
import { alert, showFatalError } from './AppWrapper';
|
|
25
25
|
|
|
26
26
|
// Import shared constants
|
|
27
27
|
import LOG_REVIEW_ROUTE_PATH_PREFIX from '../constants/LOG_REVIEW_ROUTE_PATH_PREFIX';
|
|
@@ -459,9 +459,25 @@ const reducer = (state: State, action: Action): State => {
|
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
461
|
case ActionType.UpdateTagFilterState: {
|
|
462
|
+
const { tagFilterState } = action;
|
|
463
|
+
|
|
464
|
+
// Select all if every tag is deselected
|
|
465
|
+
const numTagsSelected = (
|
|
466
|
+
Object.values(tagFilterState)
|
|
467
|
+
.filter((isSelected) => {
|
|
468
|
+
return isSelected;
|
|
469
|
+
})
|
|
470
|
+
.length
|
|
471
|
+
);
|
|
472
|
+
if (numTagsSelected === 0) {
|
|
473
|
+
Object.keys(tagFilterState).forEach((tag) => {
|
|
474
|
+
tagFilterState[tag] = true;
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
|
|
462
478
|
return {
|
|
463
479
|
...state,
|
|
464
|
-
tagFilterState
|
|
480
|
+
tagFilterState,
|
|
465
481
|
};
|
|
466
482
|
}
|
|
467
483
|
case ActionType.UpdateActionErrorFilterState: {
|
|
@@ -875,6 +891,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
875
891
|
month={dateFilterState.startDate.month}
|
|
876
892
|
day={dateFilterState.startDate.day}
|
|
877
893
|
chooseFromPast
|
|
894
|
+
numMonthsToShow={12}
|
|
878
895
|
onChange={(month, day, year) => {
|
|
879
896
|
dateFilterState.startDate = { month, day, year };
|
|
880
897
|
handleDateRangeUpdated(dateFilterState);
|
|
@@ -890,7 +907,25 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
890
907
|
month={dateFilterState.endDate.month}
|
|
891
908
|
day={dateFilterState.endDate.day}
|
|
892
909
|
chooseFromPast
|
|
910
|
+
numMonthsToShow={12}
|
|
893
911
|
onChange={(month, day, year) => {
|
|
912
|
+
if (
|
|
913
|
+
year < dateFilterState.startDate.year
|
|
914
|
+
|| (
|
|
915
|
+
year === dateFilterState.startDate.year
|
|
916
|
+
&& month < dateFilterState.startDate.month
|
|
917
|
+
)
|
|
918
|
+
|| (
|
|
919
|
+
year === dateFilterState.startDate.year
|
|
920
|
+
&& month === dateFilterState.startDate.month
|
|
921
|
+
&& day < dateFilterState.startDate.day
|
|
922
|
+
)
|
|
923
|
+
) {
|
|
924
|
+
return alert(
|
|
925
|
+
'Invalid Start Date',
|
|
926
|
+
'The start date cannot be before the end date.',
|
|
927
|
+
);
|
|
928
|
+
}
|
|
894
929
|
dateFilterState.endDate = { month, day, year };
|
|
895
930
|
handleDateRangeUpdated(dateFilterState);
|
|
896
931
|
}}
|
|
@@ -1504,6 +1539,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1504
1539
|
Object.keys(logMap[year]).forEach((month) => {
|
|
1505
1540
|
logMap[year][month].forEach((log) => {
|
|
1506
1541
|
/* ----------- Date Filter ---------- */
|
|
1542
|
+
console.log('Log:', log);
|
|
1507
1543
|
|
|
1508
1544
|
// Before start date
|
|
1509
1545
|
if (
|
|
@@ -1521,6 +1557,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1521
1557
|
&& (log.day < dateFilterState.startDate.day)
|
|
1522
1558
|
)
|
|
1523
1559
|
) {
|
|
1560
|
+
console.log('RULED OUT: START');
|
|
1524
1561
|
return;
|
|
1525
1562
|
}
|
|
1526
1563
|
|
|
@@ -1540,6 +1577,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1540
1577
|
&& (log.day > dateFilterState.endDate.day)
|
|
1541
1578
|
)
|
|
1542
1579
|
) {
|
|
1580
|
+
console.log('RULED OUT: END');
|
|
1543
1581
|
return;
|
|
1544
1582
|
}
|
|
1545
1583
|
|
|
@@ -1557,6 +1595,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1557
1595
|
})
|
|
1558
1596
|
)
|
|
1559
1597
|
) {
|
|
1598
|
+
console.log('RULED OUT: CONTEXT');
|
|
1560
1599
|
return;
|
|
1561
1600
|
}
|
|
1562
1601
|
|
|
@@ -1573,6 +1612,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1573
1612
|
// Subcontext is not selected
|
|
1574
1613
|
&& !(contextFilterState as any)[log.context][log.subcontext]
|
|
1575
1614
|
) {
|
|
1615
|
+
console.log('RULED OUT: SUBCONTEXT');
|
|
1576
1616
|
return;
|
|
1577
1617
|
}
|
|
1578
1618
|
|
|
@@ -1580,15 +1620,11 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1580
1620
|
|
|
1581
1621
|
// No tags match
|
|
1582
1622
|
if (
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
&& (
|
|
1587
|
-
log.tags.every((tag) => {
|
|
1588
|
-
return !tagFilterState[tag];
|
|
1589
|
-
})
|
|
1590
|
-
)
|
|
1623
|
+
log.tags.every((tag) => {
|
|
1624
|
+
return !tagFilterState[tag];
|
|
1625
|
+
})
|
|
1591
1626
|
) {
|
|
1627
|
+
console.log('RULED OUT: TAGS');
|
|
1592
1628
|
return;
|
|
1593
1629
|
}
|
|
1594
1630
|
|
|
@@ -1601,6 +1637,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1601
1637
|
// Log type doesn't match
|
|
1602
1638
|
&& actionErrorFilterState.type !== log.type
|
|
1603
1639
|
) {
|
|
1640
|
+
console.log('RULED OUT: TYPE');
|
|
1604
1641
|
return;
|
|
1605
1642
|
}
|
|
1606
1643
|
|
|
@@ -1617,6 +1654,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1617
1654
|
actionErrorFilterState.errorMessage.trim().toLowerCase(),
|
|
1618
1655
|
)
|
|
1619
1656
|
) {
|
|
1657
|
+
console.log('RULED OUT: ERROR MESSAGE');
|
|
1620
1658
|
return;
|
|
1621
1659
|
}
|
|
1622
1660
|
|
|
@@ -1631,6 +1669,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1631
1669
|
actionErrorFilterState.errorCode.trim().toUpperCase(),
|
|
1632
1670
|
)
|
|
1633
1671
|
) {
|
|
1672
|
+
console.log('RULED OUT: ERROR CODE');
|
|
1634
1673
|
return;
|
|
1635
1674
|
}
|
|
1636
1675
|
}
|
|
@@ -1644,6 +1683,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1644
1683
|
// Target isn't selected
|
|
1645
1684
|
&& !actionErrorFilterState.target[log.target]
|
|
1646
1685
|
) {
|
|
1686
|
+
console.log('RULED OUT: TARGET');
|
|
1647
1687
|
return;
|
|
1648
1688
|
}
|
|
1649
1689
|
|
|
@@ -1654,6 +1694,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1654
1694
|
// Action isn't selected
|
|
1655
1695
|
&& !actionErrorFilterState.action[log.action]
|
|
1656
1696
|
) {
|
|
1697
|
+
console.log('RULED OUT: ACTION');
|
|
1657
1698
|
return;
|
|
1658
1699
|
}
|
|
1659
1700
|
}
|
|
@@ -1669,6 +1710,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1669
1710
|
advancedFilterState.userFirstName.toLowerCase().trim(),
|
|
1670
1711
|
)
|
|
1671
1712
|
) {
|
|
1713
|
+
console.log('RULED OUT: FIRST');
|
|
1672
1714
|
return;
|
|
1673
1715
|
}
|
|
1674
1716
|
|
|
@@ -1681,6 +1723,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1681
1723
|
advancedFilterState.userLastName.toLowerCase().trim(),
|
|
1682
1724
|
)
|
|
1683
1725
|
) {
|
|
1726
|
+
console.log('RULED OUT: LAST');
|
|
1684
1727
|
return;
|
|
1685
1728
|
}
|
|
1686
1729
|
|
|
@@ -1693,6 +1736,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1693
1736
|
advancedFilterState.userEmail.toLowerCase().trim(),
|
|
1694
1737
|
)
|
|
1695
1738
|
) {
|
|
1739
|
+
console.log('RULED OUT: EMAIL');
|
|
1696
1740
|
return;
|
|
1697
1741
|
}
|
|
1698
1742
|
|
|
@@ -1705,6 +1749,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1705
1749
|
advancedFilterState.userId.trim(),
|
|
1706
1750
|
)
|
|
1707
1751
|
) {
|
|
1752
|
+
console.log('RULED OUT: USER ID');
|
|
1708
1753
|
return;
|
|
1709
1754
|
}
|
|
1710
1755
|
|
|
@@ -1715,6 +1760,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1715
1760
|
// Learners aren't included
|
|
1716
1761
|
&& !advancedFilterState.includeLearners
|
|
1717
1762
|
) {
|
|
1763
|
+
console.log('RULED OUT: LEARNER');
|
|
1718
1764
|
return;
|
|
1719
1765
|
}
|
|
1720
1766
|
|
|
@@ -1725,6 +1771,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1725
1771
|
// TTMs aren't included
|
|
1726
1772
|
&& !advancedFilterState.includeTTMs
|
|
1727
1773
|
) {
|
|
1774
|
+
console.log('RULED OUT: TTM');
|
|
1728
1775
|
return;
|
|
1729
1776
|
}
|
|
1730
1777
|
|
|
@@ -1735,6 +1782,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1735
1782
|
// Admins aren't included
|
|
1736
1783
|
&& !advancedFilterState.includeAdmins
|
|
1737
1784
|
) {
|
|
1785
|
+
console.log('RULED OUT: ADMIN');
|
|
1738
1786
|
return;
|
|
1739
1787
|
}
|
|
1740
1788
|
|
|
@@ -1747,6 +1795,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1747
1795
|
advancedFilterState.courseId.trim(),
|
|
1748
1796
|
)
|
|
1749
1797
|
) {
|
|
1798
|
+
console.log('RULED OUT: COURSE ID');
|
|
1750
1799
|
return;
|
|
1751
1800
|
}
|
|
1752
1801
|
|
|
@@ -1759,6 +1808,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1759
1808
|
advancedFilterState.courseName.trim(),
|
|
1760
1809
|
)
|
|
1761
1810
|
) {
|
|
1811
|
+
console.log('RULED OUT: COURSE NAME');
|
|
1762
1812
|
return;
|
|
1763
1813
|
}
|
|
1764
1814
|
|
|
@@ -1771,6 +1821,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1771
1821
|
// Mobile filter doesn't match
|
|
1772
1822
|
&& (advancedFilterState.isMobile === log.device.isMobile)
|
|
1773
1823
|
) {
|
|
1824
|
+
console.log('RULED OUT: MOBILE');
|
|
1774
1825
|
return;
|
|
1775
1826
|
}
|
|
1776
1827
|
|
|
@@ -1783,6 +1834,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1783
1834
|
// Source filter doesn't match
|
|
1784
1835
|
&& (advancedFilterState.source !== log.source)
|
|
1785
1836
|
) {
|
|
1837
|
+
console.log('RULED OUT: SOURCE');
|
|
1786
1838
|
return;
|
|
1787
1839
|
}
|
|
1788
1840
|
|
|
@@ -1795,6 +1847,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1795
1847
|
// Route path doesn't match
|
|
1796
1848
|
&& !(log.routePath.includes(advancedFilterState.routePath.trim()))
|
|
1797
1849
|
) {
|
|
1850
|
+
console.log('RULED OUT: PATH');
|
|
1798
1851
|
return;
|
|
1799
1852
|
}
|
|
1800
1853
|
|
|
@@ -1807,6 +1860,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1807
1860
|
// Route template doesn't match
|
|
1808
1861
|
&& !(log.routeTemplate.includes(advancedFilterState.routeTemplate.trim()))
|
|
1809
1862
|
) {
|
|
1863
|
+
console.log('RULED OUT: TEMPLATE');
|
|
1810
1864
|
return;
|
|
1811
1865
|
}
|
|
1812
1866
|
|