dce-reactkit 3.2.2-beta.26 → 3.2.2-beta.28

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.26",
3
+ "version": "3.2.2-beta.28",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -548,7 +548,6 @@ const LogReviewer: React.FC<Props> = (props) => {
548
548
  LogMetadata.Target[target] = target;
549
549
  }
550
550
  });
551
- console.log(LogMetadata);
552
551
 
553
552
  /* -------------- State ------------- */
554
553
 
@@ -574,16 +573,19 @@ const LogReviewer: React.FC<Props> = (props) => {
574
573
  Object.keys(LogMetadata.Context ?? {}).forEach((context) => {
575
574
  const contextValue = (LogMetadata.Context ?? {})[context];
576
575
  if (typeof contextValue === 'string') {
577
- // Case: no subcontexts
576
+ // Case: no subcontexts, init as checked
578
577
  initContextFilterState[contextValue] = true;
579
578
  } else {
580
579
  // Case: subcontexts exist
581
- initContextFilterState[contextValue._] = {};
580
+ initContextFilterState[context] = {};
582
581
  Object.values((LogMetadata.Context ?? {})[context]).forEach((subcontext) => {
583
- if (subcontext) {
584
- const subcontextValue = contextValue[subcontext];
585
- (initContextFilterState[contextValue._] as { [k: string]: boolean })[subcontextValue] = true;
582
+ // Skip self ("_")
583
+ if (subcontext === '_') {
584
+ return;
586
585
  }
586
+
587
+ // Initialize as checked
588
+ (initContextFilterState[context] as any)[subcontext] = true;
587
589
  });
588
590
  }
589
591
  });
@@ -1635,7 +1637,10 @@ const LogReviewer: React.FC<Props> = (props) => {
1635
1637
  contextFilterState[log.context] === false
1636
1638
  // None of the subcontexts are selected
1637
1639
  || (
1638
- Object.values(contextFilterState[log.context] ?? {})
1640
+ // Has subcontexts
1641
+ typeof contextFilterState[log.context] !== 'boolean'
1642
+ // None of the subcontexts are selected
1643
+ && Object.values(contextFilterState[log.context] ?? {})
1639
1644
  .every((isSelected) => {
1640
1645
  return !isSelected;
1641
1646
  })