dce-reactkit 3.2.2-beta.25 → 3.2.2-beta.27

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.25",
3
+ "version": "3.2.2-beta.27",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -527,7 +527,7 @@ const LogReviewer: React.FC<Props> = (props) => {
527
527
  // Context exists
528
528
  LogMetadata.Context
529
529
  // Context has children already
530
- && LogMetadata.Context[context] !== 'string'
530
+ && typeof LogMetadata.Context[context] !== 'string'
531
531
  ) {
532
532
  (LogMetadata.Context as any)[context][LogBuiltInMetadata.Context.Uncategorized] = (
533
533
  LogBuiltInMetadata.Context.Uncategorized
@@ -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
  });