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.
@@ -7,6 +7,7 @@ declare type Props = {
7
7
  label: string;
8
8
  minLabelWidth?: string;
9
9
  children: React.ReactNode;
10
+ className?: string;
10
11
  };
11
12
  declare const ButtonInputGroup: React.FC<Props>;
12
13
  export default ButtonInputGroup;
@@ -13,6 +13,7 @@ declare type Props = {
13
13
  * values updated
14
14
  */
15
15
  onChanged: (updatedItems: PickableItem[]) => void;
16
+ noBottomMargin?: boolean;
16
17
  };
17
18
  declare const ItemPicker: React.FC<Props>;
18
19
  export default ItemPicker;
@@ -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 admins] info on which admins can review
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
@@ -10,7 +10,7 @@ declare const LogBuiltInMetadata: {
10
10
  ClientFatalError: string;
11
11
  };
12
12
  Target: {
13
- NoSpecificTarget: string;
13
+ NoTarget: string;
14
14
  };
15
15
  };
16
16
  export default LogBuiltInMetadata;
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 admins] info on which admins can review
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
- NoSpecificTarget: string;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.2.2-beta.2",
3
+ "version": "3.2.2-beta.20",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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="input-group">
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
- <h4 className="m-0">
305
+ <span className="text-nowrap">
306
306
  {column.title}
307
- </h4>
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