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.
Files changed (37) hide show
  1. package/dist/cjs/index.js +662 -771
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/Pagination.d.ts +13 -0
  4. package/dist/cjs/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +6 -0
  5. package/dist/cjs/types/helpers/cloneDeep.d.ts +8 -0
  6. package/dist/cjs/types/index.d.ts +4 -1
  7. package/dist/cjs/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +17 -0
  8. package/dist/cjs/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +21 -0
  9. package/dist/cjs/types/types/LogReviewerFilterState/ContextFilterState.d.ts +10 -0
  10. package/dist/cjs/types/types/LogReviewerFilterState/DateFilterState.d.ts +17 -0
  11. package/dist/cjs/types/types/LogReviewerFilterState/TagFilterState.d.ts +8 -0
  12. package/dist/cjs/types/types/LogReviewerFilterState/index.d.ts +17 -0
  13. package/dist/esm/index.js +661 -773
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/esm/types/components/Pagination.d.ts +13 -0
  16. package/dist/esm/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +6 -0
  17. package/dist/esm/types/helpers/cloneDeep.d.ts +8 -0
  18. package/dist/esm/types/index.d.ts +4 -1
  19. package/dist/esm/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +17 -0
  20. package/dist/esm/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +21 -0
  21. package/dist/esm/types/types/LogReviewerFilterState/ContextFilterState.d.ts +10 -0
  22. package/dist/esm/types/types/LogReviewerFilterState/DateFilterState.d.ts +17 -0
  23. package/dist/esm/types/types/LogReviewerFilterState/TagFilterState.d.ts +8 -0
  24. package/dist/esm/types/types/LogReviewerFilterState/index.d.ts +17 -0
  25. package/dist/index.d.ts +98 -1
  26. package/package.json +2 -1
  27. package/src/components/LogReviewer.tsx +1133 -1307
  28. package/src/components/Pagination.tsx +172 -0
  29. package/src/constants/LOG_REVIEW_GET_LOGS_ROUTE.ts +9 -0
  30. package/src/helpers/cloneDeep.ts +11 -0
  31. package/src/index.ts +6 -0
  32. package/src/types/LogReviewerFilterState/ActionErrorFilterState.ts +24 -0
  33. package/src/types/LogReviewerFilterState/AdvancedFilterState.ts +36 -0
  34. package/src/types/LogReviewerFilterState/ContextFilterState.ts +16 -0
  35. package/src/types/LogReviewerFilterState/DateFilterState.ts +26 -0
  36. package/src/types/LogReviewerFilterState/TagFilterState.ts +9 -0
  37. 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;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Path of the route for getting logs for log review
3
+ * @author Gabe Abrams
4
+ */
5
+ declare const LOG_REVIEW_GET_LOGS_ROUTE: string;
6
+ export default LOG_REVIEW_GET_LOGS_ROUTE;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Deeply clones an object
3
+ * @author Yuen Ler Chow
4
+ * @param obj the object to clone
5
+ * @returns a deep clone of the object
6
+ */
7
+ declare const cloneDeep: <T>(obj: T) => T;
8
+ export default cloneDeep;
@@ -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,10 @@
1
+ /**
2
+ * Context filter state
3
+ * @author Yuen Ler Chow
4
+ */
5
+ type ContextFilterState = {
6
+ [k: string]: (boolean | {
7
+ [k: string]: boolean;
8
+ });
9
+ };
10
+ export default ContextFilterState;
@@ -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,8 @@
1
+ /**
2
+ * Tag filter state
3
+ * @author Yuen Ler Chow
4
+ */
5
+ type TagFilterState = {
6
+ [k: string]: boolean;
7
+ };
8
+ export default TagFilterState;
@@ -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;