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

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.2.2-beta.33",
3
+ "version": "3.2.2-beta.34",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -84,8 +84,8 @@ const CSVDownloadButton: React.FC<Props> = (props) => {
84
84
  <>
85
85
  <FontAwesomeIcon
86
86
  icon={faCloudDownloadAlt}
87
- className="mr-2"
88
87
  />
88
+ {' '}
89
89
  Download CSV
90
90
  </>
91
91
  )}
@@ -302,6 +302,10 @@ const IntelliTable: React.FC<Props> = (props) => {
302
302
  scope="col"
303
303
  id={`IntelliTable-${id}-header-${column.param}`}
304
304
  className="text-start"
305
+ style={{
306
+ borderRight: '0.05rem solid #555',
307
+ borderLeft: '0.05rem solid #555',
308
+ }}
305
309
  >
306
310
  <div className="d-flex align-items-center justify-content-center flex-row h-100">
307
311
  {/* Title */}
@@ -376,10 +380,10 @@ const IntelliTable: React.FC<Props> = (props) => {
376
380
  // > String
377
381
  if (paramType === ParamType.String) {
378
382
  if (aVal < bVal) {
379
- return (descending ? -1 : 1);
383
+ return (descending ? 1 : -1);
380
384
  }
381
385
  if (aVal > bVal) {
382
- return (descending ? 1 : -1);
386
+ return (descending ? -1 : 1);
383
387
  }
384
388
  return 0;
385
389
  }
@@ -473,7 +477,11 @@ const IntelliTable: React.FC<Props> = (props) => {
473
477
  title = String(fullValue);
474
478
  } else if (column.type === ParamType.String) {
475
479
  fullValue = String(value).trim();
476
- const noValue = (String(fullValue).trim().length === 0);
480
+ const noValue = (
481
+ value === undefined
482
+ || value === null
483
+ || String(fullValue).trim().length === 0
484
+ );
477
485
  visibleValue = (
478
486
  noValue
479
487
  ? (
@@ -507,6 +515,10 @@ const IntelliTable: React.FC<Props> = (props) => {
507
515
  <td
508
516
  key={`${datum.id}-${column.param}`}
509
517
  title={title}
518
+ style={{
519
+ borderRight: '0.05rem solid #555',
520
+ borderLeft: '0.05rem solid #555',
521
+ }}
510
522
  >
511
523
  {visibleValue}
512
524
  </td>
@@ -553,8 +565,10 @@ const IntelliTable: React.FC<Props> = (props) => {
553
565
  // Build main UI
554
566
  return (
555
567
  <div className={`IntelliTable-container-${id}`}>
568
+ {/* Modal */}
569
+ {modal}
556
570
  {/* Header */}
557
- <div className="d-flex align-items-center justify-content-center">
571
+ <div className="d-flex align-items-center justify-content-start">
558
572
  {/* Title */}
559
573
  <h3 className="m-0">
560
574
  {title}
@@ -595,7 +609,7 @@ const IntelliTable: React.FC<Props> = (props) => {
595
609
  </div>
596
610
  {/* Table */}
597
611
  <div
598
- className={`IntelliTable-table-${id}`}
612
+ className={`IntelliTable-table-${id} mt-2`}
599
613
  style={{
600
614
  overflowX: 'auto',
601
615
  }}
@@ -592,8 +592,8 @@ const LogReviewer: React.FC<Props> = (props) => {
592
592
 
593
593
  // Create initial tag filter state
594
594
  const initTagFilterState: TagFilterState = {};
595
- Object.values(LogMetadata.Tag ?? {}).forEach((tagValue) => {
596
- initTagFilterState[tagValue] = false;
595
+ Object.keys(LogMetadata.Tag ?? {}).forEach((tag) => {
596
+ initTagFilterState[tag] = false;
597
597
  });
598
598
 
599
599
  // Create advanced filter state
@@ -1055,7 +1055,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1055
1055
  filterDrawer = (
1056
1056
  <TabBox title="Tags">
1057
1057
  {
1058
- Object.keys(tagFilterState)
1058
+ Object.keys(LogMetadata.Tag ?? {})
1059
1059
  .map((tag, i) => {
1060
1060
  const description = genHumanReadableName(tag);
1061
1061
  return (
@@ -1966,13 +1966,13 @@ const LogReviewer: React.FC<Props> = (props) => {
1966
1966
  type: ParamType.Boolean,
1967
1967
  },
1968
1968
  {
1969
- title: 'Teaching Staff',
1969
+ title: 'Teaching Staff?',
1970
1970
  param: 'isTTM',
1971
1971
  type: ParamType.Boolean,
1972
1972
  startsHidden: true,
1973
1973
  },
1974
1974
  {
1975
- title: 'Admin',
1975
+ title: 'Admin?',
1976
1976
  param: 'isAdmin',
1977
1977
  type: ParamType.Boolean,
1978
1978
  startsHidden: true,
@@ -2007,7 +2007,7 @@ const LogReviewer: React.FC<Props> = (props) => {
2007
2007
  startsHidden: true,
2008
2008
  },
2009
2009
  {
2010
- title: 'Mobile',
2010
+ title: 'Mobile?',
2011
2011
  param: 'device.isMobile',
2012
2012
  type: ParamType.Boolean,
2013
2013
  startsHidden: true,