dce-reactkit 4.0.1 → 4.1.0
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 +662 -771
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Pagination.d.ts +13 -0
- package/dist/cjs/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +6 -0
- package/dist/cjs/types/helpers/cloneDeep.d.ts +8 -0
- package/dist/cjs/types/index.d.ts +4 -1
- package/dist/cjs/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +17 -0
- package/dist/cjs/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +21 -0
- package/dist/cjs/types/types/LogReviewerFilterState/ContextFilterState.d.ts +10 -0
- package/dist/cjs/types/types/LogReviewerFilterState/DateFilterState.d.ts +17 -0
- package/dist/cjs/types/types/LogReviewerFilterState/TagFilterState.d.ts +8 -0
- package/dist/cjs/types/types/LogReviewerFilterState/index.d.ts +17 -0
- package/dist/esm/index.js +661 -773
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Pagination.d.ts +13 -0
- package/dist/esm/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +6 -0
- package/dist/esm/types/helpers/cloneDeep.d.ts +8 -0
- package/dist/esm/types/index.d.ts +4 -1
- package/dist/esm/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +17 -0
- package/dist/esm/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +21 -0
- package/dist/esm/types/types/LogReviewerFilterState/ContextFilterState.d.ts +10 -0
- package/dist/esm/types/types/LogReviewerFilterState/DateFilterState.d.ts +17 -0
- package/dist/esm/types/types/LogReviewerFilterState/TagFilterState.d.ts +8 -0
- package/dist/esm/types/types/LogReviewerFilterState/index.d.ts +17 -0
- package/dist/index.d.ts +98 -1
- package/package.json +2 -1
- package/src/components/LogReviewer.tsx +1133 -1307
- package/src/components/Pagination.tsx +172 -0
- package/src/constants/LOG_REVIEW_GET_LOGS_ROUTE.ts +9 -0
- package/src/helpers/cloneDeep.ts +11 -0
- package/src/index.ts +6 -0
- package/src/types/LogReviewerFilterState/ActionErrorFilterState.ts +24 -0
- package/src/types/LogReviewerFilterState/AdvancedFilterState.ts +36 -0
- package/src/types/LogReviewerFilterState/ContextFilterState.ts +16 -0
- package/src/types/LogReviewerFilterState/DateFilterState.ts +26 -0
- package/src/types/LogReviewerFilterState/TagFilterState.ts +9 -0
- package/src/types/LogReviewerFilterState/index.ts +24 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
currentPage: number;
|
|
4
|
+
numPages: number;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Handler for when page is changed
|
|
8
|
+
* @param page - the new page number
|
|
9
|
+
*/
|
|
10
|
+
onPageChanged: (page: number) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const Pagination: React.FC<Props>;
|
|
13
|
+
export default Pagination;
|
|
@@ -30,6 +30,7 @@ import DAY_IN_MS from './constants/DAY_IN_MS';
|
|
|
30
30
|
import LOG_REVIEW_ROUTE_PATH_PREFIX from './constants/LOG_REVIEW_ROUTE_PATH_PREFIX';
|
|
31
31
|
import LOG_ROUTE_PATH from './constants/LOG_ROUTE_PATH';
|
|
32
32
|
import LOG_REVIEW_STATUS_ROUTE from './constants/LOG_REVIEW_STATUS_ROUTE';
|
|
33
|
+
import LOG_REVIEW_GET_LOGS_ROUTE from './constants/LOG_REVIEW_GET_LOGS_ROUTE';
|
|
33
34
|
import DynamicWord from './dynamicConstants/DynamicWord';
|
|
34
35
|
import initClient from './helpers/initClient';
|
|
35
36
|
import abbreviate from './helpers/abbreviate';
|
|
@@ -77,6 +78,7 @@ import someAsync from './helpers/asyncArrayFunctions/someAsync';
|
|
|
77
78
|
import capitalize from './helpers/capitalize';
|
|
78
79
|
import shuffleArray from './helpers/shuffleArray';
|
|
79
80
|
import getWordCount from './helpers/getWordCount';
|
|
81
|
+
import cloneDeep from './helpers/cloneDeep';
|
|
80
82
|
import ParamType from './types/ParamType';
|
|
81
83
|
import ModalButtonType from './types/ModalButtonType';
|
|
82
84
|
import ModalSize from './types/ModalSize';
|
|
@@ -97,8 +99,9 @@ import LogLevel from './types/LogLevel';
|
|
|
97
99
|
import IntelliTableColumn from './types/IntelliTableColumn';
|
|
98
100
|
import DropdownItemType from './types/DropdownItemType';
|
|
99
101
|
import ReactKitErrorCode from './types/ReactKitErrorCode';
|
|
102
|
+
import LogReviewerFilterState from './types/LogReviewerFilterState';
|
|
100
103
|
import PickableItem from './components/ItemPicker/types/PickableItem';
|
|
101
104
|
import DBEntry from './components/DBEntryManagerPanel/types/DBEntry';
|
|
102
105
|
import DBEntryField from './components/DBEntryManagerPanel/types/DBEntryField';
|
|
103
106
|
import DBEntryFieldType from './components/DBEntryManagerPanel/types/DBEntryFieldType';
|
|
104
|
-
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, SimpleTimeChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch, AutoscrollToBottomContainer, MultiSwitch, Dropdown, alert, prompt, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, LOG_REVIEW_ROUTE_PATH_PREFIX, LOG_ROUTE_PATH, LOG_REVIEW_STATUS_ROUTE, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, makeLinksClickable, prefixWithAOrAn, everyAsync, filterAsync, forEachAsync, mapAsync, someAsync, capitalize, shuffleArray, getWordCount, initClient, visitServerEndpoint, logClientEvent, addFatalErrorHandler, leaveToURL, combineClassNames, useForceRender, setClientEventMetadataPopulator, ParamType, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, LogFunction, LogTypeSpecificInfo, LogMainInfo, LogSourceSpecificInfo, LogLevel, IntelliTableColumn, DropdownItemType, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, };
|
|
107
|
+
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, SimpleTimeChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch, AutoscrollToBottomContainer, MultiSwitch, Dropdown, alert, prompt, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, LOG_REVIEW_ROUTE_PATH_PREFIX, LOG_ROUTE_PATH, LOG_REVIEW_STATUS_ROUTE, LOG_REVIEW_GET_LOGS_ROUTE, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, makeLinksClickable, prefixWithAOrAn, everyAsync, filterAsync, forEachAsync, mapAsync, someAsync, capitalize, shuffleArray, getWordCount, cloneDeep, initClient, visitServerEndpoint, logClientEvent, addFatalErrorHandler, leaveToURL, combineClassNames, useForceRender, setClientEventMetadataPopulator, ParamType, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, LogFunction, LogTypeSpecificInfo, LogMainInfo, LogSourceSpecificInfo, LogLevel, IntelliTableColumn, DropdownItemType, LogReviewerFilterState, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import LogType from '../LogType';
|
|
2
|
+
/**
|
|
3
|
+
* Action filter state (only relevant for action logs)
|
|
4
|
+
* @author Yuen Ler Chow
|
|
5
|
+
*/
|
|
6
|
+
type ActionErrorFilterState = {
|
|
7
|
+
type: LogType | undefined;
|
|
8
|
+
errorMessage: string;
|
|
9
|
+
errorCode: string;
|
|
10
|
+
target: {
|
|
11
|
+
[k: string]: boolean;
|
|
12
|
+
};
|
|
13
|
+
action: {
|
|
14
|
+
[k: string]: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default ActionErrorFilterState;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import LogSource from '../LogSource';
|
|
2
|
+
/**
|
|
3
|
+
* Advanced filter state
|
|
4
|
+
* @author Yuen Ler Chow
|
|
5
|
+
*/
|
|
6
|
+
type AdvancedFilterState = {
|
|
7
|
+
userFirstName: string;
|
|
8
|
+
userLastName: string;
|
|
9
|
+
userEmail: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
includeLearners: boolean;
|
|
12
|
+
includeTTMs: boolean;
|
|
13
|
+
includeAdmins: boolean;
|
|
14
|
+
courseId: string;
|
|
15
|
+
courseName: string;
|
|
16
|
+
isMobile: (true | false | undefined);
|
|
17
|
+
source: LogSource | undefined;
|
|
18
|
+
routePath: string;
|
|
19
|
+
routeTemplate: string;
|
|
20
|
+
};
|
|
21
|
+
export default AdvancedFilterState;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date filter state
|
|
3
|
+
* @author Yuen Ler Chow
|
|
4
|
+
*/
|
|
5
|
+
type DateFilterState = {
|
|
6
|
+
startDate: {
|
|
7
|
+
year: number;
|
|
8
|
+
month: number;
|
|
9
|
+
day: number;
|
|
10
|
+
};
|
|
11
|
+
endDate: {
|
|
12
|
+
year: number;
|
|
13
|
+
month: number;
|
|
14
|
+
day: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default DateFilterState;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import DateFilterState from './DateFilterState';
|
|
2
|
+
import ContextFilterState from './ContextFilterState';
|
|
3
|
+
import TagFilterState from './TagFilterState';
|
|
4
|
+
import ActionErrorFilterState from './ActionErrorFilterState';
|
|
5
|
+
import AdvancedFilterState from './AdvancedFilterState';
|
|
6
|
+
/**
|
|
7
|
+
* A bundle of filter state objects for each type of filter
|
|
8
|
+
* @author Gabe Abrams
|
|
9
|
+
*/
|
|
10
|
+
type LogReviewerFilterState = {
|
|
11
|
+
dateFilterState: DateFilterState;
|
|
12
|
+
contextFilterState: ContextFilterState;
|
|
13
|
+
tagFilterState: TagFilterState;
|
|
14
|
+
actionErrorFilterState: ActionErrorFilterState;
|
|
15
|
+
advancedFilterState: AdvancedFilterState;
|
|
16
|
+
};
|
|
17
|
+
export default LogReviewerFilterState;
|
package/dist/index.d.ts
CHANGED
|
@@ -815,6 +815,12 @@ declare const LOG_ROUTE_PATH: string;
|
|
|
815
815
|
*/
|
|
816
816
|
declare const LOG_REVIEW_STATUS_ROUTE: string;
|
|
817
817
|
|
|
818
|
+
/**
|
|
819
|
+
* Path of the route for getting logs for log review
|
|
820
|
+
* @author Gabe Abrams
|
|
821
|
+
*/
|
|
822
|
+
declare const LOG_REVIEW_GET_LOGS_ROUTE: string;
|
|
823
|
+
|
|
818
824
|
/**
|
|
819
825
|
* Dynamic words determined by the user's platform
|
|
820
826
|
* @author Gabe Abrams
|
|
@@ -1534,6 +1540,14 @@ declare const shuffleArray: <T>(arr: T[]) => T[];
|
|
|
1534
1540
|
*/
|
|
1535
1541
|
declare const getWordCount: (text: string) => number;
|
|
1536
1542
|
|
|
1543
|
+
/**
|
|
1544
|
+
* Deeply clones an object
|
|
1545
|
+
* @author Yuen Ler Chow
|
|
1546
|
+
* @param obj the object to clone
|
|
1547
|
+
* @returns a deep clone of the object
|
|
1548
|
+
*/
|
|
1549
|
+
declare const cloneDeep: <T>(obj: T) => T;
|
|
1550
|
+
|
|
1537
1551
|
/**
|
|
1538
1552
|
* Days of the week
|
|
1539
1553
|
* @author Gabe Abrams
|
|
@@ -1577,4 +1591,87 @@ declare enum ReactKitErrorCode {
|
|
|
1577
1591
|
SimpleDateChooserInvalidNumMonths = "DRK36"
|
|
1578
1592
|
}
|
|
1579
1593
|
|
|
1580
|
-
|
|
1594
|
+
/**
|
|
1595
|
+
* Date filter state
|
|
1596
|
+
* @author Yuen Ler Chow
|
|
1597
|
+
*/
|
|
1598
|
+
type DateFilterState = {
|
|
1599
|
+
startDate: {
|
|
1600
|
+
year: number;
|
|
1601
|
+
month: number;
|
|
1602
|
+
day: number;
|
|
1603
|
+
};
|
|
1604
|
+
endDate: {
|
|
1605
|
+
year: number;
|
|
1606
|
+
month: number;
|
|
1607
|
+
day: number;
|
|
1608
|
+
};
|
|
1609
|
+
};
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* Context filter state
|
|
1613
|
+
* @author Yuen Ler Chow
|
|
1614
|
+
*/
|
|
1615
|
+
type ContextFilterState = {
|
|
1616
|
+
[k: string]: (boolean | {
|
|
1617
|
+
[k: string]: boolean;
|
|
1618
|
+
});
|
|
1619
|
+
};
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* Tag filter state
|
|
1623
|
+
* @author Yuen Ler Chow
|
|
1624
|
+
*/
|
|
1625
|
+
type TagFilterState = {
|
|
1626
|
+
[k: string]: boolean;
|
|
1627
|
+
};
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* Action filter state (only relevant for action logs)
|
|
1631
|
+
* @author Yuen Ler Chow
|
|
1632
|
+
*/
|
|
1633
|
+
type ActionErrorFilterState = {
|
|
1634
|
+
type: LogType | undefined;
|
|
1635
|
+
errorMessage: string;
|
|
1636
|
+
errorCode: string;
|
|
1637
|
+
target: {
|
|
1638
|
+
[k: string]: boolean;
|
|
1639
|
+
};
|
|
1640
|
+
action: {
|
|
1641
|
+
[k: string]: boolean;
|
|
1642
|
+
};
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* Advanced filter state
|
|
1647
|
+
* @author Yuen Ler Chow
|
|
1648
|
+
*/
|
|
1649
|
+
type AdvancedFilterState = {
|
|
1650
|
+
userFirstName: string;
|
|
1651
|
+
userLastName: string;
|
|
1652
|
+
userEmail: string;
|
|
1653
|
+
userId: string;
|
|
1654
|
+
includeLearners: boolean;
|
|
1655
|
+
includeTTMs: boolean;
|
|
1656
|
+
includeAdmins: boolean;
|
|
1657
|
+
courseId: string;
|
|
1658
|
+
courseName: string;
|
|
1659
|
+
isMobile: (true | false | undefined);
|
|
1660
|
+
source: LogSource | undefined;
|
|
1661
|
+
routePath: string;
|
|
1662
|
+
routeTemplate: string;
|
|
1663
|
+
};
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* A bundle of filter state objects for each type of filter
|
|
1667
|
+
* @author Gabe Abrams
|
|
1668
|
+
*/
|
|
1669
|
+
type LogReviewerFilterState = {
|
|
1670
|
+
dateFilterState: DateFilterState;
|
|
1671
|
+
contextFilterState: ContextFilterState;
|
|
1672
|
+
tagFilterState: TagFilterState;
|
|
1673
|
+
actionErrorFilterState: ActionErrorFilterState;
|
|
1674
|
+
advancedFilterState: AdvancedFilterState;
|
|
1675
|
+
};
|
|
1676
|
+
|
|
1677
|
+
export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntry, DBEntryField, DBEntryFieldType, DBEntryManagerPanel, DayOfWeek, Drawer, Dropdown, DropdownItemType, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LOG_REVIEW_GET_LOGS_ROUTE, LOG_REVIEW_ROUTE_PATH_PREFIX, LOG_REVIEW_STATUS_ROUTE, LOG_ROUTE_PATH, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogFunction, LogLevel, LogMainInfo, LogMetadataType, LogReviewer, LogReviewerFilterState, LogSource, LogSourceSpecificInfo, LogType, LogTypeSpecificInfo, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, MultiSwitch, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, SimpleTimeChooser, TabBox, ToggleSwitch, Tooltip, Variant, abbreviate, addFatalErrorHandler, alert, avg, canReviewLogs, capitalize, ceilToNumDecimals, cloneDeep, combineClassNames, compareArraysByProp, confirm, everyAsync, extractProp, filterAsync, floorToNumDecimals, forEachAsync, forceNumIntoBounds, genCSV, genCommaList, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, getWordCount, idify, initClient, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, mapAsync, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, prompt, roundToNumDecimals, setClientEventMetadataPopulator, showFatalError, shuffleArray, someAsync, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, useForceRender, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dce-reactkit",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Shared components for Harvard DCE apps",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/harvard-edtech/dce-reactkit#readme",
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"nanoclone": "^1.0.2",
|
|
27
28
|
"react-select": "^5.7.3"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|