dce-reactkit 3.2.2-beta.2 → 3.2.2-beta.20
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 +338 -186
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ButtonInputGroup.d.ts +1 -0
- package/dist/cjs/types/components/ItemPicker/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/cjs/types/server/initServer.d.ts +1 -1
- package/dist/cjs/types/types/LogBuiltInMetadata.d.ts +1 -1
- package/dist/esm/index.js +338 -187
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ButtonInputGroup.d.ts +1 -0
- package/dist/esm/types/components/ItemPicker/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/esm/types/server/initServer.d.ts +1 -1
- package/dist/esm/types/types/LogBuiltInMetadata.d.ts +1 -1
- package/dist/index.d.ts +12 -3
- package/package.json +1 -1
- package/src/components/ButtonInputGroup.tsx +4 -1
- package/src/components/IntelliTable.tsx +4 -4
- package/src/components/ItemPicker/index.tsx +4 -0
- package/src/components/LogReviewer.tsx +280 -130
- package/src/components/SimpleDateChooser.tsx +20 -7
- package/src/constants/LOG_REVIEW_STATUS_ROUTE.ts +1 -1
- package/src/helpers/genRouteHandler.ts +1 -1
- package/src/helpers/logClientEvent.tsx +6 -1
- package/src/index.ts +2 -0
- package/src/server/initServer.ts +93 -73
- package/src/types/LogBuiltInMetadata.ts +5 -5
|
@@ -48,6 +48,7 @@ import logClientEvent from './helpers/logClientEvent';
|
|
|
48
48
|
import initLogCollection from './server/initLogCollection';
|
|
49
49
|
import getMonthName from './helpers/getMonthName';
|
|
50
50
|
import genCSV from './helpers/genCSV';
|
|
51
|
+
import canReviewLogs from './helpers/canReviewLogs';
|
|
51
52
|
import ModalButtonType from './types/ModalButtonType';
|
|
52
53
|
import ModalSize from './types/ModalSize';
|
|
53
54
|
import ModalType from './types/ModalType';
|
|
@@ -63,4 +64,4 @@ import LogBuiltInMetadata from './types/LogBuiltInMetadata';
|
|
|
63
64
|
import LogMetadataType from './types/LogMetadataType';
|
|
64
65
|
import IntelliTableColumn from './types/IntelliTableColumn';
|
|
65
66
|
import PickableItem from './components/ItemPicker/types/PickableItem';
|
|
66
|
-
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, visitServerEndpoint, logClientEvent, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, ParamType, };
|
|
67
|
+
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, visitServerEndpoint, logClientEvent, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, ParamType, };
|
|
@@ -25,7 +25,7 @@ export declare const internalGetLogCollection: () => any;
|
|
|
25
25
|
* @param opts.getLaunchInfo CACCL LTI's get launch info function
|
|
26
26
|
* @param [opts.logCollection] mongo collection from dce-mango to use for
|
|
27
27
|
* storing logs. If none is included, logs are written to the console
|
|
28
|
-
* @param [opts.logReviewAdmins=all
|
|
28
|
+
* @param [opts.logReviewAdmins=all] info on which admins can review
|
|
29
29
|
* logs from the client. If not included, all Canvas admins are allowed to
|
|
30
30
|
* review logs. If null, no Canvas admins are allowed to review logs.
|
|
31
31
|
* If an array of Canvas userIds (numbers), only Canvas admins with those
|
package/dist/index.d.ts
CHANGED
|
@@ -242,6 +242,7 @@ declare type Props$a = {
|
|
|
242
242
|
label: string;
|
|
243
243
|
minLabelWidth?: string;
|
|
244
244
|
children: React.ReactNode;
|
|
245
|
+
className?: string;
|
|
245
246
|
};
|
|
246
247
|
declare const ButtonInputGroup: React.FC<Props$a>;
|
|
247
248
|
|
|
@@ -363,6 +364,7 @@ declare type Props$3 = {
|
|
|
363
364
|
* values updated
|
|
364
365
|
*/
|
|
365
366
|
onChanged: (updatedItems: PickableItem[]) => void;
|
|
367
|
+
noBottomMargin?: boolean;
|
|
366
368
|
};
|
|
367
369
|
declare const ItemPicker: React.FC<Props$3>;
|
|
368
370
|
|
|
@@ -822,7 +824,7 @@ declare type GetLaunchInfoFunction = (req: any) => {
|
|
|
822
824
|
* @param opts.getLaunchInfo CACCL LTI's get launch info function
|
|
823
825
|
* @param [opts.logCollection] mongo collection from dce-mango to use for
|
|
824
826
|
* storing logs. If none is included, logs are written to the console
|
|
825
|
-
* @param [opts.logReviewAdmins=all
|
|
827
|
+
* @param [opts.logReviewAdmins=all] info on which admins can review
|
|
826
828
|
* logs from the client. If not included, all Canvas admins are allowed to
|
|
827
829
|
* review logs. If null, no Canvas admins are allowed to review logs.
|
|
828
830
|
* If an array of Canvas userIds (numbers), only Canvas admins with those
|
|
@@ -975,6 +977,13 @@ declare const genCSV: (data: {
|
|
|
975
977
|
param: string;
|
|
976
978
|
}[]) => string;
|
|
977
979
|
|
|
980
|
+
/**
|
|
981
|
+
* Check if the current user can review logs
|
|
982
|
+
* @author Gabe Abrams
|
|
983
|
+
* @returns true if current user can review logs
|
|
984
|
+
*/
|
|
985
|
+
declare const canReviewLogs: () => Promise<boolean>;
|
|
986
|
+
|
|
978
987
|
/**
|
|
979
988
|
* List of error codes built into the react kit
|
|
980
989
|
* @author Gabe Abrams
|
|
@@ -1019,8 +1028,8 @@ declare const LogBuiltInMetadata: {
|
|
|
1019
1028
|
ClientFatalError: string;
|
|
1020
1029
|
};
|
|
1021
1030
|
Target: {
|
|
1022
|
-
|
|
1031
|
+
NoTarget: string;
|
|
1023
1032
|
};
|
|
1024
1033
|
};
|
|
1025
1034
|
|
|
1026
|
-
export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DayOfWeek, Drawer, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogMetadataType, LogReviewer, LogSource, LogType, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, TabBox, Variant, abbreviate, alert, avg, ceilToNumDecimals, confirm, floorToNumDecimals, forceNumIntoBounds, genCSV, genRouteHandler, getHumanReadableDate, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, initLogCollection, initServer, logClientEvent, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, visitServerEndpoint, waitMs };
|
|
1035
|
+
export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DayOfWeek, Drawer, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogMetadataType, LogReviewer, LogSource, LogType, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, TabBox, Variant, abbreviate, alert, avg, canReviewLogs, ceilToNumDecimals, confirm, floorToNumDecimals, forceNumIntoBounds, genCSV, genRouteHandler, getHumanReadableDate, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, initLogCollection, initServer, logClientEvent, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, visitServerEndpoint, waitMs };
|
package/package.json
CHANGED
|
@@ -18,6 +18,8 @@ type Props = {
|
|
|
18
18
|
minLabelWidth?: string,
|
|
19
19
|
// Buttons
|
|
20
20
|
children: React.ReactNode,
|
|
21
|
+
// Additional class names to add to the outer container
|
|
22
|
+
className?: string,
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
/*------------------------------------------------------------------------*/
|
|
@@ -36,6 +38,7 @@ const ButtonInputGroup: React.FC<Props> = (props) => {
|
|
|
36
38
|
label,
|
|
37
39
|
minLabelWidth,
|
|
38
40
|
children,
|
|
41
|
+
className,
|
|
39
42
|
} = props;
|
|
40
43
|
|
|
41
44
|
/*------------------------------------------------------------------------*/
|
|
@@ -47,7 +50,7 @@ const ButtonInputGroup: React.FC<Props> = (props) => {
|
|
|
47
50
|
/*----------------------------------------*/
|
|
48
51
|
|
|
49
52
|
return (
|
|
50
|
-
<div className=
|
|
53
|
+
<div className={`input-group ${className ?? ''}`}>
|
|
51
54
|
<div className="input-group-prepend d-flex w-100">
|
|
52
55
|
{/* Label */}
|
|
53
56
|
<span
|
|
@@ -302,14 +302,14 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
302
302
|
>
|
|
303
303
|
<div className="d-flex align-items-center justify-content-center flex-row h-100">
|
|
304
304
|
{/* Title */}
|
|
305
|
-
<
|
|
305
|
+
<span className="text-nowrap">
|
|
306
306
|
{column.title}
|
|
307
|
-
</
|
|
307
|
+
</span>
|
|
308
308
|
{/* Buttons */}
|
|
309
309
|
<div>
|
|
310
310
|
<button
|
|
311
311
|
type="button"
|
|
312
|
-
className="btn btn-light"
|
|
312
|
+
className="btn btn-light btn-sm ms-1"
|
|
313
313
|
aria-label={sortButtonAriaLabel}
|
|
314
314
|
onClick={() => {
|
|
315
315
|
dispatch({
|
|
@@ -567,7 +567,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
567
567
|
{/* Show/Hide Columns */}
|
|
568
568
|
<button
|
|
569
569
|
type="button"
|
|
570
|
-
className="btn btn-secondary"
|
|
570
|
+
className="btn btn-secondary ms-2"
|
|
571
571
|
aria-label={`show panel for customizing which columns show in table ${title}`}
|
|
572
572
|
id={`IntelliTable-${id}-show-column-customization-modal`}
|
|
573
573
|
onClick={() => {
|
|
@@ -31,6 +31,8 @@ type Props = {
|
|
|
31
31
|
* values updated
|
|
32
32
|
*/
|
|
33
33
|
onChanged: (updatedItems: PickableItem[]) => void,
|
|
34
|
+
// If true, don't add margin to bottom of item picker
|
|
35
|
+
noBottomMargin?: boolean,
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
/*------------------------------------------------------------------------*/
|
|
@@ -49,6 +51,7 @@ const ItemPicker: React.FC<Props> = (props) => {
|
|
|
49
51
|
title,
|
|
50
52
|
items,
|
|
51
53
|
onChanged,
|
|
54
|
+
noBottomMargin,
|
|
52
55
|
} = props;
|
|
53
56
|
|
|
54
57
|
/*------------------------------------------------------------------------*/
|
|
@@ -66,6 +69,7 @@ const ItemPicker: React.FC<Props> = (props) => {
|
|
|
66
69
|
return (
|
|
67
70
|
<TabBox
|
|
68
71
|
title={title}
|
|
72
|
+
noBottomMargin={noBottomMargin}
|
|
69
73
|
>
|
|
70
74
|
<div style={{ overflowX: 'auto' }}>
|
|
71
75
|
<NestableItemList
|