dce-reactkit 3.2.2-beta.31 → 3.2.2-beta.33

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 CHANGED
@@ -2216,12 +2216,12 @@ const roundToNumDecimals = (num, numDecimals) => {
2216
2216
  * @returns escaped cell text
2217
2217
  */
2218
2218
  const escapeCellText = (text) => {
2219
- if (!text.includes(',')) {
2219
+ if (!String(text).includes(',')) {
2220
2220
  // No need to escape
2221
- return text;
2221
+ return String(text);
2222
2222
  }
2223
2223
  // Perform escape
2224
- return `"${text.replace(/"/g, '""')}`;
2224
+ return `"${String(text).replace(/"/g, '""')}`;
2225
2225
  };
2226
2226
  /**
2227
2227
  * Generate a CSV file
@@ -2242,7 +2242,23 @@ const genCSV = (data, columns) => {
2242
2242
  data.forEach((datum) => {
2243
2243
  csv += (columns
2244
2244
  .map((column) => {
2245
- return escapeCellText(datum[column.param]);
2245
+ let contents;
2246
+ const cell = datum[column.param];
2247
+ if (typeof cell === 'string'
2248
+ || typeof cell === 'number') {
2249
+ contents = String(cell);
2250
+ }
2251
+ else if (typeof cell === 'undefined'
2252
+ || cell === null) {
2253
+ contents = '';
2254
+ }
2255
+ else if (typeof cell === 'object') {
2256
+ contents = JSON.stringify(cell);
2257
+ }
2258
+ else {
2259
+ contents = '';
2260
+ }
2261
+ return escapeCellText(contents);
2246
2262
  })
2247
2263
  .join(','));
2248
2264
  });
@@ -2391,6 +2407,7 @@ const IntelliTable = (props) => {
2391
2407
  // Custom info based on current sort type
2392
2408
  let sortButtonAriaLabel;
2393
2409
  let sortIcon = freeSolidSvgIcons.faSort;
2410
+ let sortingByThisColumn = false;
2394
2411
  if (!sortColumnParam) {
2395
2412
  // Not being sorted yet
2396
2413
  sortButtonAriaLabel = `sort ascending by ${column.title}`;
@@ -2398,6 +2415,7 @@ const IntelliTable = (props) => {
2398
2415
  }
2399
2416
  else if (column.param === sortColumnParam) {
2400
2417
  // Already sorted by this column
2418
+ sortingByThisColumn = true;
2401
2419
  if (sortType === SortType.Ascending) {
2402
2420
  // Sorted ascending
2403
2421
  sortButtonAriaLabel = `sort descending by ${column.title}`;
@@ -2415,11 +2433,11 @@ const IntelliTable = (props) => {
2415
2433
  sortIcon = freeSolidSvgIcons.faSort;
2416
2434
  }
2417
2435
  // Create the cell UI
2418
- return (React__default["default"].createElement("th", { key: column.param, scope: "col", id: `IntelliTable-${id}-header-${column.param}` },
2436
+ return (React__default["default"].createElement("th", { key: column.param, scope: "col", id: `IntelliTable-${id}-header-${column.param}`, className: "text-start" },
2419
2437
  React__default["default"].createElement("div", { className: "d-flex align-items-center justify-content-center flex-row h-100" },
2420
2438
  React__default["default"].createElement("span", { className: "text-nowrap" }, column.title),
2421
2439
  React__default["default"].createElement("div", null,
2422
- React__default["default"].createElement("button", { type: "button", className: "btn btn-light btn-sm ms-1", "aria-label": sortButtonAriaLabel, onClick: () => {
2440
+ React__default["default"].createElement("button", { type: "button", id: `IntelliTable-${id}-sort-by-${column.param}-button`, className: `btn btn-${sortingByThisColumn ? 'light' : 'secondary'} btn-sm ms-1 ps-1 pe-1 pt-0 pb-0`, "aria-label": sortButtonAriaLabel, onClick: () => {
2423
2441
  dispatch({
2424
2442
  type: ActionType$1.ToggleSortColumn,
2425
2443
  param: column.param,
@@ -3715,7 +3733,7 @@ const LogReviewer = (props) => {
3715
3733
  type: ParamType$1.Int,
3716
3734
  },
3717
3735
  {
3718
- title: 'Student',
3736
+ title: 'Student?',
3719
3737
  param: 'isLearner',
3720
3738
  type: ParamType$1.Boolean,
3721
3739
  },
@@ -4891,7 +4909,7 @@ const genRouteHandler = (opts) => {
4891
4909
  isAdmin: !!launchInfo.isAdmin,
4892
4910
  isTTM: !!launchInfo.isTTM,
4893
4911
  courseId: launchInfo.courseId,
4894
- courseName: launchInfo.courseName,
4912
+ courseName: launchInfo.contextLabel,
4895
4913
  browser,
4896
4914
  device,
4897
4915
  year,